diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-01-19 16:27:12 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-01-21 11:51:11 (GMT) |
commit | 1b5f8bdd6ccb09b7f6f2914cf9044d294e16be4a (patch) | |
tree | 5024ee174b066817da646ef3816d47e9ecf03bd8 /Sound.py | |
parent | 22f0c6ef272e7400a57f44e75a562eded95337af (diff) |
...
Diffstat (limited to 'Sound.py')
-rw-r--r-- | Sound.py | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -18,6 +18,7 @@ import gst from gettext import gettext as _ import Theme +from Utils import * from sugar.activity.activity import get_bundle_path sound_icon = Theme.pixmap('icons/sound_icon.png') @@ -47,31 +48,18 @@ THEMES = ( 'pixbuf': sound_icon, 'sound' : None } ) -class FileInstanceVariable: - def __init__(self, value = None): - self.value = value - - def get(self): - return self.value - - def set(self, value): - self.value = value - - def __getitem__(self, key): - return self.value[key] - theme = FileInstanceVariable(THEMES[0]) playing = FileInstanceVariable(False) def play(): playing.set(True) - switch(theme.get()) + change(theme.get()) def stop(): playing.set(False) player.set_state(gst.STATE_NULL) -def switch(a_theme): +def change(a_theme): if not a_theme: return theme.set(a_theme) |