def GetValue(self):
     if self.isValid():
         if self.m_radioAuto.GetValue():
             return ChannelsMap.auto()
         elif self.m_radioAllChannels.GetValue():
             return ChannelsMap.all()
         else:
             chs = [c for c in self.channels if self.channels[c].GetValue()]
             return ChannelsMap.custom(chs)
     else:
         return ChannelsMap.auto()
Beispiel #2
0
    def selectStream(self, file, updateLang=False):
        self.m_listStreams.selectStream(file.no)
        self.file.no = file.no
        self.file.type = file.type

        if updateLang and file.lang:
            self.file.lang = validateLang(file.lang)
            self.m_choiceLang.SetValue(self.file.lang)

        isSubText = file.type == 'subtitle/text'
        isAudio = file.type == 'audio'

        if isAudio:
            self.selectAudioChannels(ChannelsMap.auto())
        else:
            self.m_textChannels.SetValue('')

        self.m_choiceEncoding.Enable(isSubText)
        self.m_textChannels.Enable(isAudio)
        self.m_buttonSelectChannels.Enable(isAudio)
        self.m_buttonOk.Enable(True)