13
13
# agreement from Fluendo.
14
14
# See "LICENSE.Elisa" in the root directory of this distribution package
15
15
# for details on that license.
17
# Authors: Benjamin Kampmann <benjamin@fluendo.com>
18
# Olivier Tilloy <olivier@fluendo.com>
19
# Philippe Normand <philippe@fluendo.com>
22
Common models related to audio.
17
25
from elisa.core.components.model import Model
19
class AudioAlbumModel(Model):
28
class AlbumModel(Model):
31
Representation of an audio album.
21
33
An audio album model may contain metadata associated to an audio album,
22
34
such as the name of the artist, name of the album, list of the tracks,
25
@ivar artist: the name of the artist
26
@type artist: C{unicode}
27
@ivar album: the name of the audio album
28
@type album: C{unicode}
29
@ivar tracks: a list of the names of the audio tracks on the audio album
30
@type tracks: C{list} of C{unicode}
37
@ivar artist: the name of the artist
38
@type artist: C{unicode}
39
@ivar album: the name of the audio album
40
@type album: C{unicode}
41
@ivar musicbrainz_id: a unique id to request more information from
43
@type musicbrainz_id: C{unicode}
44
@ivar cover: the cover art for the album
45
@type cover: L{elisa.plugins.base.models.image.ImageModel}
46
@ivar tracks: the list of tracks on the album
47
@type tracks: C{list} of
48
L{elisa.plugins.base.models.audio.TrackModel}
53
Constructor. Initialize all the fields.
55
super(AlbumModel, self).__init__()
58
self.musicbrainz_id = None
63
class TrackModel(Model):
66
Representation of an audio track on an album.
68
@ivar title: the title of the track
69
@type title: C{unicode}
70
@ivar artist: the name of the artist of the track
71
@type artist: C{unicode}
72
@ivar duration: the duration of the track (in seconds)
73
@type duration: C{int}
74
@ivar track_number: the number of the track on the album
75
@type track_number: C{int}
76
@ivar playable_uri: the URI to query the resource provider with to get a
77
playable model containing the real URI of the audio
79
@type playable_uri: L{elisa.core.media_uri.MediaUri}
83
super(TrackModel, self).__init__()
87
self.track_number = None
88
self.playable_uri = None
91
class ArtistModel(Model):
94
Representation of an artist.
96
@ivar name: name of the artist
97
@type name: C{unicode}
98
@ivar musicbrainz_id: a unique id to request more information from
100
@type musicbrainz_id: C{unicode}
101
@ivar images: visual representations of the artist
102
@type images: C{list} of
103
{elisa.plugins.base.models.image.ImageModel}
107
super(ArtistModel, self).__init__()
109
self.musicbrainz_id = None