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