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:
parent
c97aa9f921
commit
1d609c5606
|
@ -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")
|
||||
|
||||
|
|
|
@ -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)
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue