Top | ![]() |
![]() |
![]() |
![]() |
#define | MIRAGE_ISRC_SIZE |
struct | MirageTrack |
struct | MirageTrackClass |
enum | MirageTrackConstants |
enum | MirageTrackFlags |
enum | MirageTrackModes |
MirageTrack object represents a track in the disc layout. It provides functions for manipulating track data and layout; setting track type and flags, adding and removing fragments, indices and languages, accessing and reading of sectors, etc.
gboolean (*MirageEnumFragmentCallback) (MirageFragment *fragment
,gpointer user_data
);
Callback function type used with mirage_track_enumerate_fragments()
.
A pointer to a fragment object is stored in fragment
, without incrementing
its reference counter. user_data
is user data passed to enumeration function.
gboolean (*MirageEnumIndexCallback) (MirageIndex *index
,gpointer user_data
);
Callback function type used with mirage_track_enumerate_indices()
.
A pointer to an index object is stored in index
, without incrementing
its reference counter. user_data
is user data passed to enumeration function.
void mirage_track_add_fragment (MirageTrack *self
,gint index
,MirageFragment *fragment
);
Adds a fragment implementation to track. index
is index at which fragment
should be added. Negative index denotes index going backwards (i.e. -1 adds
fragment at the end, -2 adds fragment second-to-last, etc.). If index, either
negative or positive, is too big, fragment is respectively added at the
beginning or at the end of the track.
fragment
argument cannot be NULL
.
This is because specific fragment implementation is required and therefore must be
provided by the caller.
self |
||
index |
index at which fragment should be added. |
[in] |
fragment |
a MirageFragment to be added. |
[in] |
gboolean mirage_track_add_index (MirageTrack *self
,gint address
,GError **error
);
Adds index to track.
address
is track-relative address at which index should be added. As it determines
position of the index, it also determines the number index will be assigned.
If address falls before index 01 (i.e. if it's less than address that was set
using mirage_track_set_track_start()
), the function fails.
gboolean mirage_track_add_language (MirageTrack *self
,gint code
,MirageLanguage *language
,GError **error
);
Adds language to track.
code
is language code that should be assigned to added language. If
language with that code is already present in the track, the function fails.
self |
||
code |
language code for the added language. |
[in] |
language |
a MirageLanguage to be added. |
[in][transfer full][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_track_enumerate_fragments (MirageTrack *self
,MirageEnumFragmentCallback func
,gpointer user_data
);
Iterates over fragments list, calling func
for each fragment in the layout.
If func
returns FALSE
, the function immediately returns FALSE
.
gboolean mirage_track_enumerate_indices (MirageTrack *self
,MirageEnumIndexCallback func
,gpointer user_data
);
Iterates over indices list, calling func
for each index.
If func
returns FALSE
, the function immediately returns FALSE
.
gboolean mirage_track_enumerate_languages (MirageTrack *self
,MirageEnumLanguageCallback func
,gpointer user_data
);
Iterates over languages list, calling func
for each language.
If func
returns FALSE
, the function immediately returns FALSE
.
MirageFragment * mirage_track_find_fragment_with_subchannel (MirageTrack *self
,GError **error
);
Retrieves first fragment that contains subchannel data. A reference to fragment
is stored in fragment
; it should be released with g_object_unref()
when no
longer needed.
a MirageFragment on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
gint
mirage_track_get_adr (MirageTrack *self
);
Retrieves track's ADR.
gint
mirage_track_get_ctl (MirageTrack *self
);
Retrieves track's CTL. CTL is calculated on basis of track mode and track flags.
MirageFragment * mirage_track_get_fragment_by_address (MirageTrack *self
,gint address
,GError **error
);
Retrieves fragment by address. address
must be valid (track-relative) sector
address that is part of the fragment to be retrieved (i.e. lying between fragment's
start and end address).
self |
||
address |
address belonging to fragment to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageFragment on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageFragment * mirage_track_get_fragment_by_index (MirageTrack *self
,gint index
,GError **error
);
Retrieves fragment by index. If index
is negative, fragments from the end of
track are retrieved (e.g. -1 is for last track, -2 for second-to-last
track, etc.). If index
is out of range, regardless of the sign, the
function fails.
self |
||
index |
index of fragment to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageFragment on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageIndex * mirage_track_get_index_by_address (MirageTrack *self
,gint address
,GError **error
);
Retrieves index by address. address
must be valid (track-relative) sector
address that is part of the index to be retrieved (i.e. lying between index's
start and end sector).
self |
||
address |
address belonging to index to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageIndex on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageIndex * mirage_track_get_index_by_number (MirageTrack *self
,gint number
,GError **error
);
Retrieves index by index number. If number
is negative, indices from the end of
track are retrieved (e.g. -1 is for index, -2 for second-to-last index, etc.).
If number
is out of range, regardless of the sign, the function fails.
self |
||
number |
index number of index to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageIndex on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageLanguage * mirage_track_get_language_by_code (MirageTrack *self
,gint code
,GError **error
);
Retrieves language by language code.
self |
||
code |
language code of language to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageLanguage on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageLanguage * mirage_track_get_language_by_index (MirageTrack *self
,gint index
,GError **error
);
Retrieves language by index. If index
is negative, languages from the end of
track are retrieved (e.g. -1 is for last language, -2 for second-to-last
language, etc.). If index
is out of range, regardless of the sign, the
function fails.
self |
||
index |
index of language to be retrieved. |
[in] |
error |
location to store error, or |
[out][allow-none] |
a MirageLanguage on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageTrackModes
mirage_track_get_mode (MirageTrack *self
);
Retrieves track mode.
MirageTrack * mirage_track_get_next (MirageTrack *self
,GError **error
);
Retrieves track that is placed after self
in session layout
a MirageTrack on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
gint
mirage_track_get_number_of_fragments (MirageTrack *self
);
Retrieves number of fragments making up the track.
gint
mirage_track_get_number_of_indices (MirageTrack *self
);
Retrieves number of indices the track contains. Note that this includes only indices greater than 01.
gint
mirage_track_get_number_of_languages (MirageTrack *self
);
Retrieves number of languages the track contains.
MirageTrack * mirage_track_get_prev (MirageTrack *self
,GError **error
);
Retrieves track that is placed before self
in session layout.
a MirageTrack on success, NULL
on failure.
The reference to the object should be released using g_object_unref()
when no longer needed.
[transfer full]
MirageSector * mirage_track_get_sector (MirageTrack *self
,gint address
,gboolean abs
,GError **error
);
Retrieves a sector. address
is sector address for which a MirageSector
object representing sector should be returned. abs
specifies whether address
is absolute or relative; if TRUE
, address
is absolute (i.e. relative to start
of the disc), if FALSE
, it is relative (i.e. relative to start of the track).
A reference to sector is stored in sector
; it
gint
mirage_track_get_track_start (MirageTrack *self
);
Retrieves track start address. This is track-relative address at which pregap ends and track "logically" starts (i.e. where index changes from 00 to 01).
gint
mirage_track_layout_get_length (MirageTrack *self
);
Retrieves track's length. The returned length is given in sectors.
gint
mirage_track_layout_get_session_number
(MirageTrack *self
);
Retrieves track's session number. If track is not part of disc layout, 0 is returned.
gint
mirage_track_layout_get_start_sector (MirageTrack *self
);
Retrieves track's start sector.
gint
mirage_track_layout_get_track_number (MirageTrack *self
);
Retrieves track's track number.
void mirage_track_layout_set_start_sector (MirageTrack *self
,gint start_sector
);
Sets track's start sector.
void mirage_track_layout_set_track_number (MirageTrack *self
,gint track_number
);
Set track's track number.
gboolean mirage_track_remove_fragment_by_index (MirageTrack *self
,gint index
,GError **error
);
Removes fragment from track.
index
is the index of the fragment to be removed. This function calls
mirage_track_get_fragment_by_index()
so index
behavior is determined by that
function.
void mirage_track_remove_fragment_by_object (MirageTrack *self
,MirageFragment *fragment
);
Removes fragment from track.
fragment
is a MirageFragment object to be removed.
gboolean mirage_track_remove_index_by_number (MirageTrack *self
,gint number
,GError **error
);
Removes index from track. This causes index numbers of remaining indices to be readjusted.
number
is index number of index to be removed. It must be greater or equal than 2.
void mirage_track_remove_index_by_object (MirageTrack *self
,MirageIndex *index
);
Removes index from track.This causes index numbers of remaining indices to be readjusted.
index
is a MirageIndex object to be removed.
gboolean mirage_track_remove_language_by_code (MirageTrack *self
,gint code
,GError **error
);
Removes language from track.
code
is language code the language to be removed.
gboolean mirage_track_remove_language_by_index (MirageTrack *self
,gint index
,GError **error
);
Removes language from track.
index
is the index of the language to be removed. This function calls
mirage_track_get_language_by_index()
so index
behavior is determined by that
function.
void mirage_track_remove_language_by_object (MirageTrack *self
,MirageLanguage *language
);
Removes language from track.
language
is a MirageLanguage object to be removed.
void mirage_track_set_ctl (MirageTrack *self
,gint ctl
);
Sets track's CTL; the function translates CTL into track flags and sets them
using mirage_track_set_flags()
. Track mode set with CTL is ignored.
void mirage_track_set_flags (MirageTrack *self
,gint flags
);
Sets track flags. flags
must be a combination of MirageTrackFlags.
void mirage_track_set_isrc (MirageTrack *self
,const gchar *isrc
);
Sets MCN.
Because ISRC is stored in subchannel data, this function silently fails if track contains fragments with subchannel data provided.
void mirage_track_set_mode (MirageTrack *self
,MirageTrackModes mode
);
Sets track mode. mode
must be one of MirageTrackModes.
void mirage_track_set_track_start (MirageTrack *self
,gint track_start
);
Sets track start address. track_start
is a track-relative address at which track's
pregap ends and track "logically" starts (i.e. where index changes from 00 to 01). Note that
this is not the same as start address that is set by mirage_track_layout_set_start_sector()
;
that one sets the address at which track "physically" starts (i.e. where index 00 starts).
struct MirageTrack;
All the fields in the MirageTrack structure are private to the MirageTrack implementation and should never be accessed directly.
struct MirageTrackClass { MirageObjectClass parent_class; /* Signals */ gint signal_layout_changed; };
The class structure for the MirageTrack type.
“layout-changed”
signalvoid user_function (MirageTrack *track, gpointer user_data)
Emitted when a layout of MirageTrack changed in a way that causes a bottom-up change.
Flags: Run Last