ocarina: Added callback methods
I eventually want to remove the event system from libsaria. My first step in doing this is to move usage of the event system in Ocarina to one place.
This commit is contained in:
parent
a8421b8226
commit
d72d16f39d
|
@ -23,6 +23,7 @@ import window
|
|||
import playlist
|
||||
import queue
|
||||
import library
|
||||
import callbacks
|
||||
|
||||
libsaria.startup()
|
||||
print "Startup took:", uptime()
|
||||
|
|
|
@ -11,6 +11,11 @@ footer.pack_start(hsep, True, True)
|
|||
footer.pack_start(tiny.tiny, True, True)
|
||||
footer.show()
|
||||
|
||||
def on_play():
|
||||
tiny.on_play()
|
||||
|
||||
def on_pause():
|
||||
tiny.on_pause()
|
||||
|
||||
#import gtk
|
||||
#import pango
|
||||
|
|
|
@ -19,7 +19,15 @@ tiny.pack_start(now_playing, True, True)
|
|||
add_button( "REWIND", button.rewind_button)
|
||||
add_button("FORWARD", button.forward_button)
|
||||
add_button( "PLAY", button.play_button)
|
||||
add_button( "PAUSE", button.pause_button)
|
||||
add_button( "PAUSE", button.pause_button, False)
|
||||
add_button( "STOP", button.stop_button)
|
||||
add_button( "NEXT", button.next_button)
|
||||
tiny.show()
|
||||
|
||||
def on_play():
|
||||
PLAY.hide()
|
||||
PAUSE.show()
|
||||
|
||||
def on_pause():
|
||||
PLAY.show()
|
||||
PAUSE.hide()
|
||||
|
|
14
ocarina/callbacks.py
Normal file
14
ocarina/callbacks.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Bryan Schumaker (4 / 20 / 2011)
|
||||
|
||||
import libsaria
|
||||
from ocarina.body import footer
|
||||
|
||||
invite = libsaria.event.invite
|
||||
|
||||
def on_play(*args):
|
||||
footer.on_play()
|
||||
invite("POSTPLAY", on_play)
|
||||
|
||||
def on_pause(*args):
|
||||
footer.on_pause()
|
||||
invite("POSTPAUSE", on_pause)
|
Loading…
Reference in New Issue
Block a user