Top | ![]() |
![]() |
![]() |
![]() |
MirageFragment | |
struct | MirageFragmentClass |
enum | MirageMainDataFormat |
enum | MirageSubchannelDataFormat |
MirageFragment object represents an interface between a MirageTrack and I/O stream(s) containing the data. It allows tracks to read and/or write both sectors' main channel and subchannel data. When constructing a track, an image parser will typically create and append at least one fragment. Similarly, during image conversion and writing process, at least one fragment will be requested from image writer and written to.
A MirageFragment object is obtained using g_object_new()
function.
Both main channel and subchannel data I/O streams can be set
using mirage_fragment_main_data_set_stream()
and mirage_fragment_subchannel_data_set_stream()
functions. If no streams are set, the fragment acts as a "NULL" fragment,
and can be used to represent zero-filled pregaps and postgaps in
tracks.
gboolean mirage_fragment_contains_address (MirageFragment *self
,gint address
);
Checks whether the fragment contains the given address or not.
gint
mirage_fragment_get_address (MirageFragment *self
);
Retrieves fragment's start address. The address
is given in sectors.
gint
mirage_fragment_get_length (MirageFragment *self
);
Retrieves fragment's length. The returned length
is given in sectors.
gboolean
mirage_fragment_is_writable (MirageFragment *self
);
Checks if fragment is writable, i.e., whether it has main channel data stream set and this stream is writable.
const gchar *
mirage_fragment_main_data_get_filename
(MirageFragment *self
);
Retrieves filename of main channel data stream.
gint
mirage_fragment_main_data_get_format (MirageFragment *self
);
Retrieves main data file format.
guint64
mirage_fragment_main_data_get_offset (MirageFragment *self
);
Retrieves main data file offset.
gint
mirage_fragment_main_data_get_size (MirageFragment *self
);
Retrieves main data file sector size.
void mirage_fragment_main_data_set_format (MirageFragment *self
,gint format
);
Sets main data file format. format
must be one of MirageMainDataFormat.
void mirage_fragment_main_data_set_offset (MirageFragment *self
,guint64 offset
);
Sets main data file offset.
void mirage_fragment_main_data_set_size (MirageFragment *self
,gint size
);
Sets main data file sector size.
void mirage_fragment_main_data_set_stream (MirageFragment *self
,MirageStream *stream
);
Sets main channel data stream.
gboolean mirage_fragment_read_main_data (MirageFragment *self
,gint address
,guint8 **buffer
,gint *length
,GError **error
);
Reads main channel data for sector at fragment-relative address
(given
in sectors). The buffer for reading data into is allocated by function
and should be freed using g_free()
when no longer needed. The pointer
to buffer is stored into buffer
and the length of read data is stored into
length
.
gboolean mirage_fragment_write_main_data (MirageFragment *self
,gint address
,const guint8 *buffer
,gint length
,GError **error
);
Writes main channel data for sector at fragment-relative address
(given
in sectors).
gboolean mirage_fragment_read_subchannel_data (MirageFragment *self
,gint address
,guint8 **buffer
,gint *length
,GError **error
);
Writes subchannel data for sector at fragment-relative address
(given
in sectors).
gboolean mirage_fragment_write_subchannel_data (MirageFragment *self
,gint address
,const guint8 *buffer
,gint length
,GError **error
);
Reads subchannel data for sector at fragment-relative address
(given
in sectors). The buffer for reading data into is allocated by function
and should be freed using g_free()
when no longer needed. The pointer
to buffer is stored into buffer
and the length of read data is stored into
length
.
void mirage_fragment_set_address (MirageFragment *self
,gint address
);
Sets fragment's start address. The address
is given in sectors.
void mirage_fragment_set_length (MirageFragment *self
,gint length
);
Sets fragment's length. The length
is given in sectors.
const gchar *
mirage_fragment_subchannel_data_get_filename
(MirageFragment *self
);
Retrieves filename of subchannel data input stream.
gint
mirage_fragment_subchannel_data_get_format
(MirageFragment *self
);
Retrieves subchannel data file format.
guint64
mirage_fragment_subchannel_data_get_offset
(MirageFragment *self
);
Retrieves subchannel data file offset.
gint
mirage_fragment_subchannel_data_get_size
(MirageFragment *self
);
Retrieves subchannel data file sector size.
void mirage_fragment_subchannel_data_set_format (MirageFragment *self
,gint format
);
Sets subchannel data file format. format
must be a combination of
MirageSubchannelDataFormat.
void mirage_fragment_subchannel_data_set_offset (MirageFragment *self
,guint64 offset
);
Sets subchannel data file offset.
void mirage_fragment_subchannel_data_set_size (MirageFragment *self
,gint size
);
Sets subchannel data file sector size.
void mirage_fragment_subchannel_data_set_stream (MirageFragment *self
,MirageStream *stream
);
Sets subchannel data stream.
gboolean mirage_fragment_use_the_rest_of_file (MirageFragment *self
,GError **error
);
Uses the rest of data file. It automatically calculates and sets fragment's length.
typedef struct _MirageFragment MirageFragment;
All the fields in the MirageFragment structure are private to the MirageFragment implementation and should never be accessed directly.
struct MirageFragmentClass { MirageObjectClass parent_class; };
The class structure for the MirageFragment type.
“layout-changed”
signalvoid user_function (MirageFragment *fragment, gpointer user_data)
Emitted when a layout of MirageFragment changed in a way that causes a bottom-up change.
Flags: Run Last