Update of /cvsroot/freevo/freevo/src/video
In directory sc8-pr-cvs1:/tmp/cvs-serv2116/video
Modified Files:
mplayer.py
Log Message:
Added preliminary movie bookmarks (i.e. places to jump to on next play)
Currently only writing the bookmarks does anything; I'm going to have to
add a menu of bookmarks to the menu afterwards.
Note that the get_bookmarkfile thing should be replaced with something less
flaky than the path+filename of the movie, but this is good for a initial
go.
Index: mplayer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/video/mplayer.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** mplayer.py 17 Mar 2003 15:47:16 -0000 1.25
--- mplayer.py 17 Mar 2003 16:34:33 -0000 1.26
***************
*** 10,13 ****
--- 10,22 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.26 2003/03/17 16:34:33 outlyer
+ # Added preliminary movie bookmarks (i.e. places to jump to on next play)
+ # Currently only writing the bookmarks does anything; I'm going to have to
+ # add a menu of bookmarks to the menu afterwards.
+ #
+ # Note that the get_bookmarkfile thing should be replaced with something less
+ # flaky than the path+filename of the movie, but this is good for a initial
+ # go.
+ #
# Revision 1.25 2003/03/17 15:47:16 outlyer
# Merged patch from Angel <[EMAIL PROTECTED]> for "Jump to"
***************
*** 221,224 ****
--- 230,234 ----
self.thread.start()
self.mode = None
+ self.filename = None
***************
*** 237,241 ****
else:
network_play = 0
!
self.mode = mode # setting global var to mode.
--- 247,253 ----
else:
network_play = 0
!
! self.filename = filename
!
self.mode = mode # setting global var to mode.
***************
*** 380,383 ****
--- 392,409 ----
return self.item.eventhandler(event)
+ if event == rc.REC:
+ # Bookmark the current time into a file
+
+ bookmarkfile = util.get_bookmarkfile(self.filename)
+
+ handle = open(bookmarkfile,'a+') # Should be appending so we could
+ # have multiple bookmarks later, with
+ # a menu or something.
+ handle.write(str(self.item.elapsed))
+ handle.write('\n')
+ handle.close()
+ print "Added bookmark at position " + str(self.item.elapsed)
+ return self.item.eventhandler(event)
+
if event == rc.EXIT:
self.stop()
***************
*** 583,586 ****
--- 609,613 ----
print 'MPlayer logging to "%s" and "%s"' % (fname_out, fname_err)
+ self.RE_TIME = re.compile("^A: +([0-9]+)").match
self.item = item
self.parser = MPlayerParser(item)
***************
*** 612,616 ****
if line.find("A:") == 0:
! self.item.elapsed = line
elif line.find("Exiting...") == 0:
--- 639,645 ----
if line.find("A:") == 0:
! m = self.RE_TIME(line) # Convert decimal
! if hasattr(m,'group'):
! self.item.elapsed = int(m.group(1))+1
elif line.find("Exiting...") == 0:
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog