c3dbd8167d
This reflects my recent libsaria change. I'm keeping around my old library code for now. The new library will gradually be introduced through several patches ending with the removal of the old library.
48 lines
970 B
Python
48 lines
970 B
Python
# Bryan Schumaker (4 / 20 / 2011)
|
|
|
|
import libsaria
|
|
import queue
|
|
from ocarina import body
|
|
from ocarina.body import footer
|
|
from libsaria import callbacks
|
|
import playlist
|
|
import oldlibrary
|
|
|
|
def on_play():
|
|
footer.on_play()
|
|
callbacks.on_play = on_play
|
|
|
|
def on_pause():
|
|
footer.on_pause()
|
|
callbacks.on_pause = on_pause
|
|
|
|
def on_load(file):
|
|
footer.on_load()
|
|
queue.refresh()
|
|
body.cur_page_goto()
|
|
libsaria.path.lastfm.get_artwork(file)
|
|
callbacks.on_load = on_load
|
|
|
|
def on_like(like):
|
|
footer.on_like(like)
|
|
callbacks.on_like = on_like
|
|
|
|
def on_get_art(path, id):
|
|
cur_id = libsaria.sources.get_attrs("id")
|
|
if id != cur_id:
|
|
path = "images/ocarina.png"
|
|
footer.set_art(path)
|
|
callbacks.on_get_art = on_get_art
|
|
|
|
def on_load_playlist():
|
|
playlist.refresh()
|
|
callbacks.on_load_playlist = on_load_playlist
|
|
|
|
def on_load_library():
|
|
oldlibrary.refresh()
|
|
callbacks.on_new_source = on_load_library
|
|
|
|
def on_queue_changed():
|
|
queue.refresh()
|
|
callbacks.on_queue_changed = on_queue_changed
|