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:
Bryan Schumaker 2011-05-15 10:43:57 -04:00
parent 5a781479cd
commit b56fb6768f
1 changed files with 6 additions and 1 deletions

View File

@ -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: