Home | Trees | Index | Help |
---|
Package musicbrainz2 :: Module model :: Class Disc |
|
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.
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.
Method Summary | |
---|---|
Constructor. | |
Adds a track to the list. | |
Returns the number of the first track on this disc. | |
Returns the MusicBrainz DiscID. | |
Returns the number of the last track on this disc. | |
Returns the length of the disc in sectors. | |
Returns the sector offset and length of this disc. | |
Sets the number of the first track on this disc. | |
Sets the MusicBrainz DiscId. | |
Sets the number of the last track on this disc. | |
Sets the length of the disc in sectors. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
firstTrackNum : The number of the first track on this disc. | |
id : The MusicBrainz DiscID. | |
lastTrackNum : The number of the last track on this disc. | |
sectors : The length of the disc in sectors. | |
tracks : Sector offset and length of all tracks. |
Method Details |
---|
__init__(self,
id_=None)
Constructor.
|
addTrack(self, track)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 usingsetSectors .
|
getFirstTrackNum(self)Returns the number of the first track on this disc.
|
getId(self)Returns the MusicBrainz DiscID.
|
getLastTrackNum(self)Returns the number of the last track on this disc.
|
getSectors(self)Returns the length of the disc in sectors.
|
getTracks(self)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.
|
setFirstTrackNum(self, trackNum)Sets the number of the first track on this disc.
|
setId(self, id_)Sets the MusicBrainz DiscId.
|
setLastTrackNum(self, trackNum)Sets the number of the last track on this disc.
|
setSectors(self, sectors)Sets the length of the disc in sectors.
|
Property Details |
---|
firstTrackNumThe number of the first track on this disc.
|
idThe MusicBrainz DiscID. |
lastTrackNumThe number of the last track on this disc.
|
sectorsThe length of the disc in sectors.
|
tracksSector offset and length of all tracks.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Wed Dec 20 18:19:28 2006 | http://epydoc.sf.net |