def preparePlayer(self): ## This prepares the player. # Get the bus and connect the signals. bus = player.player.get_bus() bus.connect('message', self.onPlayerMessage) bus.connect('sync-message::element', self.onPlayerSyncMessage) player.player.connect('about-to-finish', self.aboutToFinish) # Sets the sinks. player.setAudioSink() player.setVideoSink()
def changeAudioDevice(self, widget): ## Changes the output audio device. # Get the active index. index = widget.get_active() if (index == 0): # This is the default/auto option. cfg.set('audio/audiosink', '') cfg.set('audio/audiodevice', '') elif (index >= 2): # We don't want to change the settings if the index is 1 (manually set) # or 0 (default/auto). # Set the sink, and the device (-1 to account for the 'other' option) cfg.set('audio/audiosink', 'alsasink') cfg.set('audio/audiodevice', self.audioDevDic.keys()[index - 2]) # Set the audio sink. if (index != 1): player.setAudioSink()