def __init__(self): QtCore.QObject.__init__(self) self.log.debug("%s instantiating" % self.__class__.__name__) self.player = QtPlayer() self.audio_source = EventAggregator() if get_config()['SOCKET_TCP']: self.tcp_socket = TCPCommandSocket(self, get_config()['SOCKET_TCP']) if get_config()['SOCKET_HTTP']: self.http_socket = HTTPCommandSocket(self, get_config()['SOCKET_HTTP']) self.player.empty.connect(self.on_empty)
def __init__(self): QtCore.QObject.__init__(self) self.log.debug("%s instantiating" % self.__class__.__name__) self.player = QtPlayer() self.audio_source = EventAggregator() if get_config()['SOCKET_TCP']: self.tcp_socket = TCPCommandSocket( self, get_config()['SOCKET_TCP']) if get_config()['SOCKET_HTTP']: self.http_socket = HTTPCommandSocket( self, get_config()['SOCKET_HTTP']) self.player.empty.connect(self.on_empty)
class Controller(QtCore.QObject): '''all the main logic, without those boring details''' # when a Event rings event_occurred = QtCore.pyqtSignal() song_finished = QtCore.pyqtSignal() # just before exiting, to do some cleaning closing = QtCore.pyqtSignal() @log.cls_logger def __init__(self): QtCore.QObject.__init__(self) self.log.debug("%s instantiating" % self.__class__.__name__) self.player = QtPlayer() self.audio_source = EventAggregator() if get_config()['SOCKET_TCP']: self.tcp_socket = TCPCommandSocket( self, get_config()['SOCKET_TCP']) if get_config()['SOCKET_HTTP']: self.http_socket = HTTPCommandSocket( self, get_config()['SOCKET_HTTP']) self.player.empty.connect(self.on_empty) def start(self): self.on_empty() def on_empty(self): self.log.debug("Playlist empty, need to fill") next_audio = self.audio_source.get_next() # This keeps the reference to the current playing Bell; # it's very important not to mess with this, because the __del__ method # is used to automatically remove files from cache self.current = next_audio assert type(next_audio) is list self.player.now_play_sequence(next_audio)
class Controller(QtCore.QObject): '''all the main logic, without those boring details''' # when a Event rings event_occurred = QtCore.pyqtSignal() song_finished = QtCore.pyqtSignal() # just before exiting, to do some cleaning closing = QtCore.pyqtSignal() @log.cls_logger def __init__(self): QtCore.QObject.__init__(self) self.log.debug("%s instantiating" % self.__class__.__name__) self.player = QtPlayer() self.audio_source = EventAggregator() if get_config()['SOCKET_TCP']: self.tcp_socket = TCPCommandSocket(self, get_config()['SOCKET_TCP']) if get_config()['SOCKET_HTTP']: self.http_socket = HTTPCommandSocket(self, get_config()['SOCKET_HTTP']) self.player.empty.connect(self.on_empty) def start(self): self.on_empty() def on_empty(self): self.log.debug("Playlist empty, need to fill") next_audio = self.audio_source.get_next() # This keeps the reference to the current playing Bell; # it's very important not to mess with this, because the __del__ method # is used to automatically remove files from cache self.current = next_audio assert type(next_audio) is list self.player.now_play_sequence(next_audio)