# 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 library

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():
	library.refresh()
callbacks.on_new_source = on_load_library
