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"?>
<!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>
<widget class="GtkWindow" id="window1">
<property name="resizable">False</property>
......@@ -141,14 +141,18 @@
<property name="visible">True</property>
<child>
<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="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="draw_value">False</property>
<property name="value_pos">GTK_POS_RIGHT</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="vol">
......@@ -164,10 +168,15 @@
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox4">
......
......@@ -30,6 +30,7 @@ import os
global position
global timer
global playing
def itemchange_handler(item):
l_item.set_text(item)
......@@ -52,15 +53,15 @@ def AddMRL(widget):
interface.AddMRL("directory://" + mrl, True)
def Next(widget):
interface.Next()
interface.Next(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0)
def Prev(widget):
interface.Prev()
interface.Prev(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0)
def Stop(widget):
interface.Stop()
interface.Stop(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
update(0)
def update(widget):
......@@ -69,17 +70,18 @@ def update(widget):
GetPlayStatus(0)
def GetPlayStatus(widget):
global timer
global playing
status = str(interface.GetPlayStatus())
if status == "playing":
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:
img_bt_toggle.set_from_stock("gtk-media-play", gtk.ICON_SIZE_SMALL_TOOLBAR)
gobject.timeout_remove(timer)
playing = False
def Quit(widget):
interface.Quit()
interface.Quit(reply_handler=(lambda *args: None), error_handler=(lambda *args: None))
l_item.set_text("")
def TogglePause(widget):
......@@ -90,14 +92,15 @@ def TogglePause(widget):
update(0)
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):
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():
time_s.set_value(interface.PositionGet() / 10)
return True
global playing
time_s.set_value(interface.PositionGet())
return playing
def expander(widget):
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