diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-17 23:34:41 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-17 23:34:41 +0100 |
| commit | 5aa89f34249397330995cc0ab1e080c1f567e174 (patch) | |
| tree | 18f02352d51552b714d70da9bd65053b32029d5e /lib/python | |
| parent | 9ca172f45cc02fe5cb693e7d35aade7d2233d448 (diff) | |
| download | enigma2-5aa89f34249397330995cc0ab1e080c1f567e174.tar.gz enigma2-5aa89f34249397330995cc0ab1e080c1f567e174.zip | |
get rid of some floating point values
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/AVSwitch.py | 14 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/PicturePlayer/plugin.py | 14 | ||||
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py | 8 |
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py index 19aca24d..00350cbb 100644 --- a/lib/python/Components/AVSwitch.py +++ b/lib/python/Components/AVSwitch.py @@ -30,26 +30,24 @@ class AVSwitch: def getOutputAspect(self): if valstr in ("4_3_letterbox", "4_3_panscan"): # 4:3 - return 1.333333333 + return (4,3) elif valstr == "16_9": # auto ... 4:3 or 16:9 try: aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read() if aspect_str == "1": # 4:3 - return 1.333333333 + return (4,3) except IOError: pass - return 1.777777778 elif valstr in ("16_9_always", "16_9_letterbox"): # 16:9 - return 1.777777778 + pass elif valstr in ("16_10_letterbox", "16_10_panscan"): # 16:10 - return 1.6 - print "unknown output aspect!" - return 1.0000 + return (16,10) + return (16,9) def getFramebufferScale(self): aspect = self.getOutputAspect() fb_size = getDesktop(0).size() - return aspect / ((1.0 * fb_size.width()) / fb_size.height()) + return (aspect[0] * fb_size.height(), aspect[1] * fb_size.width()) def getAspectRatioSetting(self): valstr = config.av.aspectratio.value diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py index 7d62d2be..0cdab563 100644 --- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py +++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py @@ -15,7 +15,7 @@ from Components.ConfigList import ConfigList from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigEnableDisable, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry -def getAspectforPic(): +def getScale(): return AVSwitch().getFramebufferScale() config.pic = ConfigSubsection() @@ -119,8 +119,9 @@ class picshow(Screen): self.session.openWithCallback(self.callbackView, Pic_Full_View, self.filelist.getFileList(), self.filelist.getSelectionIndex(), self.filelist.getCurrentDirectory()) def setConf(self): + sc = getScale() #0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB) - self.picload.setPara([self["thn"].instance.size().width(), self["thn"].instance.size().height(), getAspectforPic(), config.pic.cache.value, int(config.pic.resize.value), "#00000000"]) + self.picload.setPara((self["thn"].instance.size().width(), self["thn"].instance.size().height(), sc[0], sc[1], config.pic.cache.value, int(config.pic.resize.value), "#00000000")) def callbackView(self, val=0): if val > 0: @@ -311,10 +312,10 @@ class Pic_Thumb(Screen): self.ThumbTimer.callback.append(self.showPic) def setPicloadConf(self): - self.picload.setPara([self["thumb0"].instance.size().width(), self["thumb0"].instance.size().height(), getAspectforPic(), config.pic.cache.value, int(config.pic.resize.value), self.color]) + sc = getScale() + self.picload.setPara([self["thumb0"].instance.size().width(), self["thumb0"].instance.size().height(), sc[0], sc[1], config.pic.cache.value, int(config.pic.resize.value), self.color]) self.paintFrame() - - + def paintFrame(self): #print "index=" + str(self.index) if self.maxentry < self.index or self.index < 0: @@ -468,7 +469,8 @@ class Pic_Full_View(Screen): self.onLayoutFinish.append(self.setPicloadConf) def setPicloadConf(self): - self.picload.setPara([self["pic"].instance.size().width(), self["pic"].instance.size().height(), getAspectforPic(), 0, int(config.pic.resize.value), self.bgcolor]) + sc = getScale() + self.picload.setPara([self["pic"].instance.size().width(), self["pic"].instance.size().height(), sc[0], sc[1], 0, int(config.pic.resize.value), self.bgcolor]) self["play_icon"].hide() if config.pic.infoline.value == False: diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index 5e38f3e6..02fdf9a5 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -60,7 +60,7 @@ class VideoHardware: widescreen_modes = set(["720p", "1080i"]) def getOutputAspect(self): - ret = 1.777777778 # 16:9 + ret = (16,9) port = config.av.videoport.value if port not in config.av.videomode: print "current port not available in getOutputAspect!!! force 16:9" @@ -75,16 +75,16 @@ class VideoHardware: else: aspect = {"16_9": "16:9", "16_10": "16:10"}[config.av.aspect.value] if aspect == "16:10": - ret = 1.6 + ret = (16,10) elif is_auto: try: aspect_str = open("/proc/stb/vmpeg/0/aspect", "r").read() if aspect_str == "1": # 4:3 - ret = 1.333333333 + ret = (4,3) except IOError: pass else: # 4:3 - ret = 1.333333333 + ret = (4,3) return ret def __init__(self): |
