aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-08-05 11:06:49 +0200
committerghost <andreas.monzner@multimedia-labs.de>2010-08-05 11:06:49 +0200
commitba702c42bfa54324396f2ef9c61d0bbe4a8a135b (patch)
treebaca38947292ee8d8109531b0be788a00ad1db37 /lib/python/Components
parent6be1855d457d28e25917a29f710f2401519d7160 (diff)
downloadenigma2-ba702c42bfa54324396f2ef9c61d0bbe4a8a135b.tar.gz
enigma2-ba702c42bfa54324396f2ef9c61d0bbe4a8a135b.zip
lib/python/Components/VolumeControl.py: make the VolumeControl instance global accessible and add a singleton check
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/VolumeControl.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/python/Components/VolumeControl.py b/lib/python/Components/VolumeControl.py
index 19fb90d7..eef74d0e 100644
--- a/lib/python/Components/VolumeControl.py
+++ b/lib/python/Components/VolumeControl.py
@@ -5,6 +5,8 @@ from Screens.Mute import Mute
from GlobalActions import globalActionMap
from config import config, ConfigSubsection, ConfigInteger
+instance = None
+
profile("VolumeControl")
#TODO .. move this to a own .py file
class VolumeControl:
@@ -12,10 +14,14 @@ class VolumeControl:
a corresponding dialog"""
def __init__(self, session):
global globalActionMap
+ global instance
globalActionMap.actions["volumeUp"]=self.volUp
globalActionMap.actions["volumeDown"]=self.volDown
globalActionMap.actions["volumeMute"]=self.volMute
+ assert not instance, "only one VolumeControl instance is allowed!"
+ instance = self
+
config.audio = ConfigSubsection()
config.audio.volume = ConfigInteger(default = 100, limits = (0, 100))