ocarina/ocarina/body/footer/detailed.py
Bryan Schumaker 8ea0036df0 Ocarina: Added now playing page to detailed view
This is the first of (probably) multiple notebook pages that will be
added.  It still needs to show more information, but this is a start.
2011-05-01 12:15:12 -04:00

41 lines
931 B
Python

# 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", )
def on_load():
title, artist, album = libsaria.sources.get_attrs(*load_attrs)
nowplaying.on_load(title, artist, album)