MIRAGE_FInterface_BINARY interface

## MIRAGE_FInterface_BINARY interface MIRAGE_FInterface_BINARY interface — BINARY Fragment interface |

## Synopsis

    #include <mirage.h>

    enum                MIRAGE_BINARY_TrackFile_Format;
    enum                MIRAGE_BINARY_SubchannelFile_Format;
                        MIRAGE_FInterface_BINARY;
    gboolean            mirage_finterface_binary_track_file_set_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE *file,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_get_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE **file,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_set_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 offset,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_get_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 *offset,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_set_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint sectsize,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_get_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *sectsize,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_set_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint format,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_get_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *format,
                                                             GError **error);
    gboolean            mirage_finterface_binary_track_file_get_position
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint address,
                                                             guint64 *position,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_set_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE *file,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_get_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE **file,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_set_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 offset,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_get_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 *offset,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_set_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint sectsize,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_get_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *sectsize,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_set_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint format,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_get_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *format,
                                                             GError **error);
    gboolean            mirage_finterface_binary_subchannel_file_get_position
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint address,
                                                             guint64 *position,
                                                             GError **error);

## Description

MIRAGE_FInterface_BINARY is BINARY Fragment interface that can be implemented by a MIRAGE_Fragment implementation.

## Details

### enum MIRAGE_BINARY_TrackFile_Format

    typedef enum {
        FR_BIN_TFILE_DATA  = 0x01,
        FR_BIN_TFILE_AUDIO = 0x02,
        FR_BIN_TFILE_AUDIO_SWAP = 0x04,
    } MIRAGE_BINARY_TrackFile_Format;

Track file data formats.

`FR_BIN_TFILE_DATA` | binary data
`FR_BIN_TFILE_AUDIO` | audio data
`FR_BIN_TFILE_AUDIO_SWAP` | audio data that needs to be swapped

### enum MIRAGE_BINARY_SubchannelFile_Format

    typedef enum {
        FR_BIN_SFILE_INT = 0x01,
        FR_BIN_SFILE_EXT = 0x02,

        FR_BIN_SFILE_PW96_INT = 0x10,
        FR_BIN_SFILE_PW96_LIN = 0x20,
        FR_BIN_SFILE_RW96     = 0x40,
        FR_BIN_SFILE_PQ16     = 0x80,
    } MIRAGE_BINARY_SubchannelFile_Format;

Subchannel file data formats.

`FR_BIN_SFILE_INT` | internal subchannel (i.e. included in track file)
`FR_BIN_SFILE_EXT` | external subchannel (i.e. provided by separate file)
`FR_BIN_SFILE_PW96_INT` | P-W subchannel, 96 bytes, interleaved
`FR_BIN_SFILE_PW96_LIN` | P-W subchannel, 96 bytes, linear
`FR_BIN_SFILE_RW96` | R-W subchannel, 96 bytes, deinterleaved
`FR_BIN_SFILE_PQ16` | PQ subchannel, 16 bytes

### MIRAGE_FInterface_BINARY

    typedef struct _MIRAGE_FInterface_BINARY MIRAGE_FInterface_BINARY;

Dummy interface structure.

### mirage_finterface_binary_track_file_set_handle ()

    gboolean            mirage_finterface_binary_track_file_set_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE *file,
                                                             GError **error);

Sets track file handle.

`self` : | a MIRAGE_FInterface_BINARY
`file` : | track file handle
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_get_handle ()

    gboolean            mirage_finterface_binary_track_file_get_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE **file,
                                                             GError **error);

Retrieves track file handle.

`self` : | a MIRAGE_FInterface_BINARY
`file` : | location to store track file handle
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_set_offset ()

    gboolean            mirage_finterface_binary_track_file_set_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 offset,
                                                             GError **error);

Sets track file offset.

`self` : | a MIRAGE_FInterface_BINARY
`offset` : | track file offset
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_get_offset ()

    gboolean            mirage_finterface_binary_track_file_get_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 *offset,
                                                             GError **error);

Retrieves track file offset.

`self` : | a MIRAGE_FInterface_BINARY
`offset` : | location to store track file offset
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_set_sectsize ()

    gboolean            mirage_finterface_binary_track_file_set_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint sectsize,
                                                             GError **error);

Sets track file sector size.

`self` : | a MIRAGE_FInterface_BINARY
`sectsize` : | track file sector size
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_get_sectsize ()

    gboolean            mirage_finterface_binary_track_file_get_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *sectsize,
                                                             GError **error);

Retrieves track file sector size.

`self` : | a MIRAGE_FInterface_BINARY
`sectsize` : | location to store track file sector size.
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_set_format ()

    gboolean            mirage_finterface_binary_track_file_set_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint format,
                                                             GError **error);

Sets track file data format. `format` must be one of MIRAGE_BINARY_TrackFile_Format.

`self` : | a MIRAGE_FInterface_BINARY
`format` : | track file data format
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_get_format ()

    gboolean            mirage_finterface_binary_track_file_get_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *format,
                                                             GError **error);

Retrieves track file data format.

`self` : | a MIRAGE_FInterface_BINARY
`format` : | location to store track file data format
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_track_file_get_position ()

    gboolean            mirage_finterface_binary_track_file_get_position
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint address,
                                                             guint64 *position,
                                                             GError **error);

Calculates position of data for sector at address `address` within track file and stores it in `position`.

`self` : | a MIRAGE_FInterface_BINARY
`address` : | address
`position` : | location to store position
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_set_handle ()

    gboolean            mirage_finterface_binary_subchannel_file_set_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE *file,
                                                             GError **error);

Sets subchannel file handle.

`self` : | a MIRAGE_FInterface_BINARY
`file` : | subchannel file handle
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_get_handle ()

    gboolean            mirage_finterface_binary_subchannel_file_get_handle
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             FILE **file,
                                                             GError **error);

Retrieves subchannel file handle.

`self` : | a MIRAGE_FInterface_BINARY
`file` : | location to store subchannel file handle
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_set_offset ()

    gboolean            mirage_finterface_binary_subchannel_file_set_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 offset,
                                                             GError **error);

Sets subchannel file offset.

`self` : | a MIRAGE_FInterface_BINARY
`offset` : | subchannel file offset
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_get_offset ()

    gboolean            mirage_finterface_binary_subchannel_file_get_offset
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             guint64 *offset,
                                                             GError **error);

Retrieves subchannel file offset.

`self` : | a MIRAGE_FInterface_BINARY
`offset` : | location to store subchannel file offset
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_set_sectsize ()

    gboolean            mirage_finterface_binary_subchannel_file_set_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint sectsize,
                                                             GError **error);

Sets subchannel file sector size.

`self` : | a MIRAGE_FInterface_BINARY
`sectsize` : | subchannel file sector size
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_get_sectsize ()

    gboolean            mirage_finterface_binary_subchannel_file_get_sectsize
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *sectsize,
                                                             GError **error);

Retrieves subchannel file sector size.

`self` : | a MIRAGE_FInterface_BINARY
`sectsize` : | location to store subchannel file sector size
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_set_format ()

    gboolean            mirage_finterface_binary_subchannel_file_set_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint format,
                                                             GError **error);

Sets subchannel file data format. `format` must be a combination of ž MIRAGE_BINARY_SubchannelFile_Format.

`self` : | a MIRAGE_FInterface_BINARY
`format` : | subchannel file data format
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_get_format ()

    gboolean            mirage_finterface_binary_subchannel_file_get_format
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint *format,
                                                             GError **error);

Retrieves subchannel file data format.

`self` : | a MIRAGE_FInterface_BINARY
`format` : | location to store subchannel data format
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_finterface_binary_subchannel_file_get_position ()

    gboolean            mirage_finterface_binary_subchannel_file_get_position
                                                            (MIRAGE_FInterface_BINARY *self,
                                                             gint address,
                                                             guint64 *position,
                                                             GError **error);

Calculates position of data for sector at address `address` within subchannel file and stores it in `position`.

`self` : | a MIRAGE_FInterface_BINARY
`address` : | address
`position` : | location to store position
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

## See Also

MIRAGE_Fragment