Mirage.Session¶
- Subclasses:
None
Methods¶
- Inherited:
Mirage.Object (2), GObject.Object (37), Mirage.Contextual (8)
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a layout of |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Mirage.Session(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
Mirage.Session
structure are private to theMirage.Session
implementation and should never be accessed directly.- add_language(code, language)¶
- Parameters:
code (
int
) – language code for the added languagelanguage (
Mirage.Language
) – aMirage.Language
to be added
- Raises:
- Returns:
- Return type:
Adds language to session.
code is language code that should be assigned to added language. If language with that code is already present in the session, the function fails.
- add_track_by_index(index, track)¶
- Parameters:
index (
int
) – index at which track should be addedtrack (
Mirage.Track
) – aMirage.Track
to be added
Adds track to session layout.
index is the index at which track is added. Negative index denotes index going backwards (i.e. -1 adds track at the end, -2 adds track second-to-last, etc.). If index, either negative or positive, is too big, track is respectively added at the beginning or at the end of the layout.
Causes bottom-up change.
- add_track_by_number(number, track)¶
- Parameters:
number (
int
) – track number for the added tracktrack (
Mirage.Track
) – aMirage.Track
to be added
- Raises:
- Returns:
- Return type:
Adds track to session layout.
number is track number that should be assigned to added track. It determines track’s position in the layout. If track with that number already exists in the layout, the function fails.
Causes bottom-up change.
- enumerate_languages(func, *user_data)¶
- Parameters:
func (
Mirage.EnumLanguageCallback
) – callback functionuser_data (
object
orNone
) – data to be passed to callback function
- Returns:
- Return type:
Iterates over languages list, calling func for each language.
If func returns
False
, the function immediately returnsFalse
.
- enumerate_tracks(func, *user_data)¶
- Parameters:
func (
Mirage.EnumTrackCallback
) – callback functionuser_data (
object
orNone
) – data to be passed to callback function
- Returns:
- Return type:
Iterates over tracks list, calling func for each track in the layout.
If func returns
False
, the function immediately returnsFalse
.
- get_cdtext_data()¶
- Raises:
- Returns:
True
on success,False
on failure- data:
location to return buffer with encoded CD-TEXT data
- Return type:
Returns CD-TEXT data for session. It internally creates and uses
Mirage.CdTextCoder
object as an encoder to encode data fromMirage.Language
objects from both session and its tracks. Buffer with encoded data is stored in data; it should be freed withGLib.free
() when no longer needed.
- get_language_by_code(code)¶
- Parameters:
code (
int
) – language code of language to be retrieved- Raises:
- Returns:
a
Mirage.Language
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves language by language code.
- get_language_by_index(index)¶
- Parameters:
index (
int
) – index of language to be retrieved- Raises:
- Returns:
a
Mirage.Language
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves language by index. If index is negative, languages from the end of session 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.
- get_leadout_length()¶
- Returns:
leadout length
- Return type:
Retrieves session’s leadout length. The returned length is given in sectors.
Intended for internal use only.
- get_mcn()¶
- Returns:
pointer to MCN string, or
None
. The string belongs to the object and should not be modified.- Return type:
Retrieves MCN.
- get_next()¶
- Raises:
- Returns:
a
Mirage.Session
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves session that is placed after self in disc layout.
- get_number_of_languages()¶
- Returns:
number of languages
- Return type:
Retrieves number of languages the session contains.
- get_number_of_tracks()¶
- Returns:
number of tracks
- Return type:
Retrieves number of tracks in the session layout.
- get_prev()¶
- Raises:
- Returns:
a
Mirage.Session
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves session that is placed before self in disc layout.
- get_session_type()¶
- Returns:
session type
- Return type:
Retrieves session type.
- get_track_after(track)¶
- Parameters:
track (
Mirage.Track
) – a track- Raises:
- Returns:
a
Mirage.Track
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves track that comes after track.
- get_track_before(track)¶
- Parameters:
track (
Mirage.Track
) – a track- Raises:
- Returns:
a
Mirage.Track
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves track that comes before track.
- get_track_by_address(address)¶
- Parameters:
address (
int
) – address belonging to track to be retrieved- Raises:
- Returns:
a
Mirage.Track
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves track by address. address must be valid (disc-relative) sector address that is part of the track to be retrieved (i.e. lying between tracks’s start and end sector).
- get_track_by_index(index)¶
- Parameters:
index (
int
) – index of track to be retrieved- Raises:
- Returns:
a
Mirage.Track
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves track by index. If index is negative, tracks from the end of layout 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.
- get_track_by_number(number)¶
- Parameters:
number (
int
) – number of track to be retrieved- Raises:
- Returns:
a
Mirage.Track
on success,None
on failure. The reference to the object should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Retrieves track by track number.
- layout_contains_address(address)¶
- Parameters:
address (
int
) – address to be checked- Returns:
- Return type:
Checks whether the session contains the given address or not.
- layout_get_first_track()¶
- Returns:
first track number
- Return type:
Retrieves track number of the first track in the session layout.
Intended for internal use only.
- layout_get_length()¶
- Returns:
session layout length
- Return type:
Retrieves length of the session layout. This means the length of all tracks combined, including lead-in and lead-out tracks. The returned length is given in sectors.
- layout_get_session_number()¶
- Returns:
session number
- Return type:
Retrieves sessions’s session number.
- layout_get_start_sector()¶
- Returns:
start sector
- Return type:
Retrieves start sector of the session layout.
Intended for internal use only.
- layout_set_first_track(first_track)¶
- Parameters:
first_track (
int
) – first track number
Sets first track number to first_track. This is a number that is assigned to the first track in the session layout.
Intended for internal use only.
Causes top-down change.
- layout_set_session_number(number)¶
- Parameters:
number (
int
) – session number
Sets sessions’s session number.
Intended for internal use only.
- layout_set_start_sector(start_sector)¶
- Parameters:
start_sector (
int
) – start sector
Sets start sector of the session layout to start_sector. This is a sector at which the first track in the session layout will start.
Intended for internal use only.
Causes top-down change.
- remove_language_by_code(code)¶
- Parameters:
code (
int
) – language code of language to be removed- Raises:
- Returns:
- Return type:
Removes language from session.
code is language code the language to be removed.
- remove_language_by_index(index)¶
- Parameters:
index (
int
) – index of language to be removed- Raises:
- Returns:
- Return type:
Removes language from session.
index is the index of the language to be removed. This function calls
Mirage.Session.get_language_by_index
() so index behavior is determined by that function.
- remove_language_by_object(language)¶
- Parameters:
language (
Mirage.Language
) – language object to be removed
Removes language from session.
language is a
Mirage.Language
object to be removed.
- remove_track_by_index(index)¶
- Parameters:
index (
int
) – index of track to be removed- Raises:
- Returns:
- Return type:
Removes track from session layout.
index is the index of the track to be removed. This function calls
Mirage.Session.get_track_by_index
() so index behavior is determined by that function.Causes bottom-up change.
- remove_track_by_number(number)¶
- Parameters:
number (
int
) – track number of track to be removed- Raises:
- Returns:
- Return type:
Removes track from session layout.
number is track number of the track to be removed.
Causes bottom-up change.
- remove_track_by_object(track)¶
- Parameters:
track (
Mirage.Track
) – track object to be removed
Removes track from session layout.
track is a
Mirage.Track
object to be removed.Causes bottom-up change.
- set_cdtext_data(data)¶
- Parameters:
data (
bytes
) – buffer containing encoded CD-TEXT data- Raises:
- Returns:
- Return type:
Sets CD-TEXT data for session. It internally creates and uses
Mirage.CdTextCoder
object as a decoder to decode data in data. Decoded data is stored inMirage.Language
objects in both session and its tracks. Therefore session must have same number of tracks as the encoded CD-TEXT data.
- set_leadout_length(length)¶
- Parameters:
length (
int
) – leadout length
Sets session’s leadout length to length. It does so by creating
None
fragment and adding it to leadout. This function is internally used to properly handle multi-session disc layouts. The length is given in sectors.Intended for internal use only.
- set_mcn(mcn)¶
- Parameters:
mcn (
str
) – MCN
Sets MCN (Media Catalogue Number).
Because MCN is stored in subchannel data, this function silently fails if any of session’s tracks contains fragments with subchannel data provided.
Intended for internal use only.
- set_session_type(type)¶
- Parameters:
type (
Mirage.SessionType
) – session type
Sets session type. type must be one of
Mirage.SessionType
.
Signal Details¶
- Mirage.Session.signals.layout_changed(session)¶
- Signal Name:
layout-changed
- Flags:
- Parameters:
session (
Mirage.Session
) – The object which received the signal
Emitted when a layout of
Mirage.Session
changed in a way that causes a bottom-up change.