def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.AspectRatioSwitch.showmsg.value: Notifications.AddPopup( text=_("Aspect ratio switched from:\n %s\nto:\n %s") % (ASPECTMSG[ASPECT[aspectnum]], ASPECTMSG[ASPECT[newaspectnum]]), type=MessageBox.TYPE_INFO, timeout=5, id='AspectRatioSwitch') print( pluginPrintname, "Aspect ratio switched from %d - %s to %d - %s" % (aspectnum, ASPECT[aspectnum], newaspectnum, ASPECT[newaspectnum]))
def draw(self): self.drawList = [] self.listindex = 0 self.videomodes_enabled = [] if config.sifteam.switch_4_3_letterbox.value == True: self.videomodes_enabled.append("4_3_letterbox") if config.sifteam.switch_4_3_panscan.value == True: self.videomodes_enabled.append("4_3_panscan") if config.sifteam.switch_16_9.value == True: self.videomodes_enabled.append("16_9") if config.sifteam.switch_16_9_always.value == True: self.videomodes_enabled.append("16_9_always") if config.sifteam.switch_16_10_letterbox.value == True: self.videomodes_enabled.append("16_10_letterbox") if config.sifteam.switch_16_10_panscan.value == True: self.videomodes_enabled.append("16_10_panscan") if config.sifteam.switch_16_9_letterbox.value == True: self.videomodes_enabled.append("16_9_letterbox") try: iAVSwitch = AVSwitch() current_videomode = self.videomodes[iAVSwitch.getAspectRatioSetting()] self.listindex = self.videomodes_enabled.index(current_videomode) except Exception: pass for videomode in self.videomodes_enabled: index = self.videomodes.index(videomode) self.drawList.append((_(self.videodescs[index]),)) self["menu"].setList(self.drawList) self["menu"].setIndex(self.listindex)
def changeVideoMode(self): iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() aspectnum += 1 if aspectnum >= len(self.videomodes): aspectnum = 0 iAVSwitch.setAspectRatio(aspectnum) config.av.aspectratio.setValue(self.videomodes[aspectnum])
def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.GBAspectRatioSwitch.showmsg.value: Notifications.AddPopup(text=ASPECTMSG[ASPECT[newaspectnum]], type=MessageBox.TYPE_INFO, timeout=2, id='GBAspectRatioSwitch')
def changeMode(self): self.videomodes_enabled = [] if config.sifteam.switch_4_3_letterbox.value == True: self.videomodes_enabled.append("4_3_letterbox") if config.sifteam.switch_4_3_panscan.value == True: self.videomodes_enabled.append("4_3_panscan") if config.sifteam.switch_16_9.value == True: self.videomodes_enabled.append("16_9") if config.sifteam.switch_16_9_always.value == True: self.videomodes_enabled.append("16_9_always") if config.sifteam.switch_16_10_letterbox.value == True: self.videomodes_enabled.append("16_10_letterbox") if config.sifteam.switch_16_10_panscan.value == True: self.videomodes_enabled.append("16_10_panscan") if config.sifteam.switch_16_9_letterbox.value == True: self.videomodes_enabled.append("16_9_letterbox") if len(self.videomodes_enabled) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() if aspectnum >= len(self.videomodes): aspectnum = 0 currentmode = self.videomodes[aspectnum] aspectnum = 0 for i in range(0, len(self.videomodes_enabled)): if self.videomodes_enabled[i] == currentmode: aspectnum = i break aspectnum += 1 if aspectnum >= len(self.videomodes_enabled): aspectnum = 0 newmode = self.videomodes_enabled[aspectnum] aspectnum = 0 for i in range(0, len(self.videomodes)): if self.videomodes[i] == newmode: aspectnum = i break iAVSwitch.setAspectRatio(aspectnum) config.av.aspectratio.setValue(self.videomodes[aspectnum]) self.session.open(VideoSelectionNotify, self.videodescs[aspectnum])
def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.AspectRatioSwitch.showmsg.value: Notifications.AddPopup(text=_("Aspect ratio switched from:\n %s\nto:\n %s") % (ASPECTMSG[ASPECT[aspectnum]], ASPECTMSG[ASPECT[newaspectnum]]), type=MessageBox.TYPE_INFO, timeout=5, id='AspectRatioSwitch') print pluginPrintname, "Aspect ratio switched from %d - %s to %d - %s" % (aspectnum, ASPECT[aspectnum], newaspectnum, ASPECT[newaspectnum])