Update of /cvsroot/freevo/freevo/src/video
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18147

Modified Files:
        configure.py videoitem.py 
Log Message:
configure menu items cleanup
support chapters as ChapterInfo in mmpython (e.g. ogm files)


Index: configure.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/video/configure.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** configure.py        6 May 2004 18:12:17 -0000       1.25
--- configure.py        28 May 2004 15:50:27 -0000      1.26
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.26  2004/05/28 15:50:27  dischi
+ # configure menu items cleanup
+ # support chapters as ChapterInfo in mmpython (e.g. ogm files)
+ #
  # Revision 1.25  2004/05/06 18:12:17  dischi
  # fix crash
***************
*** 78,83 ****
  
  
- current_fxd_file = None
- 
  #
  # Dummy for playing the movie
--- 82,85 ----
***************
*** 99,121 ****
  
  def audio_selection_menu(arg=None, menuw=None):
!     global current_fxd_file
!     items = []
!     for a in arg.info['audio']:
          if not a.has_key('id') or a['id'] in ('', None):
!             a['id'] = arg.info['audio'].index(a) + 1
          
!         if not a.has_key('language') or not not a['language']:
              a['language'] = _('Stream %s') % a['id']
  
!         if not a.has_key('channels') or not not a['channels']:
              a['channels'] = 2 # wild guess :-)
  
!         if not a.has_key('codec') or not not a['codec']:
!             a['codec'] = _('Unknown')
  
!         txt = '%s (channels=%s, codec=%s, id=%s)' % (a['language'], a['channels'],
!                                                      a['codec'], a['id'])
!         items.append(menu.MenuItem(txt, audio_selection, (arg, a['id'])))
!     moviemenu = menu.Menu(_('Audio Menu'), items, fxd_file=current_fxd_file)
      menuw.pushmenu(moviemenu)
          
--- 101,121 ----
  
  def audio_selection_menu(arg=None, menuw=None):
!     item       = arg
!     menu_items = []
! 
!     for a in item.info['audio']:
          if not a.has_key('id') or a['id'] in ('', None):
!             a['id'] = item.info['audio'].index(a) + 1
          
!         if not a.has_key('language') or not a['language']:
              a['language'] = _('Stream %s') % a['id']
  
!         if not a.has_key('channels') or not a['channels']:
              a['channels'] = 2 # wild guess :-)
  
!         txt = '%s (channels=%s)' % (a['language'], a['channels'])
!         menu_items.append(menu.MenuItem(txt, audio_selection, (item, a['id'])))
  
!     moviemenu = menu.Menu(_('Audio Menu'), menu_items, fxd_file=item.skin_fxd)
      menuw.pushmenu(moviemenu)
          
***************
*** 130,140 ****
  
  def subtitle_selection_menu(arg=None, menuw=None):
!     global current_fxd_file
!     items = []
  
!     items += [ menu.MenuItem(_('no subtitles'), subtitle_selection, (arg, -1)) ]
!     for s in range(len(arg.info['subtitles'])):
!         items.append(menu.MenuItem(arg.info['subtitles'][s], subtitle_selection, 
(arg, s)))
!     moviemenu = menu.Menu(_('Subtitle Menu'), items, fxd_file=current_fxd_file)
      menuw.pushmenu(moviemenu)
  
--- 130,140 ----
  
  def subtitle_selection_menu(arg=None, menuw=None):
!     item       = arg
  
!     menu_items = [ menu.MenuItem(_('no subtitles'), subtitle_selection, (item, -1)) ]
!     for s in range(len(item.info['subtitles'])):
!         menu_items.append(menu.MenuItem(item.info['subtitles'][s],
!                                         subtitle_selection, (item, s)))
!     moviemenu = menu.Menu(_('Subtitle Menu'), menu_items, fxd_file=item.skin_fxd)
      menuw.pushmenu(moviemenu)
  
***************
*** 149,158 ****
      
  def chapter_selection_menu(arg=None, menuw=None):
!     global current_fxd_file
!     items = []
!     for c in range(1, arg.info['chapters']):
!         items += [ menu.MenuItem(_('Play chapter %s') % c, chapter_selection,
!                                  (arg, ' -chapter %s' % c)) ]
!     moviemenu = menu.Menu(_('Chapter Menu'), items, fxd_file=current_fxd_file)
      menuw.pushmenu(moviemenu)
  
--- 149,164 ----
      
  def chapter_selection_menu(arg=None, menuw=None):
!     item  = arg
!     menu_items = []
!     if isinstance(arg.info['chapters'], int):
!         for c in range(1, arg.info['chapters']):
!             menu_items += [ menu.MenuItem(_('Play chapter %s') % c, 
chapter_selection,
!                                           (arg, ' -chapter %s' % c)) ]
!     elif arg.info['chapters']:
!         for c in arg.info['chapters']:
!             menu_items += [ menu.MenuItem(c.name, chapter_selection,
!                                           (arg, ' -ss %s' % c.pos)) ]
!         
!     moviemenu = menu.Menu(_('Chapter Menu'), menu_items, fxd_file=item.skin_fxd)
      menuw.pushmenu(moviemenu)
  
***************
*** 211,219 ****
  
          
! def get_menu(item, menuw, fxd_file):
!     global current_fxd_file
!     current_fxd_file = fxd_file
! 
      items = get_items(item) + [ menu.MenuItem(_('Play'), play_movie, (item, '')) ]
!     return menu.Menu(_('Config Menu'), items, fxd_file=fxd_file)
      
--- 217,222 ----
  
          
! def get_menu(item, menuw):
      items = get_items(item) + [ menu.MenuItem(_('Play'), play_movie, (item, '')) ]
!     return menu.Menu(_('Config Menu'), items, fxd_file=item.skin_fxd)
      

Index: videoitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/video/videoitem.py,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** videoitem.py        13 May 2004 13:49:24 -0000      1.135
--- videoitem.py        28 May 2004 15:50:28 -0000      1.136
***************
*** 11,14 ****
--- 11,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.136  2004/05/28 15:50:28  dischi
+ # configure menu items cleanup
+ # support chapters as ChapterInfo in mmpython (e.g. ogm files)
+ #
  # Revision 1.135  2004/05/13 13:49:24  outlyer
  # The much appreciated 'alternate player' patch from den_RDC. Allows you to
***************
*** 577,581 ****
          if not self.menuw:
              self.menuw = menuw
!         confmenu = configure.get_menu(self, self.menuw, self.skin_fxd)
          self.menuw.pushmenu(confmenu)
          
--- 581,585 ----
          if not self.menuw:
              self.menuw = menuw
!         confmenu = configure.get_menu(self, self.menuw)
          self.menuw.pushmenu(confmenu)
          



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to