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)
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))
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)