libsaria: Fix seeking through gui buttons
This commit is contained in:
parent
e59243e51b
commit
3cb39f3fcd
|
@ -6,6 +6,7 @@ import threading
|
|||
import pipeline
|
||||
from libsaria import callbacks
|
||||
from libsaria import prefs
|
||||
from libsaria import controls
|
||||
|
||||
timedelta = datetime.timedelta
|
||||
audio_lock = threading.Lock()
|
||||
|
@ -96,7 +97,7 @@ def get_progress():
|
|||
return position() / dur
|
||||
return 0.0
|
||||
|
||||
#def bus_message(bus, message):
|
||||
# if message.type == gst.MESSAGE_EOS:
|
||||
# source_proc.next()
|
||||
#pipeline.bus.connect("message", bus_message)
|
||||
def bus_message(bus, message):
|
||||
if message.type == gst.MESSAGE_EOS:
|
||||
controls.catch_eos()
|
||||
pipeline.bus.connect("message", bus_message)
|
||||
|
|
|
@ -46,8 +46,9 @@ def duration():
|
|||
return float(dur)
|
||||
|
||||
def seek_to(new_spot):
|
||||
if new_spot >= 0:
|
||||
player.seek_simple(time, gst.SEEK_FLAG_FLUSH, new_spot)
|
||||
if new_spot < 0:
|
||||
new_spot = 0
|
||||
player.seek_simple(time, gst.SEEK_FLAG_FLUSH, new_spot)
|
||||
|
||||
def seek(amount):
|
||||
pos = position()
|
||||
|
|
|
@ -9,8 +9,8 @@ library = None
|
|||
playlist = None
|
||||
queue = None
|
||||
|
||||
call = None
|
||||
invite = None
|
||||
#call = None
|
||||
#invite = None
|
||||
expand = None
|
||||
exists = None
|
||||
|
||||
|
@ -22,8 +22,8 @@ def init():
|
|||
import libsaria
|
||||
|
||||
def init2():
|
||||
global call
|
||||
global invite
|
||||
#global call
|
||||
#global invite
|
||||
global sources
|
||||
global library
|
||||
global playlist
|
||||
|
@ -57,10 +57,10 @@ def pick_next():
|
|||
|
||||
def catch_eos(*args):
|
||||
library.inc_count()
|
||||
return call("NEXT", pick_next)
|
||||
pick_next()
|
||||
|
||||
def next():
|
||||
return call("NEXT", pick_next)
|
||||
pick_next()
|
||||
|
||||
def play():
|
||||
audio.play()
|
||||
|
@ -85,10 +85,10 @@ def stop():
|
|||
audio.stop()
|
||||
|
||||
def seek_forward():
|
||||
libsaria.audio.seek_sec(5)
|
||||
libsaria.audio.seek(5)
|
||||
|
||||
def seek_backward():
|
||||
libsaria.audio.seek_sec(-5)
|
||||
libsaria.audio.seek(-5)
|
||||
|
||||
def set_volume(prcnt):
|
||||
audio.set_volume(prcnt)
|
||||
|
|
Loading…
Reference in New Issue