diff --git a/libsaria/__init__.py b/libsaria/__init__.py index a7ad87cc..d9aa7d6f 100644 --- a/libsaria/__init__.py +++ b/libsaria/__init__.py @@ -19,9 +19,10 @@ from path.cache import Cache prefs = None cache = Cache() -plugin = None -audio = None -lastfm = None +plugin = None +audio = None +lastfm = None +controls = None init_pref = None @@ -43,10 +44,13 @@ def init(): def startup(): global plugin + global controls import plugin + import controls event.start("PRESTART") audio.init() + controls.init() plugin.load_all() event.start("POSTSTART") diff --git a/libsaria/controls.py b/libsaria/controls.py new file mode 100644 index 00000000..d0cede90 --- /dev/null +++ b/libsaria/controls.py @@ -0,0 +1,15 @@ +# Bryan Schumaker (11/23/2010) + +audio = None +call = None + +def init(): + global call + global audio + + import libsaria + call = libsaria.event.call + from audio import audio + +def play(): + return call("PLAY", audio.play) diff --git a/ocarina/components/button.py b/ocarina/components/button.py index 1ab8daa0..26bf2a77 100644 --- a/ocarina/components/button.py +++ b/ocarina/components/button.py @@ -5,6 +5,7 @@ import image LS = ocarina.libsaria gtk = ocarina.gtk prefs = LS.prefs +invite = LS.event.invite class Button(gtk.Button): @@ -37,7 +38,7 @@ class PlayButton(Button): LS.event.invite("POSTPAUSE", self.show) LS.event.invite("POSTSTOP", self.show) def clicked(self, button): - LS.audio.play() + LS.controls.play() def hide(self, playing): if playing == True: Button.hide(self)