[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Michael 'Mickey' Lauer mickey at vanille-media.de
Mon Feb 2 18:51:19 UTC 2009


The following commit has been merged in the master branch:
commit 13f6f1ab7a7e585f3d28f7cb33404b7688291efe
Author: Tobias Gruetzmacher <tobias-git at 23.gs>
Date:   Sun Nov 9 19:58:03 2008 +0100

    Add support for audio file options.
    
    Options can be appended to audio file names, seperated via semicolons.
    As an example, the ringtone now plays a different tune from the defaul
    SID file.

diff --git a/etc/freesmartphone/opreferences/conf/phone/default.yaml b/etc/freesmartphone/opreferences/conf/phone/default.yaml
index 3ca9c1d..81ae4f0 100644
--- a/etc/freesmartphone/opreferences/conf/phone/default.yaml
+++ b/etc/freesmartphone/opreferences/conf/phone/default.yaml
@@ -1,6 +1,6 @@
 
 
-ring-tone: "Arkanoid_PSID.sid"
+ring-tone: "Arkanoid_PSID.sid;tune=2"
 ring-volume: 10
 
 message-tone: "notify_message.mp3"
diff --git a/framework/subsystems/odeviced/audio.py b/framework/subsystems/odeviced/audio.py
index 4ff668d..9763d2b 100644
--- a/framework/subsystems/odeviced/audio.py
+++ b/framework/subsystems/odeviced/audio.py
@@ -192,16 +192,24 @@ class GStreamerPlayer( Player ):
         if name in self.pipelines:
             error_cb( AlreadyPlaying( name ) )
         else:
+            # Split options from filename, these may be useful for advanced
+            # settings on MOD and SID files.
+            base, ext = name.rsplit( '.', 1 )
+            options = ext.split( ';' )
+            ext = options.pop( 0 )
+            file = ".".join( [ base, ext ] )
             try:
-                decoder = GStreamerPlayer.decoderMap[ name.split( '.' )[-1] ]
+                decoder = GStreamerPlayer.decoderMap[ ext ]
             except KeyError:
                 return error_cb( UnknownFormat( "Known formats are %s" % self.decoderMap.keys() ) )
             else:
+                if len(options) > 0:
+                    decoder = decoder + " " + " ".join( options )
                 # parse_launch may burn a few cycles compared to element_factory_make,
                 # however it should still be faster than creating the pipeline from
                 # individual elements in python, since it's all happening in compiled code
                 try:
-                    pipeline = gst.parse_launch( "filesrc location=%s ! %s ! alsasink" % ( name, decoder ) )
+                    pipeline = gst.parse_launch( "filesrc location=%s ! %s ! alsasink" % ( file, decoder ) )
                 except gobject.GError, e:
                     logger.exception( "could not instanciate pipeline: %s" % e )
                     return error_cb( PlayerError( "Could not instanciate pipeline due to an internal error." ) )

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list