Changeset 1613

Show
Ignore:
Timestamp:
2005-11-08 13:12:09 (3 years ago)
Author:
jkivlighn
Message:

Fix seeking before having first played a file. This works just by setting the state to paused (rather than null/ready) before trying to seek.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • annoamp/trunk/annoamp.py

    r1611 r1613  
    7272    if treemodel.iter_parent(treemodel.get_iter(path)) != None: #seek for all items unless we got the file item 
    7373        player.seek(treemodel.get_value(treemodel.get_iter(path), 1)) 
     74     
     75    player.play() 
    7476     
    7577def slider_seek_play(widget, event): 
  • annoamp/trunk/anxplayer.py

    r1612 r1613  
    128128    #Loads the given file and loads the clips into the model playlist[0], with the parent iter playlist[1] 
    129129    def switch_source(self,filename,child): 
    130         #self.bin.set_state(gst.STATE_PAUSED) 
    131         #event = gst.event_new_seek(1.0, gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE, gst.SEEK_TYPE_SET, gst.SECOND*0, gst.SEEK_TYPE_NONE, 0); 
    132         #print "%s" % event 
    133         #result = self.bin.send_event(event) 
    134130        print self.bin.set_state(gst.STATE_READY) 
    135131        print self.bin.set_state(gst.STATE_NULL) 
    136132        print self.bin.get_state() #block until the state is really changed 
    137         #print "filechange: " + str(self.filesrc.set_property('location', filename)) 
    138         #print "filesrc: " + str(self.filesrc.get_property('location')) 
     133         
    139134        self.playbin.props.uri = "file://" + filename 
    140135         
    141         #self.play() 
     136        self.pause() #we'll be in a state where we can seek, if necessary 
     137 
    142138        self.pos = -1 
    143139        self.current = child