Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv27463/src/plugins
Modified Files:
lcd.py
Log Message:
Video Player support
Index: lcd.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/lcd.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** lcd.py 1 Sep 2003 16:55:42 -0000 1.8
--- lcd.py 1 Sep 2003 20:35:28 -0000 1.9
***************
*** 14,17 ****
--- 14,20 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.9 2003/09/01 20:35:28 gsbarbieri
+ # Video Player support
+ #
# Revision 1.8 2003/09/01 16:55:42 gsbarbieri
# Better support for broken MP3 tags
***************
*** 71,76 ****
import time
import plugin
import config
! DEBUG=1
# Configuration: (Should move to freevo_conf.py?)
sep_str = " | " # use as separator between two strings. Like: "Length:
123<sep_str>Plot: ..."
--- 74,82 ----
import time
import plugin
+ from event import *
import config
!
! DEBUG=config.DEBUG
!
# Configuration: (Should move to freevo_conf.py?)
sep_str = " | " # use as separator between two strings. Like: "Length:
123<sep_str>Plot: ..."
***************
*** 235,238 ****
--- 241,283 ----
" player.elapsed %
len(animation_audioplayer_chars)]")
},
+
+ "video_player" :
+ { "video_l" : ( "string",
+ "2 1 'VIDEO: '",
+ None ),
+ "tag_l" : ( "string",
+ "2 2 ' TAG: '",
+ None ),
+ "genre_l" : ( "string",
+ "1 3 'GENRE: '",
+ None ),
+ "video_v" : ( "scroller",
+ "9 1 %d 1 h 2 \"%s\"",
+ "( self.width, title )" ),
+ "tag_v" : ( "scroller",
+ "9 2 %d 2 h 2 \"%s\"",
+ "( self.width, player.getattr('tagline') )" ),
+ "genre_v" : ( "scroller",
+ "9 3 %d 3 h 2 \"%s\"",
+ "( self.width, player.getattr('genre') )" ),
+ "time_v1" : ( "string",
+ "2 4 '%s/'",
+ "( length )" ),
+ "time_v2" : ( "string",
+ "10 4 '%s'",
+ "( elapsed )" ),
+ "time_v3" : ( "string",
+ "18 4 '( %2d%%)'",
+ "( int( percentage * 100 ) )" ),
+ "timebar1_v": ( "string", "26 4 '['", None),
+ "timebar2_v": ( "string", "40 4 ']'", None),
+ "timebar3_v": ( "hbar",
+ "27 4 '%d'","( int( percentage * 70 ) )"),
+ # animation at the begining of the time line
+ "animation_v": ( "string", "1 4 '%s'",
+ "animation_audioplayer_chars[" +
+ " player.elapsed %
len(animation_audioplayer_chars)]")
+ },
+
"tv" :
***************
*** 318,321 ****
--- 363,388 ----
"animation_audioplayer_chars[player.elapsed %
len(animation_audioplayer_chars)]")
},
+
+ "video_player" :
+ { "video_v" : ( "scroller",
+ "1 1 %d 1 h 2 \"%s\"",
+ "( self.width, title )" ),
+ "tag_v" : ( "scroller",
+ "1 2 %d 2 h 2 \"%s\"",
+ "( self.width, player.getattr('tagline') )" ),
+ "genre_v" : ( "scroller",
+ "1 3 %d 3 h 2 \"%s\"",
+ "( self.width, player.getattr('genre') )" ),
+ "time_v1" : ( "string",
+ "3 4 '%s /'",
+ "( length )" ),
+ "time_v2" : ( "string",
+ "12 4 '%s'",
+ "( elapsed )" ),
+ # animation at the begining of the time line
+ "animation_v": ( "string", "1 4 '%s'",
+ "animation_audioplayer_chars[" +
+ " player.elapsed %
len(animation_audioplayer_chars)]")
+ },
"tv" :
***************
*** 371,374 ****
--- 438,458 ----
},
+ "video_player" :
+ { "video_v" : ( "scroller",
+ "1 1 %d 1 h 2 \"%s\"" ,
+ "( self.width, title )" ),
+ "time_v2" : ( "string",
+ "2 2 '%s'",
+ "( elapsed )" ),
+ "time_v3" : ( "string",
+ "11 2 '( %2d%%)'",
+ "( int( percentage * 100 ) )" ),
+ # animation at the begining of the time line
+ "animation_v": ( "string", "1 2 '%s'",
+ "animation_audioplayer_chars[" +
+ " player.elapsed %
len(animation_audioplayer_chars)]")
+ },
+
+
"tv" :
{ "chan_v" : ( "scroller",
***************
*** 417,420 ****
--- 501,521 ----
},
+ "video_player" :
+ { "video_v" : ( "scroller",
+ "1 1 %d 1 h 2 \"%s\"",
+ "( self.width, title )" ),
+ "time_v1" : ( "string",
+ "3 2 '%s /'",
+ "( length )" ),
+ "time_v2" : ( "string",
+ "12 2 '%s'",
+ "( elapsed )" ),
+ # animation at the begining of the time line
+ "animation_v": ( "string", "1 2 '%s'",
+ "animation_audioplayer_chars[" +
+ " player.elapsed %
len(animation_audioplayer_chars)]")
+ },
+
+
"tv":
{ "chan_v" : ( "scroller",
***************
*** 469,473 ****
"timebar2_v": ( "string", "40 2 ']'", None),
"timebar3_v": ( "hbar",
! "22 2 '%d'","(int(player.elapsed *90 /
player.length))"),
# animation at the begining of the time line
"animation_v": ( "string", "1 2 '%s'",
--- 570,574 ----
"timebar2_v": ( "string", "40 2 ']'", None),
"timebar3_v": ( "hbar",
! "22 2 '%d'","(int(player.elapsed * 90 /
player.length))"),
# animation at the begining of the time line
"animation_v": ( "string", "1 2 '%s'",
***************
*** 476,479 ****
--- 577,609 ----
},
+
+ "video_player" :
+ { "video_l" : ( "string",
+ "2 1 'VIDEO: '",
+ None ),
+ "video_v" : ( "scroller",
+ "9 1 %d 1 h 2 \"%s\"",
+ "( self.width, title )" ),
+ "time_v1" : ( "string",
+ "2 2 '%s/'",
+ "( length )" ),
+ "time_v2" : ( "string",
+ "10 2 '%s'",
+ "( elapsed )" ),
+ "time_v3" : ( "string",
+ "18 2 '( %2d%%)'",
+ "( int( percentage * 100 ) )" ),
+ "timebar1_v": ( "string", "26 2 '['", None),
+ "timebar2_v": ( "string", "40 2 ']'", None),
+ "timebar3_v": ( "hbar",
+ "27 2 '%d'","( int( percentage * 70 ) )"),
+ # animation at the begining of the time line
+ "animation_v": ( "string", "1 2 '%s'",
+ "animation_audioplayer_chars[" +
+ " player.elapsed %
len(animation_audioplayer_chars)]")
+ },
+
+
+
"tv":
{ "chan_l" : ( "string",
***************
*** 510,515 ****
}
- DEBUG = config.DEBUG
-
def get_info( item, list ):
info = ""
--- 640,643 ----
***************
*** 548,560 ****
print ""
- plugin.register( self, "lcd" )
-
self.poll_interval = 10
self.disable = 0
self.height = self.lcd.d_height
self.width = self.lcd.d_width
self.generate_screens()
! if self.disable:
return
# Show welcome screen:
--- 676,694 ----
print ""
self.poll_interval = 10
+ self.poll_menu_only = 0
self.disable = 0
self.height = self.lcd.d_height
self.width = self.lcd.d_width
+ self.playitem = None
self.generate_screens()
! if self.disable:
return
+ else:
+ self.event_listener = 1
+
+ plugin.register( self, "lcd" )
+
+
# Show welcome screen:
***************
*** 630,635 ****
if not title:
title = player.getattr( 'name' )
! if player.getattr( 'trackno' ):
! title = "%s - %s" % ( player.getattr( 'trackno' ), title )
--- 764,784 ----
if not title:
title = player.getattr( 'name' )
!
! if player.type == 'audio':
! if player.getattr( 'trackno' ):
! title = "%s - %s" % ( player.getattr( 'trackno' ), title )
!
! elif player.type == 'video':
! length = player.getattr( 'length' )
! elapsed = player.elapsed
! if elapsed / 3600:
! elapsed ='%d:%02d:%02d' % ( elapsed / 3600, ( elapsed % 3600 ) /
60,
! elapsed % 60)
! else:
! elapsed = '%d:%02d' % ( elapsed / 60, elapsed % 60)
! try:
! percentage = float( player.elapsed / player.info.video[0].length
)
! except:
! percentage = None
***************
*** 680,683 ****
--- 829,835 ----
if self.disable: return
+ if self.playitem:
+ self.draw( ( 'player', self.playitem ), None )
+
try:
screens = poll_widgets[ self.lines ][ self.columns ]
***************
*** 753,755 ****
--- 905,915 ----
type, param, val = self.screens[ s ][ w ]
self.lcd.widget_add( s, w, type )
+
+ def eventhandler( self, event, menuw=None ):
+ if event == PLAY_START:
+ self.playitem = event.arg
+ elif event == PLAY_END or event == STOP:
+ self.playitem = None
+
+ return 0
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog