Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey 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)
commit1b5f8bdd6ccb09b7f6f2914cf9044d294e16be4a (patch)
tree5024ee174b066817da646ef3816d47e9ecf03bd8
parent22f0c6ef272e7400a57f44e75a562eded95337af (diff)
...
-rw-r--r--Main.py2
-rw-r--r--Sound.py18
-rw-r--r--Utils.py26
-rw-r--r--icons/sound_icon.pngbin3227 -> 3046 bytes
4 files changed, 30 insertions, 16 deletions
diff --git a/Main.py b/Main.py
index 8332f66..b11be9c 100644
--- a/Main.py
+++ b/Main.py
@@ -150,7 +150,7 @@ class CartoonBuilder:
self.drawmain()
def _sound_cb(self, widget):
- Sound.switch(widget.props.value)
+ Sound.change(widget.props.value)
def oldplayframe(self):
self.mfdraw.fgimgpath = self.frameimgpaths[self.playframenum]
diff --git a/Sound.py b/Sound.py
index f6262e2..aec6e87 100644
--- a/Sound.py
+++ b/Sound.py
@@ -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)
diff --git a/Utils.py b/Utils.py
new file mode 100644
index 0000000..1e539c0
--- /dev/null
+++ b/Utils.py
@@ -0,0 +1,26 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+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]
diff --git a/icons/sound_icon.png b/icons/sound_icon.png
index e953394..9283e50 100644
--- a/icons/sound_icon.png
+++ b/icons/sound_icon.png
Binary files differ