Commit 05c276b0 authored by Rafaël Carré's avatar Rafaël Carré

Fixes input position display

parent 79aedbd5
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.0.2 on Tue Nov 21 15:28:41 2006 by fun@zod--> <!--Generated with glade3 3.0.2 on Tue Nov 21 16:05:19 2006 by fun@zod-->
<glade-interface> <glade-interface>
<widget class="GtkWindow" id="window1"> <widget class="GtkWindow" id="window1">
<property name="resizable">False</property> <property name="resizable">False</property>
...@@ -141,14 +141,18 @@ ...@@ -141,14 +141,18 @@
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkHScale" id="time_s"> <widget class="GtkHScale" id="time_s">
<property name="width_request">107</property> <property name="width_request">183</property>
<property name="height_request">20</property> <property name="height_request">20</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="adjustment">0 0 100 1 10 10</property> <property name="adjustment">0 0 1000 10 100 0</property>
<property name="digits">-1</property> <property name="digits">-1</property>
<property name="draw_value">False</property> <property name="draw_value">False</property>
<property name="value_pos">GTK_POS_RIGHT</property> <property name="value_pos">GTK_POS_RIGHT</property>
</widget> </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkSpinButton" id="vol"> <widget class="GtkSpinButton" id="vol">
...@@ -164,10 +168,15 @@ ...@@ -164,10 +168,15 @@
</widget> </widget>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox4"> <widget class="GtkHBox" id="hbox4">
......
...@@ -30,6 +30,7 @@ import os ...@@ -30,6 +30,7 @@ import os
global position global position
global timer global timer
global playing
def itemchange_handler(item): def itemchange_handler(item):
l_item.set_text(item) l_item.set_text(item)
...@@ -52,15 +53,15 @@ def AddMRL(widget): ...@@ -52,15 +53,15 @@ def AddMRL(widget):
interface.AddMRL("directory://" + mrl, True) interface.AddMRL("directory://" + mrl, True)
def Next(widget): def Next(widget):
interface.Next() interface.Next(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0) update(0)
def Prev(widget): def Prev(widget):
interface.Prev() interface.Prev(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0) update(0)
def Stop(widget): def Stop(widget):
interface.Stop() interface.Stop(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0) update(0)
def update(widget): def update(widget):
...@@ -69,17 +70,18 @@ def update(widget): ...@@ -69,17 +70,18 @@ def update(widget):
GetPlayStatus(0) GetPlayStatus(0)
def GetPlayStatus(widget): def GetPlayStatus(widget):
global timer global playing
status = str(interface.GetPlayStatus()) status = str(interface.GetPlayStatus())
if status == "playing": if status == "playing":
img_bt_toggle.set_from_stock("gtk-media-pause", gtk.ICON_SIZE_SMALL_TOOLBAR) img_bt_toggle.set_from_stock("gtk-media-pause", gtk.ICON_SIZE_SMALL_TOOLBAR)
timer = gobject.timeout_add( 2000, timeset) gobject.timeout_add( 2000, timeset)
playing = True
else: else:
img_bt_toggle.set_from_stock("gtk-media-play", gtk.ICON_SIZE_SMALL_TOOLBAR) img_bt_toggle.set_from_stock("gtk-media-play", gtk.ICON_SIZE_SMALL_TOOLBAR)
gobject.timeout_remove(timer) playing = False
def Quit(widget): def Quit(widget):
interface.Quit() interface.Quit(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
l_item.set_text("") l_item.set_text("")
def TogglePause(widget): def TogglePause(widget):
...@@ -90,14 +92,15 @@ def TogglePause(widget): ...@@ -90,14 +92,15 @@ def TogglePause(widget):
update(0) update(0)
def volchange(widget, data): def volchange(widget, data):
interface.VolumeSet(vol.get_value_as_int(), reply_handler=(lambda: None), error_handler=(lambda: None)) interface.VolumeSet(vol.get_value_as_int(), reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
def timechange(widget, x=None, y=None): def timechange(widget, x=None, y=None):
interface.PositionSet(time_s.get_value() * 10, reply_handler=(lambda: None), error_handler=(lambda: None)) interface.PositionSet(time_s.get_value(), reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
def timeset(): def timeset():
time_s.set_value(interface.PositionGet() / 10) global playing
return True time_s.set_value(interface.PositionGet())
return playing
def expander(widget): def expander(widget):
if exp.get_expanded() == False: if exp.get_expanded() == False:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment