Package screenlets :: Package plugins :: Module GenericPlayer

[hide private]
[frames] | no frames]

# Source Code for Module screenlets.plugins.GenericPlayer

     1  # This application is released under the GNU General Public License
     2  # v3 (or, at your option, any later version). You can find the full
     3  # text of the license under http://www.gnu.org/licenses/gpl.txt.
     4  # By using, editing and/or distributing this software you agree to
     5  # the terms and conditions of this license.
     6  # Thank you for using free software!
     7
     8
     9  # A Generic API to a Music Player by vrunner
    10  # All Players must extend this class
    11
    12 -class GenericAPI:
    13          __name__ = 'GenericAPI'
    14          __version__ = '0.0'
    15          __author__ = 'vrunner'
    16          __desc__ = 'A Generic API to a Music Player. All Players must extend this'
    17
    18          session_bus = False
    19
    20
    21 -        def __init__(self, session_bus):
    22                  self.session_bus = session_bus
    23
    24          # Check if the player is active : Returns Boolean
    25          # A handle to the dbus interface is passed in : doesn't need to be used
    26          # if there are other ways of checking this (like dcop in amarok)
    27 -        def is_active(self, dbus_iface):
    28                  pass
    29
    30          # Make a connection to the Player
    31 -        def connect(self):
    32                  pass
    33
    34          # The following return Strings
    35 -        def get_title(self):
    36                  pass
    37
    38 -        def get_album(self):
    39                  pass
    40
    41 -        def get_artist(self):
    42                  pass
    43
    44 -        def get_cover_path(self):
    45                  pass
    46
    47          # Returns Boolean
    48 -        def is_playing(self):
    49                  pass
    50
    51          # The following do not return any values
    52 -        def play_pause(self):
    53                  pass
    54
    55 -        def next(self):
    56                  pass
    57
    58 -        def previous(self):
    59                  pass
    60
    61          # The following calls the passed Callback function when one of the following event occurs:
    62          # - Song Change, Play/Pause, Info Change
    63          # If no dbus api to support it, then just do call the callback fn every few seconds
    64 -        def register_change_callback(self, fn):
    65                  pass
    66
    67          # I haven't put in functions yet for volume control, and track control
    68