libsaria: Track current file in audio
I use this for determining the pipeline state. get_property() wasn't working as well as I hoped it would.
This commit is contained in:
parent
5a781479cd
commit
b56fb6768f
|
@ -10,16 +10,21 @@ time = gst.Format(gst.FORMAT_TIME)
|
|||
bus = player.get_bus()
|
||||
bus.add_signal_watch()
|
||||
|
||||
cur_file = None
|
||||
|
||||
def reset():
|
||||
global cur_file
|
||||
cur_file = None
|
||||
player.set_state(gst.STATE_NULL)
|
||||
|
||||
def load_file(type, file):
|
||||
global cur_file
|
||||
reset()
|
||||
cur_file = file
|
||||
player.set_property("uri", "%s://%s" % (type, file))
|
||||
|
||||
def has_file():
|
||||
return player.get_property("uri") != None
|
||||
return cur_file != None
|
||||
|
||||
def change_state(state):
|
||||
if has_file() == True:
|
||||
|
|
Loading…
Reference in New Issue