Class Disc
source code
object --+
|
Disc
Represents an Audio CD.
This class represents an Audio CD. A disc can have an ID (the
MusicBrainz DiscID), which is calculated from the CD's table of contents
(TOC). There may also be data from the TOC like the length of the disc in
sectors, as well as position and length of the tracks.
Note that different TOCs, maybe due to different pressings, lead to
different DiscIDs. Conversely, if two different discs have the same TOC,
they also have the same DiscID (which is unlikely but not impossible).
DiscIDs are always 28 characters long and look like this:
'J68I_CDcUFdCRCIbHSEbTBCbooA-'
. Sometimes they are also
referred to as CDIndex IDs.
The MusicBrainz web service only returns the DiscID and the
number of sectors. The DiscID calculation function musicbrainz2.disc.readDisc, however, can retrieve the
other attributes of Disc from an Audio CD in the disc drive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|
|
id
The MusicBrainz DiscID.
|
|
sectors
The length of the disc in sectors.
|
|
firstTrackNum
The number of the first track on this disc.
|
|
lastTrackNum
The number of the last track on this disc.
|
|
tracks
Sector offset and length of all tracks.
|
Inherited from object :
__class__
|
Constructor.
- Parameters:
id_ - a string containing a 28-character DiscID
- Overrides:
object.__init__
|
Returns the MusicBrainz DiscID.
- Returns:
- a string containing a 28-character DiscID
|
Sets the MusicBrainz DiscId.
- Parameters:
id_ - a string containing a 28-character DiscID
|
Returns the length of the disc in sectors.
- Returns:
- the length in sectors as an integer, or None
|
Sets the length of the disc in sectors.
- Parameters:
sectors - the length in sectors as an integer
|
Returns the number of the first track on this disc.
- Returns:
- an int containing the track number, or None
|
Sets the number of the first track on this disc.
- Parameters:
trackNum - an int containing the track number, or None
|
Returns the number of the last track on this disc.
- Returns:
- an int containing the track number, or None
|
Sets the number of the last track on this disc.
- Parameters:
trackNum - an int containing the track number, or None
|
Returns the sector offset and length of this disc.
This method returns a list of tuples containing the track offset and
length in sectors for all tracks on this disc. The track offset is
measured from the beginning of the disc, the length is relative to the
track's offset. Note that the leadout track is not included.
- Returns:
- a list of (offset, length) tuples (values are ints)
|
Adds a track to the list.
This method adds an (offset, length) tuple to the list of tracks. The
leadout track must not be added. The total length of the disc can
be set using setSectors.
- Parameters:
track - an (offset, length) tuple (values are ints)
|
id
The MusicBrainz DiscID.
- Get Method:
- getId(self)
- Returns the MusicBrainz DiscID.
- Set Method:
- setId(self,
id_)
- Sets the MusicBrainz DiscId.
|
sectors
The length of the disc in sectors.
- Get Method:
- getSectors(self)
- Returns the length of the disc in sectors.
- Set Method:
- setSectors(self,
sectors)
- Sets the length of the disc in sectors.
|
firstTrackNum
The number of the first track on this disc.
- Get Method:
- getFirstTrackNum(self)
- Returns the number of the first track on this disc.
- Set Method:
- setFirstTrackNum(self,
trackNum)
- Sets the number of the first track on this disc.
|
lastTrackNum
The number of the last track on this disc.
- Get Method:
- getLastTrackNum(self)
- Returns the number of the last track on this disc.
- Set Method:
- setLastTrackNum(self,
trackNum)
- Sets the number of the last track on this disc.
|
tracks
Sector offset and length of all tracks.
- Get Method:
- getTracks(self)
- Returns the sector offset and length of this disc.
|