Package screenlets :: Package plugins :: Module GenericPlayer
[hide private]
[frames] | no frames]

Source Code for Module screenlets.plugins.GenericPlayer

 1  # This program is free software: you can redistribute it and/or modify 
 2  # it under the terms of the GNU General Public License as published by 
 3  # the Free Software Foundation, either version 3 of the License, or 
 4  # (at your option) any later version. 
 5  #  
 6  # This program is distributed in the hope that it will be useful, 
 7  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 8  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 9  # GNU General Public License for more details. 
10  #  
11  # You should have received a copy of the GNU General Public License 
12  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
13   
14   
15  # A Generic API to a Music Player by vrunner 
16  # All Players must extend this class 
17   
18 -class GenericAPI(object):
19 __name__ = 'GenericAPI' 20 __version__ = '0.0' 21 __author__ = 'vrunner' 22 __desc__ = 'A Generic API to a Music Player. All Players must extend this' 23 24 session_bus = False 25 26
27 - def __init__(self, session_bus):
29 30 # Check if the player is active : Returns Boolean 31 # A handle to the dbus interface is passed in : doesn't need to be used 32 # if there are other ways of checking this (like dcop in amarok)
33 - def is_active(self, dbus_iface):
34 pass
35 36 # Make a connection to the Player
37 - def connect(self):
38 pass
39 40 # The following return Strings
41 - def get_title(self):
42 pass
43
44 - def get_album(self):
45 pass
46
47 - def get_artist(self):
48 pass
49
50 - def get_cover_path(self):
51 pass
52 53 # Returns Boolean
54 - def is_playing(self):
55 pass
56 57 # The following do not return any values
58 - def play_pause(self):
59 pass
60
61 - def next(self):
62 pass
63
64 - def previous(self):
65 pass
66 67 # The following calls the passed Callback function when one of the following event occurs: 68 # - Song Change, Play/Pause, Info Change 69 # If no dbus api to support it, then just do call the callback fn every few seconds
70 - def register_change_callback(self, fn):
71 pass
72 73 # I haven't put in functions yet for volume control, and track control 74