2011-04-21 23:05:28 -04:00
|
|
|
# Bryan Schumaker (4 / 21 / 2011)
|
|
|
|
|
|
|
|
import gtk
|
2011-04-21 23:23:51 -04:00
|
|
|
from ocarina.body import button
|
|
|
|
import libsaria
|
|
|
|
import nowplaying
|
2011-04-21 23:05:28 -04:00
|
|
|
|
|
|
|
detailed = gtk.Notebook()
|
|
|
|
hide = detailed.hide
|
|
|
|
show = detailed.show
|
2011-04-21 23:23:51 -04:00
|
|
|
|
|
|
|
action = gtk.HBox()
|
|
|
|
|
|
|
|
def add_button(name, button_func, show = True):
|
|
|
|
b = button_func(show)
|
|
|
|
globals()[name] = b
|
|
|
|
action.pack_start(b, False, False)
|
|
|
|
|
|
|
|
add_button( "PLAY", button.play_button)
|
|
|
|
add_button( "PAUSE", button.pause_button, False)
|
|
|
|
add_button( "STOP", button.stop_button)
|
|
|
|
add_button( "NEXT", button.next_button)
|
|
|
|
add_button( "DOWN", button.down_button)
|
|
|
|
action.show()
|
|
|
|
|
|
|
|
detailed.set_action_widget(action, gtk.PACK_END)
|
|
|
|
detailed.append_page(nowplaying.page, nowplaying.label)
|
|
|
|
|
|
|
|
def on_play():
|
|
|
|
PLAY.hide()
|
|
|
|
PAUSE.show()
|
|
|
|
|
|
|
|
def on_pause():
|
|
|
|
PLAY.show()
|
|
|
|
PAUSE.hide()
|
|
|
|
|
2011-04-22 07:59:36 -04:00
|
|
|
load_attrs = ("title", "artist", "album", "year", "lenstr", "count")
|
2011-04-21 23:23:51 -04:00
|
|
|
def on_load():
|
2011-04-22 07:59:36 -04:00
|
|
|
title, artist, album, year, lenstr, count = \
|
|
|
|
libsaria.sources.get_attrs(*load_attrs)
|
|
|
|
nowplaying.on_load(title, artist, album, year, lenstr, count)
|