def adjustmentChanged(self, widget): ## A generic function called when scrolling a scrollbar. # See above for description. dicEntry = self.adjDic[widget] cfg.set(dicEntry[CFGS], widget.get_value()) if (CLBKS in dicEntry): dicEntry[CLBKS](widget)
def entryChanged(self, widget): ## A generic function called when text in an entry is changed. # See above for description. dicEntry = self.entDic[widget] cfg.set(dicEntry[CFGS], widget.get_text()) if (CLBKS in dicEntry): dicEntry[CLBKS](widget)
def checkboxToggle(self, widget): ## A generic function called when toggling a checkbox. dicEntry = self.chkDic[widget] # First we change the config option apporpriately. cfg.set(dicEntry[CFGS], widget.get_active()) # Then if there's a callback present, call it. if (CLBKS in dicEntry): dicEntry[CLBKS](widget)
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()
def changeVolume(self, widget, value): # Set the new volume on player and configuration. player.player.set_property('volume',value) cfg.set("audio/volume", value)
def extNewFileChanged(self, widget): ## Changes the saved option for the external file action. cfg.set('misc/onextnewfile', widget.get_active())
def changeFont(self, widget): # Callback when the subtitle font is changed. font = widget.get_font_name() # Set the config option and apply the change to the player. cfg.set('video/subfont', font) player.setSubFont(font)
def subsEncChanged(self, widget): # Set the subtitle encoding cfg.set('video/subenc', widget.get_text())
def subsExtsChanged(self, widget): # Change the automatically detected subtitles extensions. cfg.set('video/autosubexts', widget.get_text())
def autoSubsToggled(self, widget): # Set the automatic subtitles config option. cfg.set('video/autosub', widget.get_active())