ocarina/ocarina/body/footer/detailed.py

42 lines
1005 B
Python
Raw Normal View History

# Bryan Schumaker (4 / 21 / 2011)
import gtk
from ocarina.body import button
import libsaria
import nowplaying
detailed = gtk.Notebook()
hide = detailed.hide
show = detailed.show
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()
load_attrs = ("title", "artist", "album", "year", "lenstr", "count")
def on_load():
title, artist, album, year, lenstr, count = \
libsaria.sources.get_attrs(*load_attrs)
nowplaying.on_load(title, artist, album, year, lenstr, count)