]> kaliko git repositories - mpd-sima.git/blob - sima/lib/player.py
9f2910d048548bd3a1544b1c6ef4a85a7242b269
[mpd-sima.git] / sima / lib / player.py
1 # -*- coding: utf-8 -*-
2
3 # TODO:
4 # Add decorator to filter through history?
5
6 # local import
7 #from sima.lib.track import Track
8
9
10 class Player(object):
11
12     """Player interface to inherit from.
13
14     When querying player music library for tracks, Player instance *must* return
15     Track objects (usually a list of them)
16     """
17
18     def __init__(self):
19         self.state = {}
20         self.current = {}
21
22     def monitor(self):
23         """Monitor player for change
24         Returns :
25             * database  player media library has changed
26             * playlist  playlist modified
27             * options   player options changed: repeat mode, etc…
28             * player    player state changed: paused, stopped, skip track…
29         """
30         raise NotImplementedError
31
32     def remove(self, position=0):
33         """Removes the oldest element of the playlist (index 0)
34         """
35         raise NotImplementedError
36
37     def find_track(self, artist, title=None):
38         """
39         Find tracks for a specific artist or filtering with a track title
40             >>> player.find_track('The Beatles')
41             >>> player.find_track('Nirvana', title='Smells Like Teen Spirit')
42
43         Returns a list of Track objects
44         """
45         raise NotImplementedError
46
47     def find_album(self, artist, album):
48         """
49         Find tracks by track's album name
50             >>> player.find_track('Nirvana', 'Nevermind')
51
52         Returns a list of Track objects
53         """
54
55     def disconnect(self):
56         """Closing client connection with the Player
57         """
58         raise NotImplementedError
59
60     def connect(self):
61         """Connect client to the Player
62         """
63         raise NotImplementedError
64
65 # VIM MODLINE
66 # vim: ai ts=4 sw=4 sts=4 expandtab
67