1 # -*- coding: utf-8 -*-
4 # Add decorator to filter through history?
6 # standard library import
10 #from sima.lib.track import Track
15 """Player interface to inherit from.
17 When querying player music library for tracks, Player instance *must* return
18 Track objects (usually a list of them)
20 Player instance should expose the following immutable attributes:
31 self.log = logging.getLogger('sima')
34 """Monitor player for change
36 * database player media library has changed
37 * playlist playlist modified
38 * options player options changed: repeat mode, etc…
39 * player player state changed: paused, stopped, skip track…
41 raise NotImplementedError
43 def remove(self, position=0):
44 """Removes the oldest element of the playlist (index 0)
46 raise NotImplementedError
48 def find_track(self, artist, title=None):
50 Find tracks for a specific artist or filtering with a track title
51 >>> player.find_track('The Beatles')
52 >>> player.find_track('Nirvana', title='Smells Like Teen Spirit')
54 Returns a list of Track objects
56 raise NotImplementedError
58 def find_album(self, artist, album):
60 Find tracks by track's album name
61 >>> player.find_album('Nirvana', 'Nevermind')
63 Returns a list of Track objects
65 raise NotImplementedError
67 def find_albums(self, artist):
69 Find albums by artist's name
70 >>> player.find_alums('Nirvana')
72 Returns a list of string objects
74 raise NotImplementedError
76 def fuzzy_find_artist(self, artist):
78 Find artists based on a fuzzy search in the media library
79 >>> bea = player.fuzzy_find_artist('beatles')
83 Returns a list of strings (artist names)
85 raise NotImplementedError
88 """Closing client connection with the Player
90 raise NotImplementedError
93 """Connect client to the Player
95 raise NotImplementedError
98 # vim: ai ts=4 sw=4 sts=4 expandtab