Author: dmeyer
Date: Fri Feb  2 19:39:45 2007
New Revision: 9129

Modified:
   trunk/ui/bin/freevo
   trunk/ui/share/freevo_config.py
   trunk/ui/src/application/handler.py
   trunk/ui/src/config.py
   trunk/ui/src/gui/areas/tvlisting_area.py
   trunk/ui/src/gui/displays/__init__.py
   trunk/ui/src/gui/displays/display.py
   trunk/ui/src/gui/font.py
   trunk/ui/src/gui/theme.py
   trunk/ui/src/image/imageitem.py
   trunk/ui/src/plugins/mixer.py
   trunk/ui/src/plugins/ossmixer.py
   trunk/ui/src/plugins/shutdown.py
   trunk/ui/src/setup.py
   trunk/ui/src/video/videoitem.py

Log:
more config cleanup

Modified: trunk/ui/bin/freevo
==============================================================================
--- trunk/ui/bin/freevo (original)
+++ trunk/ui/bin/freevo Fri Feb  2 19:39:45 2007
@@ -125,7 +125,7 @@
             return True
         lirc.stop()
         options = ''
-        if config.CONF.display in ( 'x11', 'dga' ) and not \
+        if config.GUI_DISPLAY in ( 'imlib2', ) and not \
                (os.environ.has_key('DISPLAY') and os.environ['DISPLAY']):
             options = '-fs'
         log.info('start freevo %s', options)

Modified: trunk/ui/share/freevo_config.py
==============================================================================
--- trunk/ui/share/freevo_config.py     (original)
+++ trunk/ui/share/freevo_config.py     Fri Feb  2 19:39:45 2007
@@ -30,27 +30,6 @@
 # General freevo settings:
 # ======================================================================
 
-# MIXER SETTINGS
-MAJOR_AUDIO_CTRL    = 'VOL'           # Freevo takes control over audio ctrl
-                                      # 'VOL', 'PCM' 'OGAIN' etc.
-CONTROL_ALL_AUDIO   = 1               # Freevo takes complete control of audio
-MAX_VOLUME          = 90              # Set maximum volume level.
-DEFAULT_VOLUME      = 40              # Set default volume level.
-DEV_MIXER           = '/dev/mixer'    # mixer device 
-
-
-# shutdown plugin
-CONFIRM_SHUTDOWN    = 1               # ask before shutdown
-
-SHUTDOWN_SYS_CMD = 'shutdown -h now'  # set this to 'sudo shutdown -h now' if
-                                      # you don't have the permissions to
-                                      # shutdown
-RESTART_SYS_CMD  = 'shutdown -r now'  # like SHUTDOWN_SYS_CMD, only for reboot
-
-ENABLE_SHUTDOWN_SYS = 0  # Performs a whole system shutdown at SHUTDOWN!
-                         # For standalone boxes.
-
-
 #
 # You can add more keybindings by adding them to the correct hash. 
 # e.g. If you want to send 'contrast -100' to mplayer by pressing the '1' key, 
@@ -99,11 +78,18 @@
 plugin.activate('image', level=40)
 plugin.activate('shutdown', level=50)
 
-# FIXME: games is broken
-# if CONF.xmame or CONF.snes:
-#     plugin.activate('games', level=45)
+# shutdown plugin config
+SHUTDOWN_CONFIRM = True               # ask before shutdown
+SHUTDOWN_SYS_CMD = 'shutdown -h now'  # or 'sudo shutdown -h now'
+RESTART_SYS_CMD  = 'shutdown -r now'  # like SHUTDOWN_SYS_CMD, only for reboot
+SHUTDOWN_SYS_DEFAULT = False          # Performs a whole system shutdown at 
SHUTDOWN!
 
-# mixer
+# Audio Mixer
+MIXER_MAJOR_AUDIO_CTRL = 'VOL'            # 'VOL', 'PCM' 'OGAIN' etc.
+MIXER_CONTROL_ALL_AUDIO = True            # Freevo takes complete control of 
audio
+MIXER_MAX_VOLUME        = 90              # Set maximum volume level.
+MIXER_DEFAULT_VOLUME    = 40              # Set default volume level.
+MIXER_DEVICE            = '/dev/mixer'    # mixer device 
 plugin.activate('mixer')
 
 # delete file in menu
@@ -235,6 +221,12 @@
                  'mp4', 'viv', 'nuv', 'mov', 'iso',
                  'nsv', 'mkv', 'ts', 'rmvb', 'cue' ]
 
+#
+# Config for xml support in the movie browser
+# the regexp has to be with ([0-9]|[0-9][0-9]) so we can get the numbers
+#
+VIDEO_SHOW_REGEXP = "s?([0-9]|[0-9][0-9])[xe]([0-9]|[0-9][0-9])[^0-9]"
+
 
 # ======================================================================
 # Freevo audio settings:
@@ -323,48 +315,6 @@
 #
 IMAGEVIEWER_DURATION = 0
 
-
-# ======================================================================
-# Freevo games settings:
-# ======================================================================
-
-#
-# MAME is an emulator for old arcade video games. It supports almost
-# 2000 different games! The actual emulator is not included in Freevo,
-# you'll need to download and install it separately. The main MAME
-# website is at http://www.mame.net, but the version that is used here
-# is at http://x.mame.net since the regular MAME is for Windows.
-#
-# SNES stands for Super Nintendo Entertainment System. Freevo relies
-# on other programs that are not included in Freevo to play these games.
-# 
-# NEW GAMES SYSTEM :
-# =================
-# The GAMES_ITEMS structure is now build as follows :
-# <NAME>, <FOLDER>, (<TYPE>, <COMMAND_PATH>, <COMMAND_ARGS>, <IMAGE_PATH>, \
-# [<FILE_SUFFIX_FOR_GENERIC>])
-# where :
-#              - <TYPE> : Internal game types (MAME or SNES) or
-#                         generic one (GENERIC)
-#              - <COMMAND_PATH> : Emulator command
-#              - <COMMAND_ARGS> : Arguments for the emulator
-#              - <IMAGE_PATH>   : Optionnal path to the picture
-#              - <FILE_SUFFIX_FOR_GENERIC> : If the folder use the GENERIC
-#                                            type, then you must specify here
-#                                        the file suffix used by the emulator
-# GAMES_ITEMS = [ ('MAME', '/home/media/games/xmame/roms',     
-#                ('MAME', '/usr/local/bin/xmame.SDL', '-fullscreen -modenumber 
6', 
-#                 '/home/media/games/xmame/shots', None)),
-#               ('SUPER NINTENDO', '/home/media/games/snes/roms', 
-#                ('SNES', '/usr/local/bin/zsnes', '-m -r 3 -k 100 -cs -u', '', 
None )),
-#               ('Visual Boy Advance', '/home/media/games/vba/roms/',
-#                ('GENERIC', '/usr/local/vba/VisualBoyAdvance', ' ', '', [ 
'gba' ] )),
-#               ('MEGADRIVE', '/home/media/games/megadrive/roms', 
-#                ('GENESIS', '/usr/local/bin/generator-svgalib', '', '', '' )) 
]
-
-GAMES_ITEMS = None
-
-
 # ======================================================================
 # Freevo GUI settings:
 # ======================================================================
@@ -411,20 +361,6 @@
     GUI_OVERSCAN_Y = 50
     GUI_DISPLAY = 'sdl'
 
-if CONF.display == 'dxr3':
-    GUI_OVERSCAN_X = 65
-    GUI_OVERSCAN_Y = 45
-    GUI_DISPLAY = 'sdl'
-    
-#
-# Stop the osd before playing a movie with xine or mplayer. Some output
-# devices need this. After playback, the osd will be restored
-#
-GUI_STOP_WHEN_PLAYING = 0
-
-if CONF.display in ( 'directfb', 'dfbmga', 'dxr3', 'dga' ):
-    GUI_STOP_WHEN_PLAYING = 1
-
 #
 # Fade steps on application change.
 #
@@ -480,37 +416,5 @@
 #
 TV_RECORD_DIR = None
 
-TV_DATEFORMAT     = '%e-%b' # Day-Month: 11-Jun
-TV_TIMEFORMAT     = '%H:%M' # Hour-Minute 14:05
-TV_DATETIMEFORMAT = '%A %b %d %I:%M %p' # Thursday September 24 8:54 am
-
-# ======================================================================
-# Internal stuff, you shouldn't change anything here unless you know
-# what you are doing
-# ======================================================================
-
-#
-# Config for xml support in the movie browser
-# the regexp has to be with ([0-9]|[0-9][0-9]) so we can get the numbers
-#
-VIDEO_SHOW_REGEXP = "s?([0-9]|[0-9][0-9])[xe]([0-9]|[0-9][0-9])[^0-9]"
-
-#
-# XML TV Logo Location
-#
-# Use the "makelogos.py" script to download all the
-# Station logos into a directory. And then put the path
-# to those logos here
-#
-# FIXME: OS_CACHEDIR is gone
-if 0 and os.path.isdir(OS_CACHEDIR + '/xmltv/logos'):
-    TV_LOGOS = OS_CACHEDIR + '/xmltv/logos'
-else:
-    if not os.path.isdir('/tmp/freevo/xmltv/logos'):
-        os.makedirs('/tmp/freevo/xmltv/logos')
-    TV_LOGOS = '/tmp/freevo/xmltv/logos'
-
-#
-# catch errors
-#
-FREEVO_EVENTHANDLER_SANDBOX = 1
+TV_DATEFORMAT = '%e-%b' # Day-Month: 11-Jun
+TV_TIMEFORMAT = '%H:%M' # Hour-Minute 14:05

Modified: trunk/ui/src/application/handler.py
==============================================================================
--- trunk/ui/src/application/handler.py (original)
+++ trunk/ui/src/application/handler.py Fri Feb  2 19:39:45 2007
@@ -46,7 +46,6 @@
 import kaa.notifier
 
 # freevo imports
-from freevo.ui import config
 from freevo.ui.input import set_mapping
 from freevo.ui.event import *
 
@@ -227,20 +226,7 @@
 
         except Exception, e:
             log.exception('application.handler')
-            if config.FREEVO_EVENTHANDLER_SANDBOX:
-                msg=_('Event \'%s\' crashed\n\nPlease take a ' \
-                      'look at the logfile and report the bug to ' \
-                      'the Freevo mailing list. The state of '\
-                      'Freevo may be corrupt now and this error '\
-                      'could cause more errors until you restart '\
-                      'Freevo.') % event
-                handler = kaa.notifier.Callback(sys.exit, 0)
-                from window import ConfirmWindow
-                pop = ConfirmWindow(msg, (_('Shutdown'), _('Continue')))
-                pop.buttons[0].connect(sys.exit, 0)
-                pop.show()
-            else:
-                sys.exit(1)
+            sys.exit(1)
 
 # create the global object
 handler = Handler()

Modified: trunk/ui/src/config.py
==============================================================================
--- trunk/ui/src/config.py      (original)
+++ trunk/ui/src/config.py      Fri Feb  2 19:39:45 2007
@@ -75,7 +75,6 @@
 CONF.geometry = '800x600'
 CONF.display = 'x11'
 CONF.tv = 'ntsc'
-CONF.chanlist = 'us-cable'
 CONF.version = 0
 
 for dirname in freevo.conf.cfgfilepath:
@@ -110,16 +109,13 @@
 kaa.popcorn.config.save()
 
 w, h = CONF.geometry.split('x')
-CONF.width, CONF.height = int(w), int(h)
+GUI_WIDTH, GUI_HEIGHT = int(w), int(h)
 
 #
 # Read the environment set by the start script
 #
-SHARE_DIR = freevo.conf.SHAREDIR
-SKIN_DIR  = os.path.join(SHARE_DIR, 'skins')
-ICON_DIR  = os.path.join(SHARE_DIR, 'icons')
-IMAGE_DIR = os.path.join(SHARE_DIR, 'images')
-FONT_DIR  = os.path.join(SHARE_DIR, 'fonts')
+ICON_DIR  = os.path.join(freevo.conf.SHAREDIR, 'icons')
+IMAGE_DIR = os.path.join(freevo.conf.SHAREDIR, 'images')
 
 
 #
@@ -199,19 +195,6 @@
     GUI_FULLSCREEN = 1
 
 
-#
-# set default font
-#
-GUI_FONT_DEFAULT_NAME = os.path.join(FONT_DIR, GUI_FONT_DEFAULT_NAME)
-
-#
-# compile the regexp
-#
-VIDEO_SHOW_REGEXP_MATCH = re.compile("^.*" + VIDEO_SHOW_REGEXP).match
-VIDEO_SHOW_REGEXP_SPLIT = re.compile("[\.\- ]*" + \
-                                     VIDEO_SHOW_REGEXP + "[\.\- ]*").split
-
-
 # make sure USER and HOME are set
 os.environ['USER'] = pwd.getpwuid(os.getuid())[0]
 os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]

Modified: trunk/ui/src/gui/areas/tvlisting_area.py
==============================================================================
--- trunk/ui/src/gui/areas/tvlisting_area.py    (original)
+++ trunk/ui/src/gui/areas/tvlisting_area.py    Fri Feb  2 19:39:45 2007
@@ -251,19 +251,11 @@
                             r.height-2*r.size ]
 
 
-            channel_logo = None
-
-            channel_logo = config.TV_LOGOS + '/' + channel.name + '.png'
-            if os.path.isfile(channel_logo):
-                img = imagelib.load(channel_logo, (None, None))
-                i = self.drawimage(img, (logo_geo[0], logo_geo[1]))
-                self.chan_obj.append(i)
-            else:
-                self.chan_obj.append(self.drawstring(channel.name,
-                                                     label_val.font,
-                                                     settings, x=tx0, y=ty0,
-                                                     width=r.width+2*r.x,
-                                                     height=item_h))
+            self.chan_obj.append(self.drawstring(channel.name,
+                                                 label_val.font,
+                                                 settings, x=tx0, y=ty0,
+                                                 width=r.width+2*r.x,
+                                                 height=item_h))
 
             self.chan_obj.append(self.drawbox(tx0 + r.x, ty0 + r.y,
                                               r.width+1, item_h, r))

Modified: trunk/ui/src/gui/displays/__init__.py
==============================================================================
--- trunk/ui/src/gui/displays/__init__.py       (original)
+++ trunk/ui/src/gui/displays/__init__.py       Fri Feb  2 19:39:45 2007
@@ -58,7 +58,7 @@
     if display_stack:
         return display_stack[-1]
     exec('from %s import Display' % config.GUI_DISPLAY.lower())
-    size = (config.CONF.width, config.CONF.height)
+    size = (config.GUI_WIDTH, config.GUI_HEIGHT)
     display = Display(size, True)
     display_stack.append(display)
     animation.create(display)
@@ -147,7 +147,7 @@
         d.stop()
     # switch to none display
     from none import Display
-    size = (config.CONF.width, config.CONF.height)
+    size = (config.GUI_WIDTH, config.GUI_HEIGHT)
     display_stack = [ Display(size) ]
 
 

Modified: trunk/ui/src/gui/displays/display.py
==============================================================================
--- trunk/ui/src/gui/displays/display.py        (original)
+++ trunk/ui/src/gui/displays/display.py        Fri Feb  2 19:39:45 2007
@@ -49,19 +49,16 @@
     def hide(self):
         """
         Hide the output display. In most cases this does nothing since
-        a simple window doesn't matter. If GUI_STOP_WHEN_PLAYING the
-        ygame display will be shut down.
+        a simple window doesn't matter.
         """
-        if config.GUI_STOP_WHEN_PLAYING:
-            self.stop()
+        pass
 
 
     def show(self):
         """
         Show the output window again if it is not visible
         """
-        if config.GUI_STOP_WHEN_PLAYING:
-            self.restart()
+        pass
 
 
     def stop(self):

Modified: trunk/ui/src/gui/font.py
==============================================================================
--- trunk/ui/src/gui/font.py    (original)
+++ trunk/ui/src/gui/font.py    Fri Feb  2 19:39:45 2007
@@ -32,10 +32,13 @@
 __all__ = [ 'get' ]
 
 # python imports
+import os
 import logging
+
 import kaa.mevas
 
 # freevo imports
+import freevo.conf
 from freevo.ui import config
 
 # get logging object
@@ -98,12 +101,14 @@
                         print 'WARNING: No alternate found in the alias list!'
                         print 'Falling back to default font, this looks ugly'
                         font_warning.append(name)
-                    name = config.GUI_FONT_DEFAULT_NAME
+                    name = DEFAULT_FONT
                     return kaa.mevas.imagelib.load_font(name, ptsize)
 
 
 # init mevas font (imlib2)
-kaa.mevas.imagelib.add_font_path(config.FONT_DIR)
+FONT_DIR = os.path.join(freevo.conf.SHAREDIR, 'fonts')
+kaa.mevas.imagelib.add_font_path(FONT_DIR)
+DEFAULT_FONT = os.path.join(FONT_DIR, config.GUI_FONT_DEFAULT_NAME)
 
 # the font cache object for 'get'
 font_info_cache = {}

Modified: trunk/ui/src/gui/theme.py
==============================================================================
--- trunk/ui/src/gui/theme.py   (original)
+++ trunk/ui/src/gui/theme.py   Fri Feb  2 19:39:45 2007
@@ -1124,7 +1124,7 @@
         self.box_under_icon   = 0
 
         # load plugin skin files:
-        pdir = os.path.join(config.SHARE_DIR, 'skins/plugins')
+        pdir = os.path.join(freevo.conf.SHAREDIR, 'skins/plugins')
         if os.path.isdir(pdir):
             for p in util.match_files(pdir, [ 'fxd' ]):
                 self.load(p)
@@ -1332,10 +1332,10 @@
         if file_geometry:
             w, h = file_geometry.split('x')
         else:
-            w, h = config.CONF.width, config.CONF.height
+            w, h = config.GUI_WIDTH, config.GUI_HEIGHT
 
-        scale = (float(config.CONF.width-2*config.GUI_OVERSCAN_X)/float(w),
-                 float(config.CONF.height-2*config.GUI_OVERSCAN_Y)/float(h))
+        scale = (float(config.GUI_WIDTH-2*config.GUI_OVERSCAN_X)/float(w),
+                 float(config.GUI_HEIGHT-2*config.GUI_OVERSCAN_Y)/float(h))
 
         include = attr_str(node, 'include', '')
 
@@ -1387,16 +1387,16 @@
         """
         self.prepared = False
 
+        skin_dir = os.path.join(freevo.conf.SHAREDIR, 'skins')
         if not os.path.isfile(file):
             if os.path.isfile(file+".fxd"):
                 file += ".fxd"
 
-            elif os.path.isfile(os.path.join(config.SKIN_DIR, '%s/%s.fxd' % \
-                                     (file, file))):
-                file = os.path.join(config.SKIN_DIR, '%s/%s.fxd' % (file, 
file))
+            elif os.path.isfile(os.path.join(skin_dir, '%s/%s.fxd' % (file, 
file))):
+                file = os.path.join(skin_dir, '%s/%s.fxd' % (file, file))
 
             else:
-                file = os.path.join(config.SKIN_DIR, 'main/%s' % file)
+                file = os.path.join(skin_dir, 'main/%s' % file)
                 if os.path.isfile(file+".fxd"):
                     file += ".fxd"
 

Modified: trunk/ui/src/image/imageitem.py
==============================================================================
--- trunk/ui/src/image/imageitem.py     (original)
+++ trunk/ui/src/image/imageitem.py     Fri Feb  2 19:39:45 2007
@@ -62,14 +62,8 @@
                 return '%sx%s' % (self['width'], self['height'])
             return ''
 
-        if key == 'date':
-            try:
-                t = str(MediaItem.__getitem__(self, key))
-                if t:
-                    t = time.strptime(t, '%Y:%m:%d %H:%M:%S')
-                    return time.strftime(config.TV_DATETIMEFORMAT, t)
-            except:
-                pass
+        # if key == 'date':
+        # date could be time.strptime(t, '%Y:%m:%d %H:%M:%S')
 
         return MediaItem.__getitem__(self, key)
 

Modified: trunk/ui/src/plugins/mixer.py
==============================================================================
--- trunk/ui/src/plugins/mixer.py       (original)
+++ trunk/ui/src/plugins/mixer.py       Fri Feb  2 19:39:45 2007
@@ -8,41 +8,6 @@
 # Todo:        
 #
 # -----------------------------------------------------------------------
-# $Log$
-# Revision 1.23  2005/07/25 18:58:24  dischi
-# make it work with python 2.4
-#
-# Revision 1.22  2005/07/22 19:30:24  dischi
-# fix event handling
-#
-# Revision 1.21  2005/07/16 09:48:23  dischi
-# adjust to new event interface
-#
-# Revision 1.20  2005/06/09 19:43:53  dischi
-# clean up eventhandler usage
-#
-# Revision 1.19  2005/01/20 16:37:36  dischi
-# fix crash
-#
-# Revision 1.18  2004/11/20 18:23:03  dischi
-# use python logger module for debug
-#
-# Revision 1.17  2004/11/01 20:15:40  dischi
-# fix debug
-#
-# Revision 1.16  2004/10/21 12:32:22  dischi
-# fix variable type
-#
-# Revision 1.15  2004/07/26 18:10:18  dischi
-# move global event handling to eventhandler.py
-#
-# Revision 1.14  2004/07/10 12:33:40  dischi
-# header cleanup
-#
-# Revision 1.13  2004/01/02 14:03:32  dischi
-# use osd to display volume
-#
-# -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al. 
 # Please see the file doc/CREDITS for a complete list of authors.
@@ -97,11 +62,11 @@
         
         # If you're using ALSA or something and you don't set the mixer, why 
are
         # we trying to open it?
-        if config.DEV_MIXER:    
+        if config.MIXER_DEVICE:    
             try:
-                self.mixfd = open(config.DEV_MIXER, 'r')
+                self.mixfd = open(config.MIXER_DEVICE, 'r')
             except IOError:
-                log.error('Couldn\'t open mixer %s' % config.DEV_MIXER)
+                log.error('Couldn\'t open mixer %s' % config.MIXER_DEVICE)
                 return
 
         plugin.Plugin.__init__(self, 'MIXER')
@@ -125,24 +90,24 @@
                     log.error('IOError for ioctl')
                     pass
                 
-        if config.MAJOR_AUDIO_CTRL == 'VOL':
-            self.setMainVolume(config.DEFAULT_VOLUME)
-            if config.CONTROL_ALL_AUDIO:
-                self.setPcmVolume(config.MAX_VOLUME)
+        if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
+            self.setMainVolume(config.MIXER_DEFAULT_VOLUME)
+            if config.MIXER_CONTROL_ALL_AUDIO:
+                self.setPcmVolume(config.MIXER_MAX_VOLUME)
                 # XXX This is for SB Live cards should do nothing to others
                 # XXX Please tell if you have problems with this.
-                self.setOgainVolume(config.MAX_VOLUME)
-        elif config.MAJOR_AUDIO_CTRL == 'PCM':
-            self.setPcmVolume(config.DEFAULT_VOLUME)
-            if config.CONTROL_ALL_AUDIO:
-                self.setMainVolume(config.MAX_VOLUME)
+                self.setOgainVolume(config.MIXER_MAX_VOLUME)
+        elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
+            self.setPcmVolume(config.MIXER_DEFAULT_VOLUME)
+            if config.MIXER_CONTROL_ALL_AUDIO:
+                self.setMainVolume(config.MIXER_MAX_VOLUME)
                 # XXX This is for SB Live cards should do nothing to others
                 # XXX Please tell if you have problems with this.
-                self.setOgainVolume(config.MAX_VOLUME)
+                self.setOgainVolume(config.MIXER_MAX_VOLUME)
         else:
             log.warning("No appropriate audio channel found for mixer")
 
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.setLineinVolume(0)
             self.setMicVolume(0)
 
@@ -152,19 +117,19 @@
         eventhandler to handle the VOL events
         """
         if event == MIXER_VOLUP:
-            if config.MAJOR_AUDIO_CTRL == 'VOL':
+            if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
                 self.incMainVolume(event.arg)
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
-            elif config.MAJOR_AUDIO_CTRL == 'PCM':
+            elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
                 self.incPcmVolume(event.arg)
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
             return True
         
         elif event == MIXER_VOLDOWN:
-            if( config.MAJOR_AUDIO_CTRL == 'VOL' ):
+            if( config.MIXER_MAJOR_AUDIO_CTRL == 'VOL' ):
                 self.decMainVolume(event.arg)
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
-            elif( config.MAJOR_AUDIO_CTRL == 'PCM' ):
+            elif( config.MIXER_MAJOR_AUDIO_CTRL == 'PCM' ):
                 self.decPcmVolume(event.arg)
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
             return True
@@ -207,9 +172,9 @@
             self._setVolume(self.SOUND_MIXER_WRITE_VOLUME, self.mainVolume)
 
     def getVolume(self):
-        if config.MAJOR_AUDIO_CTRL == 'VOL':
+        if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
             return self.mainVolume
-        elif config.MAJOR_AUDIO_CTRL == 'PCM':
+        elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
             return self.pcmVolume
         
     def getMainVolume(self):
@@ -251,7 +216,7 @@
         self._setVolume( self.SOUND_MIXER_WRITE_PCM, self.pcmVolume )
     
     def setLineinVolume(self, volume):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.lineinVolume = volume
             self._setVolume(self.SOUND_MIXER_WRITE_LINE, volume)
 
@@ -259,13 +224,13 @@
         return self.lineinVolume
        
     def setMicVolume(self, volume):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.micVolume = volume
             self._setVolume(self.SOUND_MIXER_WRITE_MIC, volume)
 
     def setIgainVolume(self, volume):
         """For Igain (input from TV etc) on emu10k cards"""
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             if volume > 100:
                 volume = 100 
             elif volume < 0:
@@ -298,12 +263,12 @@
         os.system('aumix -o%s > /dev/null 2>&1' % volume)
 
     def reset(self):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.setLineinVolume(0)
             self.setMicVolume(0)
-            if config.MAJOR_AUDIO_CTRL == 'VOL':
-                self.setPcmVolume(config.MAX_VOLUME)
-            elif config.MAJOR_AUDIO_CTRL == 'PCM':
-                self.setMainVolume(config.MAX_VOLUME)
+            if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
+                self.setPcmVolume(config.MIXER_MAX_VOLUME)
+            elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
+                self.setMainVolume(config.MIXER_MAX_VOLUME)
 
         self.setIgainVolume(0) # SB Live input from TV Card.

Modified: trunk/ui/src/plugins/ossmixer.py
==============================================================================
--- trunk/ui/src/plugins/ossmixer.py    (original)
+++ trunk/ui/src/plugins/ossmixer.py    Fri Feb  2 19:39:45 2007
@@ -17,41 +17,6 @@
 # plugin.remove('mixer')
 # plugin.activate('ossmixer')
 #
-#
-# Todo:        
-#
-# -----------------------------------------------------------------------
-# $Log$
-# Revision 1.16  2005/07/22 19:30:24  dischi
-# fix event handling
-#
-# Revision 1.15  2005/07/16 09:48:23  dischi
-# adjust to new event interface
-#
-# Revision 1.14  2005/06/09 19:43:53  dischi
-# clean up eventhandler usage
-#
-# Revision 1.13  2005/01/20 16:37:36  dischi
-# fix crash
-#
-# Revision 1.12  2004/11/20 18:23:03  dischi
-# use python logger module for debug
-#
-# Revision 1.11  2004/11/01 20:15:40  dischi
-# fix debug
-#
-# Revision 1.10  2004/10/21 12:32:22  dischi
-# fix variable type
-#
-# Revision 1.9  2004/07/26 18:10:18  dischi
-# move global event handling to eventhandler.py
-#
-# Revision 1.8  2004/07/10 12:33:40  dischi
-# header cleanup
-#
-# Revision 1.7  2004/01/02 14:03:32  dischi
-# use osd to display volume
-#
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al. 
@@ -100,11 +65,11 @@
         
         # If you're using ALSA or something and you don't set the mixer, why 
are
         # we trying to open it?
-        if config.DEV_MIXER:    
+        if config.MIXER_DEVICE:    
             try:
-                self.mixfd = ossaudiodev.openmixer() #open(config.DEV_MIXER, 
'r')
+                self.mixfd = ossaudiodev.openmixer() 
#open(config.MIXER_DEVICE, 'r')
             except IOError:
-                log.error('Couldn\'t open mixer %s' % config.DEV_MIXER)
+                log.error('Couldn\'t open mixer %s' % config.MIXER_DEVICE)
                 return
 
         plugin.Plugin.__init__(self, 'MIXER')
@@ -120,20 +85,20 @@
             self.igainVolume  = 0 
             self.ogainVolume  = 0
 
-        if config.MAJOR_AUDIO_CTRL == 'VOL':
-            self.setMainVolume(config.DEFAULT_VOLUME)
-            if config.CONTROL_ALL_AUDIO:
-                self.setPcmVolume(config.MAX_VOLUME)
-                self.setOgainVolume(config.MAX_VOLUME)
-        elif config.MAJOR_AUDIO_CTRL == 'PCM':
-            self.setPcmVolume(config.DEFAULT_VOLUME)
-            if config.CONTROL_ALL_AUDIO:
-                self.setMainVolume(config.MAX_VOLUME)
-                self.setOgainVolume(config.MAX_VOLUME)
+        if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
+            self.setMainVolume(config.MIXER_DEFAULT_VOLUME)
+            if config.MIXER_CONTROL_ALL_AUDIO:
+                self.setPcmVolume(config.MIXER_MAX_VOLUME)
+                self.setOgainVolume(config.MIXER_MAX_VOLUME)
+        elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
+            self.setPcmVolume(config.MIXER_DEFAULT_VOLUME)
+            if config.MIXER_CONTROL_ALL_AUDIO:
+                self.setMainVolume(config.MIXER_MAX_VOLUME)
+                self.setOgainVolume(config.MIXER_MAX_VOLUME)
         else:
             log.warning("No appropriate audio channel found for mixer")
 
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.setLineinVolume(0)
             self.setMicVolume(0)
 
@@ -144,19 +109,19 @@
         """
         # Handle volume control
         if event == MIXER_VOLUP:
-            if config.MAJOR_AUDIO_CTRL == 'VOL':
+            if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
                 self.incMainVolume()
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
-            elif config.MAJOR_AUDIO_CTRL == 'PCM':
+            elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
                 self.incPcmVolume()
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
             return True
         
         elif event == MIXER_VOLDOWN:
-            if config.MAJOR_AUDIO_CTRL == 'VOL':
+            if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
                 self.decMainVolume()
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
-            elif config.MAJOR_AUDIO_CTRL == 'PCM':
+            elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
                 self.decPcmVolume()
                 OSD_MESSAGE.post(_('Volume: %s%%') % self.getVolume())
             return True
@@ -193,9 +158,9 @@
             self._setVolume(ossaudiodev.SOUND_MIXER_VOLUME, self.mainVolume)
 
     def getVolume(self):
-        if config.MAJOR_AUDIO_CTRL == 'VOL':
+        if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
             return self.mainVolume
-        elif config.MAJOR_AUDIO_CTRL == 'PCM':
+        elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
             return self.pcmVolume
         
     def getMainVolume(self):
@@ -237,7 +202,7 @@
         self._setVolume( ossaudiodev.SOUND_MIXER_PCM, self.pcmVolume )
     
     def setLineinVolume(self, volume):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.lineinVolume = volume
             self._setVolume(ossaudiodev.SOUND_MIXER_LINE, volume)
 
@@ -245,12 +210,12 @@
         return self.lineinVolume
        
     def setMicVolume(self, volume):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.micVolume = volume
             self._setVolume(ossaudiodev.SOUND_MIXER_MIC, volume)
 
     def setIgainVolume(self, volume):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             if volume > 100:
                 volume = 100 
             elif volume < 0:
@@ -281,12 +246,12 @@
         self._setVolume(ossaudiodev.SOUND_MIXER_IGAIN, volume)
 
     def reset(self):
-        if config.CONTROL_ALL_AUDIO:
+        if config.MIXER_CONTROL_ALL_AUDIO:
             self.setLineinVolume(0)
             self.setMicVolume(0)
-            if config.MAJOR_AUDIO_CTRL == 'VOL':
-                self.setPcmVolume(config.MAX_VOLUME)
-            elif config.MAJOR_AUDIO_CTRL == 'PCM':
-                self.setMainVolume(config.MAX_VOLUME)
+            if config.MIXER_MAJOR_AUDIO_CTRL == 'VOL':
+                self.setPcmVolume(config.MIXER_MAX_VOLUME)
+            elif config.MIXER_MAJOR_AUDIO_CTRL == 'PCM':
+                self.setMainVolume(config.MIXER_MAX_VOLUME)
 
         self.setIgainVolume(0) # SB Live input from TV Card.

Modified: trunk/ui/src/plugins/shutdown.py
==============================================================================
--- trunk/ui/src/plugins/shutdown.py    (original)
+++ trunk/ui/src/plugins/shutdown.py    Fri Feb  2 19:39:45 2007
@@ -58,7 +58,7 @@
         """
         return a list of actions for this item
         """
-        if config.CONFIRM_SHUTDOWN:
+        if config.SHUTDOWN_CONFIRM:
             items = [ Action(_('Shutdown Freevo'), self.confirm_freevo),
                       Action(_('Shutdown system'), self.confirm_system),
                       Action(_('Restart Freevo'), self.confirm_freevo_restart),
@@ -69,7 +69,7 @@
                       Action(_('Restart Freevo'), 
self.shutdown_freevo_restart),
                       Action(_('Restart system'), self.shutdown_sys_restart) ]
 
-        if config.ENABLE_SHUTDOWN_SYS:
+        if config.SHUTDOWN_SYS_DEFAULT:
             items = [ items[1], items[0], items[2] ]
 
         return items

Modified: trunk/ui/src/setup.py
==============================================================================
--- trunk/ui/src/setup.py       (original)
+++ trunk/ui/src/setup.py       Fri Feb  2 19:39:45 2007
@@ -88,22 +88,15 @@
                                   WIDTHxHEIGHT can be 800x600, 768x576 or 
640x480
 
    --display=DISP               set the display
-                                  DISP can be x11, fbdev, dxr3, mga, 
-                                  directfb, dfbmga or dga
+                                  DISP can be x11, fbdev, mga, 
+                                  directfb or dfbmga
                                   
    --tv=NORM                    set the TV standard
                                   NORM can be ntsc, pal or secam
 
-   --chanlist=LIST              set the channel list
-                                  LIST can be us-bcast, us-cable, us-cable-hrc,
-                                  japan-bcast, japan-cable, europe-west,
-                                  europe-east, italy, newzealand, australia,
-                                  ireland, france, china-bcast, southafrica,
-                                  argentina, canada-cable
-
    --help                       display this help and exit
 
-The default is "--geometry=800x600 --display=x11 --tv=ntsc --chanlist=us-cable"
+The default is "--geometry=800x600 --display=x11 --tv=ntsc"
 Please report bugs to <[email protected]>.
 ''')
 
@@ -127,13 +120,8 @@
 
 def check_config(conf):
     vals_geometry = ['800x600', '768x576', '640x480']
-    vals_display = ['x11', 'fbdev', 'directfb', 'dfbmga', 'mga', 'dxr3', 'dga']
+    vals_display = ['x11', 'fbdev', 'directfb', 'dfbmga', 'mga']
     vals_tv = ['ntsc', 'pal', 'secam']
-    vals_chanlist = ['us-bcast', 'us-cable', 'us-cable-hrc',
-                     'japan-bcast', 'japan-cable', 'europe-west',
-                     'europe-east', 'italy', 'newzealand', 'australia',
-                     'ireland', 'france', 'china-bcast', 'southafrica',
-                     'argentina', 'canada-cable']
 
     if not conf.geometry in vals_geometry:
         print 'geometry must be one of: %s' % ' '.join(vals_geometry)
@@ -147,10 +135,6 @@
         print 'tv must be one of: %s' % ' '.join(vals_tv)
         sys.exit(1)
         
-    if not conf.chanlist in vals_chanlist:
-        print 'chanlist must be one of: %s' % ' '.join(vals_chanlist)
-        sys.exit(1)
-        
 
 def create_config(conf):
     
@@ -212,12 +196,11 @@
     conf.geometry = '800x600'
     conf.display = 'x11'
     conf.tv = 'ntsc'
-    conf.chanlist = 'us-cable'
     conf.version = CONFIG_VERSION
 
     # Parse commandline options
     try:
-        long_opts = 'help compile= geometry= display= tv= chanlist= '.split()
+        long_opts = 'help compile= geometry= display= tv= '.split()
         opts, args = getopt.getopt(sys.argv[2:], 'h', long_opts)
     except getopt.GetoptError:
         # print help information and exit:
@@ -238,9 +221,6 @@
         if o == '--tv':
             conf.tv = a
 
-        if o == '--chanlist':
-            conf.chanlist = a
-
 
     for program, valname, needed in EXTERNAL_PROGRAMS:
         check_program(conf, program, valname, needed)
@@ -260,7 +240,6 @@
     print '  %20s = %s' % ('geometry', conf.geometry)
     print '  %20s = %s' % ('display', conf.display)
     print '  %20s = %s' % ('tv', conf.tv)
-    print '  %20s = %s' % ('chanlist', conf.chanlist)
 
 
     # Build everything

Modified: trunk/ui/src/video/videoitem.py
==============================================================================
--- trunk/ui/src/video/videoitem.py     (original)
+++ trunk/ui/src/video/videoitem.py     Fri Feb  2 19:39:45 2007
@@ -41,6 +41,7 @@
 import os
 import copy
 import logging
+import re
 
 # kaa imports
 from kaa.strutils import unicode_to_str, str_to_unicode
@@ -62,6 +63,11 @@
 # get logging object
 log = logging.getLogger('video')
 
+# compile VIDEO_SHOW_REGEXP
+regexp = config.VIDEO_SHOW_REGEXP
+VIDEO_SHOW_REGEXP_MATCH = re.compile("^.*" + regexp).match
+VIDEO_SHOW_REGEXP_SPLIT = re.compile("[\.\- ]*" + regexp + "[\.\- ]*").split
+
 class VideoItem(MediaItem):
     def __init__(self, url, parent):
         MediaItem.__init__(self, parent, type='video')
@@ -102,10 +108,9 @@
                          self.info['subtitle'])
             self.sort_name += u' ' + self.info['episode'] + u' ' + \
                               self.info['subtitle']
-        elif config.VIDEO_SHOW_REGEXP_MATCH(self.name) and not \
-                 self.network_play:
+        elif VIDEO_SHOW_REGEXP_MATCH(self.name) and not self.network_play:
             # split tv show files based on regexp
-            show_name = config.VIDEO_SHOW_REGEXP_SPLIT(self.name)
+            show_name = VIDEO_SHOW_REGEXP_SPLIT(self.name)
             if show_name[0] and show_name[1] and show_name[2] and show_name[3]:
                 self.name = show_name[0] + u" " + show_name[1] + u"x" + \
                             show_name[2] + u" - " + show_name[3]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to