[pkg-fso-commits] [SCM] framworkd debian packageing branch, master, updated. milestone2-110-g76700a0

Michael 'Mickey' Lauer mickey at vanille-media.de
Tue Sep 2 10:34:56 UTC 2008


The following commit has been merged in the master branch:
commit 99c8433e0069eceb03497b09ea85bf609cd625fe
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Sun Aug 24 19:19:55 2008 +0200

    oevents: Push/Pull Scenario idea didn't work out, we need to save state between rule invocations for that.
    Went back to fixed SetScenario (same as we did in oeventd for ms2) for now until we can discuss more.

diff --git a/etc/freesmartphone/oevents/rules.yaml b/etc/freesmartphone/oevents/rules.yaml
index f579b89..0f81e16 100644
--- a/etc/freesmartphone/oevents/rules.yaml
+++ b/etc/freesmartphone/oevents/rules.yaml
@@ -14,6 +14,7 @@
 # - Not(filter)             : create a neg filter
 # - PlaySound(file)         : Action that starts to play an audio file
 # - StopSound(file)         : Action that stop an audio file
+# - SetScenario(name)       : Action that sets an audio scenario
 # - StartVibration
 # - StopVibration
 # - RingTone(cmd)           : cmd can be 'start' or 'stop'
@@ -34,9 +35,10 @@
 -
     trigger: CallStatus()
     filters: HasAttr(status, "active")
-    actions: PushScenario()
+    actions: SetScenario(gsmhandset)
 -
     trigger: CallStatus()
     filters: HasAttr(status, "release"))
-    actions: PullScenario()
+    actions: SetScenario(stereoout)
 -
+
diff --git a/framework/subsystems/oeventsd/action.py b/framework/subsystems/oeventsd/action.py
index fd42e98..5847385 100644
--- a/framework/subsystems/oeventsd/action.py
+++ b/framework/subsystems/oeventsd/action.py
@@ -88,13 +88,13 @@ class AudioAction(DBusAction):
     """
     A dbus action on the freesmartphone audio device
     """
-    def __init__(self, file = None, action = 'play'):
+    def __init__(self, scenario = None, action = 'play'):
         bus = dbus.SystemBus()
         service = 'org.freesmartphone.odeviced'
         obj = '/org/freesmartphone/Device/Audio'
         interface = 'org.freesmartphone.Device.Audio'
         method = 'PlaySound' if action == 'play' else 'StopSound'
-        super(AudioAction, self).__init__(bus, service, obj, interface, method, file)
+        super(AudioAction, self).__init__(bus, service, obj, interface, method, scenario)
 
 #============================================================================#
 class AudioScenarioAction(DBusAction):
@@ -102,16 +102,16 @@ class AudioScenarioAction(DBusAction):
     """
     A dbus action on the freesmartphone audio device
     """
-    def __init__(self, file = None, action = 'push' ):
+    def __init__(self, scenario = None, action = 'set' ):
         bus = dbus.SystemBus()
         service = 'org.freesmartphone.odeviced'
         obj = '/org/freesmartphone/Device/Audio'
         interface = 'org.freesmartphone.Device.Audio'
-        if action == 'push':
+        if action == 'set':
             # FIXME gsmhandset ugly ugly hardcoded
-            super(AudioScenarioAction, self).__init__(bus, service, obj, interface, "PushScenario", "gsmhandset")
+            super(AudioScenarioAction, self).__init__(bus, service, obj, interface, "SetScenario", scenario)
         else:
-            super(AudioScenarioAction, self).__init__(bus, service, obj, interface, "PullScenario" )
+            logger.error( "unhandled action for Audio scenario" )
 
 #============================================================================#
 class VibratorAction(DBusAction):
diff --git a/framework/subsystems/oeventsd/parser.py b/framework/subsystems/oeventsd/parser.py
index 1742729..f8151dc 100644
--- a/framework/subsystems/oeventsd/parser.py
+++ b/framework/subsystems/oeventsd/parser.py
@@ -90,15 +90,10 @@ class StopSound(Function):
     def __call__(self, file):
         return AudioAction(file, 'stop')
 
-class PushScenario(Function):
-    name = 'PushScenario'
-    def __call__(self):
-        return AudioScenarioAction(file, 'push')
-
-class PullScenario(Function):
-    name = 'PullScenario'
-    def __call__(self):
-        return AudioScenarioAction(file, 'pull')
+class SetScenario(Function):
+    name = 'SetScenario'
+    def __call__(self, scenario):
+        return AudioScenarioAction(scenario)
 
 class RingTone(Function):
     name = 'RingTone'
@@ -125,12 +120,12 @@ class HasAttr(Function):
     def __call__(self, name, value):
         kargs = {name:value}
         return AttributeFilter(**kargs)
-        
+
 class Debug(Function):
     name = 'Debug'
     def __call__(self, msg):
         return DebugAction(msg)
-        
+
 class Time(Function):
     name = 'Time'
     def __call__(self, hour, minute):

-- 
framworkd debian packageing



More information about the pkg-fso-commits mailing list