2010-11-25 14:18:45 -05:00
|
|
|
# Bryan Schumaker (11/25/2010)
|
|
|
|
|
2011-04-17 09:49:48 -04:00
|
|
|
import gtk
|
2011-04-20 20:34:14 -04:00
|
|
|
import gobject
|
|
|
|
|
2011-04-19 08:31:11 -04:00
|
|
|
import tiny
|
2011-04-21 23:05:28 -04:00
|
|
|
import detailed
|
2011-04-22 17:39:19 -04:00
|
|
|
import libsaria
|
2011-04-20 20:34:14 -04:00
|
|
|
from libsaria import audio
|
2011-04-24 09:16:03 -04:00
|
|
|
from ocarina import shortcuts
|
2011-04-19 08:31:11 -04:00
|
|
|
|
|
|
|
footer = gtk.VBox()
|
|
|
|
hsep = gtk.HSeparator()
|
|
|
|
hsep.show()
|
|
|
|
|
|
|
|
footer.pack_start(hsep, True, True)
|
|
|
|
footer.pack_start(tiny.tiny, True, True)
|
2011-04-21 23:05:28 -04:00
|
|
|
footer.pack_start(detailed.detailed, True, True)
|
2011-04-19 08:31:11 -04:00
|
|
|
footer.show()
|
|
|
|
|
2011-04-20 20:34:14 -04:00
|
|
|
def update_pos():
|
2011-04-30 12:06:48 -04:00
|
|
|
time = audio.get_progstr()
|
2011-04-20 20:34:14 -04:00
|
|
|
tiny.update_pos(time)
|
2011-04-22 22:30:19 -04:00
|
|
|
detailed.update_pos(time)
|
2011-04-20 20:34:14 -04:00
|
|
|
return True
|
|
|
|
gobject.timeout_add(500, update_pos)
|
|
|
|
|
2011-04-21 23:00:18 -04:00
|
|
|
def show_more():
|
|
|
|
tiny.hide()
|
2011-04-21 23:05:28 -04:00
|
|
|
detailed.show()
|
2011-04-30 10:51:14 -04:00
|
|
|
libsaria.prefs.set("ocarina.footer.up", True)
|
2011-04-21 23:00:18 -04:00
|
|
|
|
2011-04-21 23:23:51 -04:00
|
|
|
def show_less():
|
|
|
|
tiny.show()
|
|
|
|
detailed.hide()
|
2011-04-30 10:51:14 -04:00
|
|
|
libsaria.prefs.set("ocarina.footer.up", False)
|
2011-04-22 17:39:19 -04:00
|
|
|
|
2011-04-24 09:16:03 -04:00
|
|
|
def toggle_footer():
|
2011-04-30 10:51:14 -04:00
|
|
|
up = libsaria.prefs.get("ocarina.footer.up")
|
2011-04-24 09:16:03 -04:00
|
|
|
if up == True:
|
|
|
|
show_less()
|
|
|
|
else:
|
|
|
|
show_more()
|
|
|
|
shortcuts.register_shortcut("f", toggle_footer)
|
|
|
|
|
2011-04-30 10:51:14 -04:00
|
|
|
up = libsaria.prefs.init("ocarina.footer.up", False)
|
2011-04-22 17:39:19 -04:00
|
|
|
if up == True:
|
|
|
|
show_more()
|
|
|
|
else:
|
|
|
|
show_less()
|
2011-04-21 23:23:51 -04:00
|
|
|
|
2011-04-23 09:27:54 -04:00
|
|
|
def set_art(path):
|
2011-04-24 08:42:05 -04:00
|
|
|
tiny.set_art(path)
|
2011-04-23 09:27:54 -04:00
|
|
|
detailed.set_art(path)
|
|
|
|
|
2011-04-20 19:34:55 -04:00
|
|
|
def on_play():
|
|
|
|
tiny.on_play()
|
2011-04-21 23:23:51 -04:00
|
|
|
detailed.on_play()
|
2011-04-20 19:34:55 -04:00
|
|
|
|
|
|
|
def on_pause():
|
|
|
|
tiny.on_pause()
|
2011-04-21 23:23:51 -04:00
|
|
|
detailed.on_pause()
|
2011-04-19 08:31:11 -04:00
|
|
|
|
2011-06-17 20:03:13 -04:00
|
|
|
def on_load(attrs):
|
|
|
|
tiny.on_load(attrs)
|
|
|
|
detailed.on_load(attrs)
|
2011-04-20 20:34:14 -04:00
|
|
|
|
2011-04-30 13:05:22 -04:00
|
|
|
def on_like(like):
|
|
|
|
detailed.nowplaying.on_like(like)
|