Update of /cvsroot/freevo/freevo/src/audio/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv7915

Modified Files:
        cdbackup.py detach.py radio.py radioplayer.py vux.py 
        webradio.py 
Log Message:
cleanup

Index: cdbackup.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/cdbackup.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** cdbackup.py 14 Sep 2003 20:47:48 -0000      1.18
--- cdbackup.py 20 Sep 2003 09:42:32 -0000      1.19
***************
*** 29,32 ****
--- 29,35 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.19  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
  # Revision 1.18  2003/09/14 20:47:48  outlyer
  # * TRUE/FALSE wasn't working in Python 2.3...
***************
*** 91,101 ****
  import mmpython
  
- # Set to 1 for debug output
- DEBUG = config.DEBUG
- 
- TRUE = 1
- FALSE = 0
- 
- 
  rip_thread = None
  
--- 94,97 ----
***************
*** 207,212 ****
                  else:
                      self.device = self.item.devicename
!                     if DEBUG:
!                         print 'devicename = %s' %self.device
                      return [ ( self.create_backup_menu,
                                 _('Rip the CD to the hard drive'),
--- 203,207 ----
                  else:
                      self.device = self.item.devicename
!                     _debug_('devicename = %s' %self.device)
                      return [ ( self.create_backup_menu,
                                 _('Rip the CD to the hard drive'),
***************
*** 323,328 ****
              os.makedirs(pathname, 0777)
          except:
!             if DEBUG:
!                 print 'Directory %s already exists' % pathname
  
          self.output_directory = pathname
--- 318,322 ----
              os.makedirs(pathname, 0777)
          except:
!             _debug_('Directory %s already exists' % pathname)
  
          self.output_directory = pathname
***************
*** 378,382 ****
                                    pathname_cdparanoia, path_tail_cdparanoia)
  
!             if DEBUG: print 'cdparanoia:  %s' % cdparanoia_command
      
              # Have the OS execute the CD Paranoia rip command            
--- 372,376 ----
                                    pathname_cdparanoia, path_tail_cdparanoia)
  
!             _debug_('cdparanoia:  %s' % cdparanoia_command)
      
              # Have the OS execute the CD Paranoia rip command            
***************
*** 392,396 ****
                                  pathname, path_tail)
  
!                 if DEBUG: 'lame: %s' %lame_command                          
                  os.system(lame_command)
                  try: 
--- 386,390 ----
                                  pathname, path_tail)
  
!                 _debug_('lame: %s' %lame_command)
                  os.system(lame_command)
                  try: 
***************
*** 418,422 ****
                                    path_tail)
  
!                 if DEBUG: 'oggenc_command: %s' %oggenc_command                       
   
                  os.system(oggenc_command)
                      
--- 412,416 ----
                                    path_tail)
  
!                 _debug_('oggenc_command: %s' %oggenc_command)
                  os.system(oggenc_command)
                      
***************
*** 435,440 ****
                      '"%s%s.flac"' % (artist, album, song_names[i], track,
                                       len(song_names), pathname, path_tail)
!                 if DEBUG: 'flac_command: %s' % (flac_command)
!                 if DEBUG: 'metaflac    : %s' % (metaflac_command)
                  os.system(flac_command)
                  os.system(metaflac_command)
--- 429,434 ----
                      '"%s%s.flac"' % (artist, album, song_names[i], track,
                                       len(song_names), pathname, path_tail)
!                 _debug_('flac_command: %s' % (flac_command))
!                 _debug_('metaflac    : %s' % (metaflac_command))
                  os.system(flac_command)
                  os.system(metaflac_command)

Index: detach.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/detach.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** detach.py   19 Sep 2003 22:10:11 -0000      1.7
--- detach.py   20 Sep 2003 09:42:32 -0000      1.8
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.8  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
  # Revision 1.7  2003/09/19 22:10:11  dischi
  # check self.player before using it
***************
*** 43,54 ****
  
  
- import plugin
  import config
! import event as em
! 
  import menu
  
! TRUE  = 1
! FALSE = 0
  
  class PluginInterface(plugin.MainMenuPlugin):
--- 46,54 ----
  
  
  import config
! import plugin
  import menu
  
! from event import *
  
  class PluginInterface(plugin.MainMenuPlugin):
***************
*** 59,63 ****
      def __init__(self):
          plugin.MainMenuPlugin.__init__(self)
!         config.EVENTS['audio']['DISPLAY'] = em.Event(em.FUNCTION_CALL, 
arg=self.detach)
          self.player = None
          self.show_item = menu.MenuItem(_('Show player'), action=self.show)
--- 59,63 ----
      def __init__(self):
          plugin.MainMenuPlugin.__init__(self)
!         config.EVENTS['audio']['DISPLAY'] = Event(FUNCTION_CALL, arg=self.detach)
          self.player = None
          self.show_item = menu.MenuItem(_('Show player'), action=self.show)
***************
*** 101,106 ****
  
      def eventhandler(self, event, menuw=None):
!         if self.player and event == em.AUDIO_PLAY_END:
              self.player.eventhandler(event=event)
!             return TRUE
!         return FALSE
--- 101,106 ----
  
      def eventhandler(self, event, menuw=None):
!         if self.player and event == AUDIO_PLAY_END:
              self.player.eventhandler(event=event)
!             return True
!         return False

Index: radio.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/radio.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** radio.py    27 Aug 2003 15:30:12 -0000      1.1
--- radio.py    20 Sep 2003 09:42:32 -0000      1.2
***************
*** 19,22 ****
--- 19,25 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.2  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
  # Revision 1.1  2003/08/27 15:30:12  mikeruelle
  # Start of Radio Support
***************
*** 51,64 ****
  import config, menu, rc, plugin, skin, util
  from audio.player import PlayerGUI
- import event as em
  from item import Item
  
- #get the sinfletons so we can add our menu and get skin info
- skin = skin.get_singleton()
- menuwidget = menu.get_singleton()
- 
- TRUE = 1
- FALSE = 0
- 
  
  # This is the class that actually runs the commands. Eventually
--- 54,59 ----
***************
*** 76,80 ****
      def play(self, arg=None, menuw=None):
          print self.station+" "+str(self.station_index)+" "+self.name
! #        self.parent.current_item = self
          self.elapsed = 0
  
--- 71,75 ----
      def play(self, arg=None, menuw=None):
          print self.station+" "+str(self.station_index)+" "+self.name
!         # self.parent.current_item = self
          self.elapsed = 0
  
***************
*** 121,139 ****
              station_items += [ radio_item ]
          if (len(station_items) == 0):
!             station_items += [menu.MenuItem('No Stations found', 
menuwidget.goto_prev_page, 0)]
          station_menu = menu.Menu('Stations', station_items)
          rc.app(None)
!         menuwidget.pushmenu(station_menu)
!         menuwidget.refresh()
  
  # our plugin wrapper, just creates the main menu item and adds it.
  class PluginInterface(plugin.MainMenuPlugin):
      def items(self, parent):
!         menu_items = skin.settings.mainmenu.items
  
          item = RadioMainMenuItem()
          item.name = 'Radio'
          if menu_items.has_key('radio') and menu_items['radio'].icon:
!             item.icon = os.path.join(skin.settings.icon_dir, 
menu_items['radio'].icon)
          if menu_items.has_key('radio') and menu_items['radio'].image:
              item.image = menu_items['radio'].image
--- 116,135 ----
              station_items += [ radio_item ]
          if (len(station_items) == 0):
!             station_items += [menu.MenuItem('No Stations found', 
menwu.goto_prev_page, 0)]
          station_menu = menu.Menu('Stations', station_items)
          rc.app(None)
!         menuw.pushmenu(station_menu)
!         menuw.refresh()
  
  # our plugin wrapper, just creates the main menu item and adds it.
  class PluginInterface(plugin.MainMenuPlugin):
      def items(self, parent):
!         menu_items = skin.get_singleton().settings.mainmenu.items
  
          item = RadioMainMenuItem()
          item.name = 'Radio'
          if menu_items.has_key('radio') and menu_items['radio'].icon:
!             item.icon = os.path.join(skin.get_singleton().settings.icon_dir,
!                                      menu_items['radio'].icon)
          if menu_items.has_key('radio') and menu_items['radio'].image:
              item.image = menu_items['radio'].image

Index: radioplayer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/radioplayer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** radioplayer.py      1 Sep 2003 19:46:02 -0000       1.2
--- radioplayer.py      20 Sep 2003 09:42:32 -0000      1.3
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.3  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
  # Revision 1.2  2003/09/01 19:46:02  dischi
  # add menuw to eventhandler, it may be needed
***************
*** 16,21 ****
  # Start of Radio Support
  #
- #
- #
  # -----------------------------------------------------------------------
  # Freevo - A Home Theater PC framework
--- 19,22 ----
***************
*** 46,59 ****
  import config     # Configuration handler. reads config file.
  import util       # Various utilities
- 
- import rc
  import plugin
- from event import *
- 
  
! DEBUG = config.DEBUG
! 
! TRUE  = 1
! FALSE = 0
  
  
--- 47,53 ----
  import config     # Configuration handler. reads config file.
  import util       # Various utilities
  import plugin
  
! from event import *
  
  
***************
*** 101,112 ****
--- 95,109 ----
          os.system('%s -m' % config.RADIO_CMD)
  
+ 
      def is_playing(self):
          print 'Radio Player IS PLAYING?'
          return self.mode == 'play'
  
+ 
      def refresh(self):
          print 'Radio Player refresh'
          self.playerGUI.refresh()
          
+ 
      def eventhandler(self, event, menuw=None):
          """

Index: vux.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/vux.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vux.py      13 Sep 2003 10:08:22 -0000      1.2
--- vux.py      20 Sep 2003 09:42:32 -0000      1.3
***************
*** 1,6 ****
! import os 
! import plugin
! 
! # VUX - Vacillating Utilitarian eXtemporizer
  # vux.py - a trivial vux plugin for freevo
  #
--- 1,9 ----
! #if 0 /*
! # -----------------------------------------------------------------------
! # vux.py - Vacillating Utilitarian eXtemporizer
! # -----------------------------------------------------------------------
! # $Id$
! #
! # Notes: 
  # vux.py - a trivial vux plugin for freevo
  #
***************
*** 15,19 ****
  # have all the playlist and scorelist stuff done (see man vux)
  #
- # plonk this file in src/audio/plugins and
  # add a line to local_conf.py containing
  # plugin.activate('audio.vux')
--- 18,21 ----
***************
*** 28,54 ****
  # after adding the plugin any of of the items (dir/mp3/ogg) in the music
  # menu should have a number of [VUX] entries. 
  
! class PluginInterface(plugin.ItemPlugin):
  
-       def __init__(self):
  
!               plugin.ItemPlugin.__init__(self)
  
!               # create actions and corresponding functions
!               self.commands = [('default', _('[VUX] Start playing'),           
'vuxctl start'),
!                                ('default', _('[VUX] Stop playing'),            
'vuxctl stop'),
!                                ('default', _('[VUX] Next (rating down)'),      
'vuxctl down next'),
!                                ('default', _('[VUX] Next (rating intact)'),    
'vuxctl next'),
!                                ('default', _('[VUX] Next (rating up)'),        
'vuxctl up next'),
!                                ('default', _('[VUX] Playing item rating up'),  
'vuxctl up'),
!                                ('default', _('[VUX] Playing item rating 
down'),'vuxctl down'),
!                                ('dir',     _('[VUX] a dir item do not select'), 
None),
!                                ('audio',   _('[VUX] an audio item, do not select'), 
None) ]
  
  
!       def actions(self, item): 
!               items = []
!               for action_type in ['default', item.type]:
!                       items.extend(([(eval('lambda arg=None, menuw=None: 
os.system("%s")' % x[2]) , x[1]) for x in self.commands if x[0] == action_type]))
  
!               return items
--- 30,107 ----
  # after adding the plugin any of of the items (dir/mp3/ogg) in the music
  # menu should have a number of [VUX] entries. 
+ #
+ # Todo: 
+ #
+ # -----------------------------------------------------------------------
+ # $Log$
+ # Revision 1.3  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
+ #
+ # -----------------------------------------------------------------------
+ # Freevo - A Home Theater PC framework
+ # Copyright (C) 2003 Krister Lagerstrom, et al. 
+ # Please see the file freevo/Docs/CREDITS for a complete list of authors.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ # CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ # Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License along
+ # with this program; if not, write to the Free Software Foundation, Inc.,
+ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ #
+ # ----------------------------------------------------------------------- */
+ #endif
  
! import os 
! import plugin
  
  
! class PluginInterface(plugin.ItemPlugin):
!     """
!     Debian packages a simple tool called vux that can
!     randomly play a set of files. Based on how a file is
!     skipped the 'score' of that file is adapted. My freevo box is
!     Debian based, so adding vux is as simple as:
!     apt-get install vux
!    
!     have all the playlist and scorelist stuff done (see man vux)
!    
!     add a line to local_conf.py containing
!     plugin.activate('audio.vux')
!    
!     Usage: 
!     after adding the plugin any of of the items (dir/mp3/ogg) in the music
!     menu should have a number of [VUX] entries. 
!     """
!     
!     def __init__(self):
!               
!         plugin.ItemPlugin.__init__(self)
  
!         # create actions and corresponding functions
!         self.commands = [('default', _('[VUX] Start playing'),           'vuxctl 
start'),
!                          ('default', _('[VUX] Stop playing'),            'vuxctl 
stop'),
!                          ('default', _('[VUX] Next (rating down)'),      'vuxctl 
down next'),
!                          ('default', _('[VUX] Next (rating intact)'),    'vuxctl 
next'),
!                          ('default', _('[VUX] Next (rating up)'),        'vuxctl up 
next'),
!                          ('default', _('[VUX] Playing item rating up'),  'vuxctl 
up'),
!                          ('default', _('[VUX] Playing item rating down'),'vuxctl 
down'),
!                          ('dir',     _('[VUX] a dir item do not select'), None),
!                          ('audio',   _('[VUX] an audio item, do not select'), None) ]
  
  
!     def actions(self, item): 
!         items = []
!         for action_type in ['default', item.type]:
!             items.extend(([(eval('lambda arg=None, menuw=None: os.system("%s")' % 
x[2]) ,
!                             x[1]) for x in self.commands if x[0] == action_type]))
  
!         return items

Index: webradio.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/webradio.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** webradio.py 23 Aug 2003 12:51:42 -0000      1.2
--- webradio.py 20 Sep 2003 09:42:32 -0000      1.3
***************
*** 12,15 ****
--- 12,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.3  2003/09/20 09:42:32  dischi
+ # cleanup
+ #
  # Revision 1.2  2003/08/23 12:51:42  dischi
  # removed some old CVS log messages
***************
*** 42,58 ****
  #endif
  
  
  import plugin
  from item import Item
  from audio.audioitem import AudioItem
- import config
- import event as em
- from xml.utils import qp_xml
- import os
  
- import menu
- 
- TRUE  = 1
- FALSE = 0
  
  class EntryList(Item):
--- 45,58 ----
  #endif
  
+ import os
+ from xml.utils import qp_xml
  
+ import config
  import plugin
+ import menu
+ 
  from item import Item
  from audio.audioitem import AudioItem
  
  
  class EntryList(Item):
***************
*** 76,80 ****
                      url = info.attrs[('', 'HREF')]
              if title and url:
!                 items.append(AudioItem(url, self, title, scan=FALSE))
                  
          menuw.pushmenu(menu.Menu(self.name, items))
--- 76,80 ----
                      url = info.attrs[('', 'HREF')]
              if title and url:
!                 items.append(AudioItem(url, self, title, scan=False))
                  
          menuw.pushmenu(menu.Menu(self.name, items))
***************
*** 102,118 ****
  class PluginInterface(plugin.MainMenuPlugin):
      """
!     plugin to detach the audio player to e.g. view pictures while listening
!     to music
      """
!     def __init__(self, mediamarks='./WIP/Dischi/gxine-mediamarks'):
!         plugin.MainMenuPlugin.__init__(self)
!         if os.path.isfile(mediamarks):
              parser = qp_xml.Parser()
              f = open(mediamarks)
              self.mediamarks = parser.parse(f.read())
              f.close()
!         else:
!             print '%s: file not found, webradio plugin deactivated' % mediamarks
!             self.mediamarks = None
  
              
--- 102,131 ----
  class PluginInterface(plugin.MainMenuPlugin):
      """
!     Show radio stations defined in an xml file. The file format is based on
!     the gxine mediamarks file.
! 
!     plugin.activate('audio.webradio', args='file')
! 
!     If no file is given, the default mediamarks file will be taken
      """
!     def __init__(self, mediamarks=None):
!         if not mediamarks:
!             mediamarks = os.path.join(config.SHARE_DIR, 'gxine-mediamarks')
!             
!         if not os.path.isfile(mediamarks):
!             self.reason = '%s: file not found' % mediamarks
!             return
! 
!         try:
              parser = qp_xml.Parser()
              f = open(mediamarks)
              self.mediamarks = parser.parse(f.read())
              f.close()
!         except:
!             self.reason = 'mediamarks file corrupt'
!             return
! 
!         # init the plugin
!         plugin.MainMenuPlugin.__init__(self)
  
              




-------------------------------------------------------
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

Reply via email to