Author: dmeyer
Date: Sat Oct 28 11:20:18 2006
New Revision: 1933

Added:
   trunk/popcorn/src/config.py
Modified:
   trunk/popcorn/src/backends/base.py
   trunk/popcorn/src/backends/mplayer/player.py
   trunk/popcorn/src/generic.py

Log:
add config class

Modified: trunk/popcorn/src/backends/base.py
==============================================================================
--- trunk/popcorn/src/backends/base.py  (original)
+++ trunk/popcorn/src/backends/base.py  Sat Oct 28 11:20:18 2006
@@ -71,7 +71,8 @@
         self._state_object = STATE_IDLE
         self._window = None
         self._size = None
-
+        self._config = None
+        
 
     def get_capabilities(self):
         """
@@ -97,6 +98,15 @@
         return sets.Set(cap).issubset(sets.Set(supported_caps))
 
 
+    # config setting
+
+    def set_config(self, config):
+        """
+        Set config object.
+        """
+        self._config = config
+
+        
     # state handling
 
     def get_state(self):

Modified: trunk/popcorn/src/backends/mplayer/player.py
==============================================================================
--- trunk/popcorn/src/backends/mplayer/player.py        (original)
+++ trunk/popcorn/src/backends/mplayer/player.py        Sat Oct 28 11:20:18 2006
@@ -399,6 +399,9 @@
                 "-display", self._window.get_display().get_string(),
                 "-input", "conf=%s" % keyfile))
 
+        # FIXME, add more settings here
+        args += [ '-ao', self._config.audio.driver ]
+        
         if self._file_args:
             if isinstance(self._file_args, str):
                 args.extend(self._file_args.split(' '))

Added: trunk/popcorn/src/config.py
==============================================================================
--- (empty file)
+++ trunk/popcorn/src/config.py Sat Oct 28 11:20:18 2006
@@ -0,0 +1,23 @@
+import os
+import sys
+import gettext
+from kaa.config import Var, Group, Dict, List, Config
+
+path = os.path.normpath(
+    os.path.join(os.path.dirname(__file__), '../../../../share/locale'))
+i18n = gettext.translation('kaa.popcorn', path, fallback=True).ugettext
+
+config = Config(desc=i18n('Player configuration'), schema=[
+
+    # audio group
+    Group(name='audio', desc=i18n('Audio settings'), schema=[
+    Var(name='driver', type=('alsa', 'oss'), default='alsa',
+        desc=i18n('audio driver (alsa or oss)')),
+    Var(name='device', default='auto',
+        desc=i18n('audio device')),
+    Var(name='channels', type=('auto', 2, 4, 5, 6), default='auto',
+        desc=i18n('number of channels (auto, 2, 4, 5 or 6)')),
+    Var(name='spdif', default=False,
+        desc=i18n('digital out'))
+    ])
+    ])

Modified: trunk/popcorn/src/generic.py
==============================================================================
--- trunk/popcorn/src/generic.py        (original)
+++ trunk/popcorn/src/generic.py        Sat Oct 28 11:20:18 2006
@@ -38,6 +38,7 @@
 import kaa.notifier
 
 # kaa.popcorn imports
+from config import config as default_config
 from ptypes import *
 from backends.manager import get_player_class, get_all_players
 
@@ -73,12 +74,13 @@
     Generic player. On object of this class will use the players from the
     backend subdirectory for playback.
     """
-    def __init__(self, window):
+    def __init__(self, window, config=default_config):
 
         self._player = None
         self._size = window.get_size()
         self._window = window
-
+        self._config = config
+        
         self.signals = {
 
             # signals created by this class
@@ -180,6 +182,7 @@
         The real open function called from 'open'.
         """
         log.info('open')
+        self._player.set_config(self._config)
         self._player.open(mrl)
         self._player.set_window(self._window)
         self._player.set_size(self._size)

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