Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv18045/src/plugins
Modified Files:
lcd.py
Log Message:
Better support for broken MP3 tags
Index: lcd.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/lcd.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** lcd.py 27 Aug 2003 13:02:31 -0000 1.7
--- lcd.py 1 Sep 2003 16:55:42 -0000 1.8
***************
*** 14,17 ****
--- 14,20 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.8 2003/09/01 16:55:42 gsbarbieri
+ # Better support for broken MP3 tags
+ #
# Revision 1.7 2003/08/27 13:02:31 gsbarbieri
# 2x20 and 2x40 screens.
***************
*** 214,222 ****
"9 3 %d 3 h 2 \"%s\"",
"( self.width, player.getattr('artist') )" ),
! "time_v" : ( "string",
! "2 4 '% 2d:%02d/% 2d:%02d ( %2d%%)'",
! "( int(player.length / 60), int(player.length %
60)," +
! " int(player.elapsed / 60), int(player.elapsed %
60)," +
! " int(player.elapsed * 100 / player.length) )" ),
"timebar1_v": ( "string", "21 4 '['", None),
"timebar2_v": ( "string", "40 4 ']'", None),
--- 217,229 ----
"9 3 %d 3 h 2 \"%s\"",
"( self.width, player.getattr('artist') )" ),
! "time_v1" : ( "string",
! "2 4 '% 2d:%02d/'",
! "( int(player.length / 60), int(player.length %
60) )" ),
! "time_v2" : ( "string",
! "8 4 '% 2d:%02d'",
! "( int(player.elapsed / 60), int(player.elapsed %
60) )" ),
! "time_v3" : ( "string",
! "14 4 '( %2d%%)'",
! "( int(player.elapsed * 100 / player.length) )" ),
"timebar1_v": ( "string", "21 4 '['", None),
"timebar2_v": ( "string", "40 4 ']'", None),
***************
*** 298,306 ****
"1 3 %d 3 h 2 \"%s\"",
"( self.width, player.getattr('artist') )" ),
! "time_v" : ( "string",
! "2 4 '% 2d:%02d/% 2d:%02d ( %2d%%)'",
! "( int(player.length / 60), int(player.length %
60)," +
! " int(player.elapsed / 60), int(player.elapsed %
60)," +
! " int(player.elapsed * 100 / player.length) )" ),
# animation at the begining of the time line
"animation_v": ( "string", "1 4 '%s'",
--- 305,317 ----
"1 3 %d 3 h 2 \"%s\"",
"( self.width, player.getattr('artist') )" ),
! "time_v1" : ( "string",
! "2 4 '% 2d:%02d/'",
! "( int(player.length / 60), int(player.length %
60) )" ),
! "time_v2" : ( "string",
! "8 4 '% 2d:%02d'",
! "( int(player.elapsed / 60), int(player.elapsed %
60) )" ),
! "time_v3" : ( "string",
! "14 4 '( %2d%%)'",
! "( int(player.elapsed * 100 / player.length) )" ),
# animation at the begining of the time line
"animation_v": ( "string", "1 4 '%s'",
***************
*** 348,355 ****
"1 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v" : ( "string",
! "1 2 ' % 2d:%02d/% 2d:%02d'",
! "( int(player.length / 60), int(player.length %
60)," +
! " int(player.elapsed / 60), int(player.elapsed %
60))" )
},
--- 359,372 ----
"1 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v1" : ( "string",
! "2 2 '% 2d:%02d/'",
! "( int(player.length / 60), int(player.length %
60) )" ),
! "time_v2" : ( "string",
! "8 2 '% 2d:%02d'",
! "( int(player.elapsed / 60), int(player.elapsed %
60) )" ),
! # animation at the begining of the time line
! "animation_v": ( "string", "1 2 '%s'",
! "animation_audioplayer_chars[" +
! " player.elapsed %
len(animation_audioplayer_chars)]")
},
***************
*** 385,392 ****
"1 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v" : ( "string",
! "1 2 ' % 2d:%02d/% 2d:%02d'",
! "( int(player.length / 60), int(player.length %
60)," +
! " int(player.elapsed / 60), int(player.elapsed %
60))" )
},
--- 402,418 ----
"1 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v1" : ( "string",
! "2 2 '% 2d:%02d/'",
! "( int(player.length / 60), int(player.length %
60) )" ),
! "time_v2" : ( "string",
! "8 2 '% 2d:%02d'",
! "( int(player.elapsed / 60), int(player.elapsed %
60) )" ),
! "time_v3" : ( "string",
! "14 2 '( %2d%%)'",
! "( int(player.elapsed * 100 / player.length) )" ),
! # animation at the begining of the time line
! "animation_v": ( "string", "1 2 '%s'",
! "animation_audioplayer_chars[" +
! " player.elapsed %
len(animation_audioplayer_chars)]")
},
***************
*** 431,439 ****
"8 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v" : ( "string",
! "2 2 '% 2d:%02d/% 2d:%02d ( %2d%%)'",
! "( int(player.length / 60), int(player.length %
60)," +
! " int(player.elapsed / 60), int(player.elapsed %
60)," +
! " int(player.elapsed * 100 / player.length) )" ),
"timebar1_v": ( "string", "21 2 '['", None),
"timebar2_v": ( "string", "40 2 ']'", None),
--- 457,469 ----
"8 1 %d 1 h 2 \"%s\"",
"( self.width, title )" ),
! "time_v1" : ( "string",
! "2 2 '% 2d:%02d/'",
! "( int(player.length / 60), int(player.length %
60) )" ),
! "time_v2" : ( "string",
! "8 2 '% 2d:%02d'",
! "( int(player.elapsed / 60), int(player.elapsed %
60) )" ),
! "time_v3" : ( "string",
! "14 2 '( %2d%%)'",
! "( int(player.elapsed * 100 / player.length) )" ),
"timebar1_v": ( "string", "21 2 '['", None),
"timebar2_v": ( "string", "40 2 ']'", None),
***************
*** 540,544 ****
self.lcd.screen_set( "welcome", "-priority 192 -duration 2 -heartbeat off" )
self.last_screen = "welcome"
!
self.lsv = { } # will hold last screen value (lsv)
--- 570,574 ----
self.lcd.screen_set( "welcome", "-priority 192 -duration 2 -heartbeat off" )
self.last_screen = "welcome"
!
self.lsv = { } # will hold last screen value (lsv)
***************
*** 556,560 ****
if self.disable: return
! sname = type
if type == 'menu':
menu = object.menustack[ -1 ]
--- 586,603 ----
if self.disable: return
! if type == 'player':
! sname = "%s_%s" % ( object.type, type )
! else:
! sname = type
!
! if sname != self.last_screen:
! # recreate screen
! # This is used to handle cases where the previous screen was dirty
! # ie: played music with info and now play music without, the previous
! # info will still be there
! self.lcd.screen_del( sname )
! self.generate_screen( sname )
! self.lsv = { } # reset last changed values
!
if type == 'menu':
menu = object.menustack[ -1 ]
***************
*** 577,580 ****
--- 620,625 ----
if menu.selected.type == 'audio':
title = menu.selected.getattr( 'title' )
+ if not title:
+ title = menu.selected.getattr( 'name' )
if menu.selected.getattr( 'trackno' ):
title = "%s - %s" % ( menu.selected.getattr( 'trackno' ), title )
***************
*** 583,589 ****
player = object
title = player.getattr( 'title' )
if player.getattr( 'trackno' ):
title = "%s - %s" % ( player.getattr( 'trackno' ), title )
- sname = "%s_%s" % ( player.type, type )
--- 628,635 ----
player = object
title = player.getattr( 'title' )
+ if not title:
+ title = player.getattr( 'name' )
if player.getattr( 'trackno' ):
title = "%s - %s" % ( player.getattr( 'trackno' ), title )
***************
*** 608,612 ****
if val: param = param % eval( val )
except:
! pass
k = '%s %s' % ( sname, w )
try:
--- 654,659 ----
if val: param = param % eval( val )
except:
! param = None
!
k = '%s %s' % ( sname, w )
try:
***************
*** 617,625 ****
self.lsv[ k ] = param
! try:
! self.lcd.widget_set( sname, w, param.encode( 'latin1' ) )
! except UnicodeError:
! self.lcd.widget_set( sname, w, param )
!
if self.last_screen != sname:
self.lcd.screen_set( self.last_screen, "-priority 128" )
--- 664,674 ----
self.lsv[ k ] = param
! if param:
! try:
! self.lcd.widget_set( sname, w, param.encode( 'latin1' ) )
! except UnicodeError:
! self.lcd.widget_set( sname, w, param )
!
!
if self.last_screen != sname:
self.lcd.screen_set( self.last_screen, "-priority 128" )
***************
*** 692,701 ****
for s in screens:
! self.lcd.screen_add( s )
! widgets = screens[ s ]
! self.lcd.screen_set( s, "-heartbeat off" )
! for w in widgets:
! type, param, val = screens[ s ][ w ]
! self.lcd.widget_add( s, w, type )
--- 741,755 ----
for s in screens:
! self.generate_screen( s )
!
!
! def generate_screen( self, s ):
! self.lcd.screen_add( s )
! widgets = self.screens[ s ]
! self.lcd.screen_set( s, "-heartbeat off" )
!
! for w in widgets:
! type, param, val = self.screens[ s ][ w ]
! self.lcd.widget_add( s, w, type )
-------------------------------------------------------
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