124 lines
2.6 KiB
Python
124 lines
2.6 KiB
Python
# Bryan Schumaker (11/25/2010)
|
|
|
|
import gtk
|
|
import gobject
|
|
|
|
import tiny
|
|
import detailed
|
|
import libsaria
|
|
from libsaria import audio
|
|
|
|
footer = gtk.VBox()
|
|
hsep = gtk.HSeparator()
|
|
hsep.show()
|
|
|
|
footer.pack_start(hsep, True, True)
|
|
footer.pack_start(tiny.tiny, True, True)
|
|
footer.pack_start(detailed.detailed, True, True)
|
|
footer.show()
|
|
|
|
def update_pos():
|
|
time = audio.get_time()
|
|
tiny.update_pos(time)
|
|
detailed.update_pos(time)
|
|
return True
|
|
gobject.timeout_add(500, update_pos)
|
|
|
|
def show_more():
|
|
tiny.hide()
|
|
detailed.show()
|
|
libsaria.prefs.set_pref("ocarina.footer.up", True)
|
|
|
|
def show_less():
|
|
tiny.show()
|
|
detailed.hide()
|
|
libsaria.prefs.set_pref("ocarina.footer.up", False)
|
|
|
|
up = libsaria.init_pref("ocarina.footer.up", False)
|
|
if up == True:
|
|
show_more()
|
|
else:
|
|
show_less()
|
|
|
|
def on_play():
|
|
tiny.on_play()
|
|
detailed.on_play()
|
|
|
|
def on_pause():
|
|
tiny.on_pause()
|
|
detailed.on_pause()
|
|
|
|
def on_load():
|
|
tiny.on_load()
|
|
detailed.on_load()
|
|
|
|
def on_like():
|
|
detailed.nowplaying.on_like()
|
|
|
|
#def add_page(title, widget):
|
|
#label = gtk.Label(title)
|
|
#pages[title] = widget
|
|
#tabs.append_page(widget, label)
|
|
|
|
#def remove_page(title):
|
|
#page = pages.get(title, None)
|
|
#if page == None:
|
|
#return
|
|
#n = tabs.page_num(page)
|
|
#tabs.remove_page(n)
|
|
#del pages[title]
|
|
|
|
#def make_bar():
|
|
#title.set_text(ocarina.__vers__)
|
|
#title.set_ellipsize(pango.ELLIPSIZE_END)
|
|
#title.show()
|
|
|
|
#bar_add(image.AlbumArt(24))
|
|
#bar_add(title, True, True)
|
|
#bar_add(label.TimeLabel())
|
|
#bar_add(label.LengthLabel2())
|
|
#bar_add(button.RewindButton())
|
|
#bar_add(button.ForwardButton())
|
|
#bar_add(button.PlayButton())
|
|
#bar_add(button.PauseButton())
|
|
#bar_add(button.StopButton())
|
|
#bar_add(button.NextButton())
|
|
#bar_add(button.UpButton(up_button))
|
|
|
|
#bar.show()
|
|
#footer.pack_start(bar)
|
|
|
|
|
|
#def make_now_playing_page():
|
|
#page = gtk.HBox(False, 5)
|
|
#page.pack_start(image.AlbumArt(), False, False)
|
|
|
|
#tags = gtk.ScrolledWindow()
|
|
#tags.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
|
#view = gtk.Viewport()
|
|
#view.set_shadow_type(gtk.SHADOW_NONE)
|
|
#tag_box = gtk.VBox(True)
|
|
#tag_box.pack_start(label.TitleLabel())
|
|
#tag_box.pack_start(label.ArtistLabel())
|
|
#tag_box.pack_start(label.AlbumLabel())
|
|
#view.add(tag_box)
|
|
#tags.add(view)
|
|
#page.pack_start(tags)
|
|
|
|
#attrs = gtk.HBox(False, 5)
|
|
#tags2 = gtk.VBox()
|
|
#tags2.pack_start(label.YearLabel())
|
|
#tags2.pack_start(label.LengthLabel())
|
|
#tags2.pack_start(label.CountLabel())
|
|
#attrs.pack_start(tags2)
|
|
|
|
#buttons = gtk.HBox()
|
|
#buttons.pack_start(button.LikeButton(), False, False)
|
|
#buttons.pack_start(button.DislikeButton(), False, False)
|
|
#attrs.pack_start(buttons, False)
|
|
#page.pack_start(attrs)
|
|
|
|
#page.show_all()
|
|
#add_page("Now Playing", page)
|
|
|