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
|
prefs = None
|
||||||
cache = Cache()
|
cache = Cache()
|
||||||
|
|
||||||
plugin = None
|
plugin = None
|
||||||
audio = None
|
audio = None
|
||||||
lastfm = None
|
lastfm = None
|
||||||
|
controls = None
|
||||||
|
|
||||||
init_pref = None
|
init_pref = None
|
||||||
|
|
||||||
|
@ -43,10 +44,13 @@ def init():
|
||||||
|
|
||||||
def startup():
|
def startup():
|
||||||
global plugin
|
global plugin
|
||||||
|
global controls
|
||||||
import plugin
|
import plugin
|
||||||
|
import controls
|
||||||
|
|
||||||
event.start("PRESTART")
|
event.start("PRESTART")
|
||||||
audio.init()
|
audio.init()
|
||||||
|
controls.init()
|
||||||
plugin.load_all()
|
plugin.load_all()
|
||||||
event.start("POSTSTART")
|
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
|
LS = ocarina.libsaria
|
||||||
gtk = ocarina.gtk
|
gtk = ocarina.gtk
|
||||||
prefs = LS.prefs
|
prefs = LS.prefs
|
||||||
|
invite = LS.event.invite
|
||||||
|
|
||||||
|
|
||||||
class Button(gtk.Button):
|
class Button(gtk.Button):
|
||||||
|
@ -37,7 +38,7 @@ class PlayButton(Button):
|
||||||
LS.event.invite("POSTPAUSE", self.show)
|
LS.event.invite("POSTPAUSE", self.show)
|
||||||
LS.event.invite("POSTSTOP", self.show)
|
LS.event.invite("POSTSTOP", self.show)
|
||||||
def clicked(self, button):
|
def clicked(self, button):
|
||||||
LS.audio.play()
|
LS.controls.play()
|
||||||
def hide(self, playing):
|
def hide(self, playing):
|
||||||
if playing == True:
|
if playing == True:
|
||||||
Button.hide(self)
|
Button.hide(self)
|
||||||
|
|
Loading…
Reference in New Issue