ocarina/ocarina/callbacks.py
Bryan Schumaker 3d1b8773d5 ocarina: Added album art
I put it on the now playing page for now.  Eventually I'll put it in
other places, too.
2011-05-01 12:19:49 -04:00

38 lines
706 B
Python

# Bryan Schumaker (4 / 20 / 2011)
import libsaria
import queue
from ocarina import body
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)
def on_stop(*args):
footer.on_pause()
invite("POSTSTOP", on_stop)
def on_load(*args):
footer.on_load()
queue.refresh()
body.cur_page_goto()
invite("POSTLOAD", on_load)
def on_like(*args):
footer.on_like()
invite("POSTSETLIKE", on_like)
def on_getart(path, id):
cur_id = libsaria.sources.get_attrs("id")
if id != cur_id:
path = "images/ocarina.png"
footer.set_art(path)
invite("POSTGETART", on_getart)