Add libsaria/controls.py

I will eventually be moving things over to here.  The general rule: if
it has to do with buttons on the gui, then it should probably be
considered a control.
This commit is contained in:
Bryan Schumaker 2010-11-23 20:37:24 -05:00
parent c97aa9f921
commit 1d609c5606
3 changed files with 24 additions and 4 deletions

View File

@ -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")

15
libsaria/controls.py Normal file
View File

@ -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)

View File

@ -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)