Exemplo n.º 1
0
 def __init__(self, library, host, port, password):
     try:
         from beetsplug.bpd import gstplayer
     except ImportError as e:
         # This is a little hacky, but it's the best I know for now.
         if e.args[0].endswith(' gst'):
             raise NoGstreamerError()
         else:
             raise
     super(Server, self).__init__(host, port, password)
     self.lib = library
     self.player = gstplayer.GstPlayer(self.play_finished)
     self.cmd_update(None)
Exemplo n.º 2
0
 def __init__(self, library, host, port, password, log):
     try:
         from beetsplug.bpd import gstplayer
     except ImportError as e:
         # This is a little hacky, but it's the best I know for now.
         if e.args[0].endswith(' gst'):
             raise NoGstreamerError()
         else:
             raise
     log.info(u'Starting server...')
     super(Server, self).__init__(host, port, password, log)
     self.lib = library
     self.player = gstplayer.GstPlayer(self.play_finished)
     self.cmd_update(None)
     log.info(u'Server ready and listening on {}:{}'.format(host, port))
Exemplo n.º 3
0
class Server(BaseServer):
    """An MPD-compatible server using GStreamer to play audio and beets
    to store its library.
    """

    def __init__(self, library, host='', port=DEFAULT_PORT, password=''):
        try:
            from beetsplug.bpd import gstplayer
        except ImportError, e:
            # This is a little hacky, but it's the best I know for now.
            if e.args[0].endswith(' gst'):
                raise NoGstreamerError()
            else:
                raise
        super(Server, self).__init__(host, port, password)
        self.lib = library
        self.player = gstplayer.GstPlayer(self.play_finished)