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

Guillaume Chereau (none) charlie at nikopol.
Sat Aug 23 14:06:16 UTC 2008


The following commit has been merged in the master branch:
commit cd932f106c7305985119d5cd0db4e72eb3124eb0
Author: Guillaume Chereau <charlie at nikopol.(none)>
Date:   Thu Aug 14 16:40:11 2008 +0800

    [oeventsd] Forgot to add a file in previous commit

diff --git a/framework/subsystems/oeventsd/ring_tone_action.py b/framework/subsystems/oeventsd/ring_tone_action.py
new file mode 100644
index 0000000..59e4a30
--- /dev/null
+++ b/framework/subsystems/oeventsd/ring_tone_action.py
@@ -0,0 +1,35 @@
+
+from action import Action, AudioAction, VibratorAction
+import dbus
+import os
+
+import logging
+logger = logging.getLogger('oeventsd')
+
+from framework.subsystems.opreferencesd import PreferencesManager
+
+class RingToneAction(Action):
+    def __init__(self, cmd = 'play'):
+        self.cmd = cmd
+    def __call__(self, **kargs):
+        logger.info("RingToneAction %s", self.cmd)
+        
+        # First we need to get the ring-tone music :
+        # TODO: as soon as we have some sort of global get_object('Preferences')
+        #       method we should use it instead of PreferencesManager.singleton
+        prefs = PreferencesManager.singleton
+        phone_prefs = prefs.GetService('phone')
+        ring_tone = phone_prefs.GetValue('ring-tone')
+        ring_volume = phone_prefs.GetValue('ring-volume')
+        sound_path = os.path.join("/usr/share/sounds/", ring_tone)
+        
+        if self.cmd == 'play':
+            logger.info("Start ringing : tone=%s, volume=%s", ring_tone, ring_volume)
+            AudioAction(sound_path, 'play')()
+            VibratorAction(action='start')()
+        else:
+            logger.info("Stop ringing : tone=%s, volume=%s", ring_tone, ring_volume)
+            AudioAction(sound_path, 'stop')()
+            VibratorAction(action='stop')()
+    def __repr__(self):
+        return "RingToneAction(%s)" % self.cmd

-- 
framworkd debian packageing



More information about the pkg-fso-commits mailing list