Please mark a bug as Resolved/Fixed if you have a sr submitted to MeeGo OBS. 

Peter

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of fbarthesx
> Sent: Thursday, January 06, 2011 12:38 AM
> To: [email protected]
> Subject: [meego-commits] 11489: Changes to
> Trunk:Testing/monitor-call-audio-setting-mid
> 
> Hi,
> I have made the following changes to monitor-call-audio-setting-mid in project
> Trunk:Testing. Please review and accept ASAP.
> 
> Thank You,
> fbarthesx
> 
> [This message was auto-generated]
> 
> ---
> 
> Request #11489:
> 
>   submit:
> home:fbarthesx:branches:Trunk:Testing/monitor-call-audio-setting-mid(r2)(cle
> anup) -> Trunk:Testing/monitor-call-audio-setting-mid
> 
> 
> Message:
>     Rework of previous commit for use it with new pulseaudio based on
> PA-0.9.19 (BMC #11989)
> 
> State:   new          2011-01-05T08:37:54 fbarthesx
> Comment: None
> 
> 
> 
> changes files:
> --------------
> --- monitor-call-audio-setting-mid.changes
> +++ monitor-call-audio-setting-mid.changes
> @@ -0,0 +1,3 @@
> +* Wed Jan 05 2011 Mael Pouessel <[email protected]> 1.2
> +- Rework of previous commit for use it with new pulseaudio based on
> PA-0.9.19 (BMC #11989)
> +
> 
> new:
> ----
>   0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
> 
> spec files:
> -----------
> --- monitor-call-audio-setting-mid.spec
> +++ monitor-call-audio-setting-mid.spec
> @@ -1,11 +1,12 @@
>  Name:       monitor-call-audio-setting-mid
>  Summary:    Monitor Call Audio Settings
>  Version:    1.0
> -Release:    2
> +Release:    3
>  Group:      Applications/System
>  License:    GPLv2
>  Source0:    %{name}-%{version}.tar.bz2
>  Patch0:
> 0001-DBUS-signal-from-PropertyChanged-of-org.ofono.VoiceC.patch
> +Patch1:
> 0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
>  Requires:   pulseaudio
>  Requires:   python
>  Requires:   dbus-python
> @@ -23,6 +24,8 @@
> 
>  # 0001-DBUS-signal-from-PropertyChanged-of-org.ofono.VoiceC.patch
>  %patch0 -p1
> +# 0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
> +%patch1 -p1
> 
>  %build
> 
> @@ -30,7 +33,12 @@
>  rm -rf %{buildroot}
> 
>  mkdir -p %{buildroot}/usr/bin
> +mkdir -p %{buildroot}/etc/dbus-1/system.d
> +
>  install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/monitor-call-audio-setting-mid %{buildr
> oot}/usr/bin
> +install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/test_interface_bridge.py %{buildroot}/
> usr/bin
> +install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/interface.conf %{buildroot}/etc/dbus-1
> /system.d
> +
>  mkdir -p %{buildroot}/etc/xdg/autostart
>  cp -a
> $RPM_BUILD_DIR/%{name}-%{version}/monitor-call-audio-setting-mid.desktop
>  %{buildroot}/etc/xdg/autostart
> 
> @@ -41,6 +49,8 @@
>  %files
>  %defattr(-,root,root,-)
>  /usr/bin/monitor-call-audio-setting-mid
> +/usr/bin/test_interface_bridge.py
> +/etc/dbus-1/system.d/interface.conf
>  %config /etc/xdg/autostart/monitor-call-audio-setting-mid.desktop
> 
> -
> +%changelog
> 
> other changes:
> --------------
> 
> ++++++ 0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
> (new)
> --- 0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
> +++ 0002-Rework-of-DBUS-signal-as-trigger-for-PA-voice-Module.patch
> +From f68f1f83e34650aa12e5ab40e43658e2bccf35b3 Mon Sep 17 00:00:00
> 2001
> +From: Fabien Barthes <[email protected]>
> +Date: Wed, 5 Jan 2011 10:39:20 +0100
> +Subject: [PATCH] Rework of DBUS signal as trigger for PA voice Module
> + BMC#11989
> + Signed-off-by: Fabien Barthes <[email protected]>
> +
> +---
> + interface.conf                         |   13 +++
> + monitor-call-audio-setting-mid         |  131
> ++++++++++++++++----------------
> + test_interface_bridge.py               |   26 ++++++
> + 3 files changed, 108 insertions(+), 64 deletions(-)
> + create mode 100744 interface.conf
> + create mode 100755 test_interface_bridge.py
> +
> +diff --git a/interface.conf b/interface.conf
> +new file mode 100744
> +index 0000000..a02d079
> +--- /dev/null
> ++++ b/interface.conf
> +@@ -0,0 +1,13 @@
> ++<!-- Security policies tonegen daemon -->
> ++
> ++<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus
> Configuration 1.0//EN"
> ++ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd";>
> ++<busconfig>
> ++  <!-- Allow any connection to receive the message -->
> ++  <policy context="default">
> ++    <allow own="com.bridge"/>
> ++    <allow send_destination="com.bridge"/>
> ++    <allow receive_sender="com.bridge"/>
> ++    <allow send_path="/bridge"/>
> ++  </policy>
> ++</busconfig>
> +diff --git a/monitor-call-audio-setting-mid b/monitor-call-audio-setting-mid
> +index a05b518..a8daacc 100755
> +--- a/monitor-call-audio-setting-mid
> ++++ b/monitor-call-audio-setting-mid
> +@@ -3,77 +3,79 @@
> +
> + import gobject
> + import dbus
> ++import dbus.service
> + import dbus.mainloop.glib
> + import commands, os
> + import signal
> + import time
> +-import ConfigParser
> +-#from config import *
> +
> + sys_bus = None
> + properties = None
> +-ERROR = 1
> +-OK = 0
> +-
> +-def LoadModuleVoice():
> +-        global moduleIndex
> +-    cmd = "pactl load-module module-voice  sink_name=vce_sink
> source_name=vce_source device=/dev/cmt_speech channels=1
> channel_map=mono transmit=TRUE receive=TRUE rate=16000 fragments=2
> fragment_size=640 mmap=TRUE"
> +-    #execute cmd and puts stdout into out
> +-    if (moduleIndex==65535):
> +-            out = commands.getoutput(cmd)
> +-            if(len(out)):
> +-                    if(out.split()[0] == "Failure:"):
> +-                            return ERROR, 65535
> +-                    elif(out.split()[0] == "Connection"):
> +-                                    return ERROR, 65535
> +-                    else:
> +-                            moduleIndex = int(out.split()[0])
> +-                                    print_file( "module nr:"+ 
> str(out.split()[0]))
> +-                                    return OK, moduleIndex
> +-                    return ERROR, 65535
> +-        else:
> +-            print_file( "module already loaded")
> +-                return OK, moduleIndex
> +
> +-#end LoadModuleByName
> ++class bridge(dbus.service.Object):
> ++    def __init__(self, busname, object_path):
> ++        dbus.service.Object.__init__(self, busname, object_path)
> ++
> ++    @dbus.service.method(dbus_interface='com.bridge.AudioSettings',
> ++                         in_signature='', out_signature='sb')
> ++    def GetProperties(self):
> ++        global i2sAudio
> ++        print_file("audio is "+str(i2sAudio))
> ++        return "Active", i2sAudio
> ++
> ++    #for test purpose only
> ++    @dbus.service.method(dbus_interface='com.bridge.AudioSettings',
> ++                         in_signature='', out_signature='')
> ++    def toggleI2SAudio(self):
> ++        global i2sAudio
> ++        if i2sAudio:
> ++            i2sAudio = False
> ++        else:
> ++            i2sAudio = True
> ++        self.PropertyChanged("Active", i2sAudio)
> ++
> ++
> ++    @dbus.service.signal(dbus_interface='com.bridge.AudioSettings',
> ++                         signature='sv')
> ++    def PropertyChanged(self, property, audio):
> ++        if property == "Active":
> ++            print_file(property)
> ++            if(audio):
> ++                print_file("audio is ON")
> ++            else:
> ++                print_file("audio is OFF")
> ++        else:
> ++            print_file("unknown property")
> ++        return property, audio
> +
> +-def UnloadVoiceModule(moduleInd):
> +-    global moduleIndex
> +-    os.system("pactl unload-module "+str(moduleInd)+" &>/dev/null")
> +-    moduleIndex = 65535
> ++def setAudioPathOn():
> ++    bridgeInstance.PropertyChanged("Active", True)
> ++
> ++def setAudioPathOff():
> ++    bridgeInstance.PropertyChanged("Active", False)
> +
> + def print_file(string):
> +     f = open('/dev/null','a')
> +     print >> f, string
> +
> + def voicecall_property_changed(property, value):
> +-    global moduleIndex
> +     global ring
> +     print_file( "Voicecall property: '%s' changed to '%s'" % (property, 
> value))
> +     if(property == "State"):
> +             vc_state=value
> +             if(vc_state == "alerting"):
> +                     ring=0
> +-                    print_file("active pcm: load voice module")
> +-                    (result, moduleIndex) = LoadModuleVoice()
> +-                    if(result):
> +-                            print_file("module voice not loaded!!!!")
> +-                    else:
> +-                            print_file("module voice loaded... nr 
> #"+str(moduleIndex))
> ++                    print_file("active pcm: set audio path on")
> ++                    setAudioPathOn()
> +             elif(vc_state == "incoming"):
> +                     ring=1
> +             elif(vc_state == "active"):
> +                     ring=0
> +-                    print_file("active pcm: load voice modulne")
> +-                    (result, moduleIndex) = LoadModuleVoice()
> +-                    if(result):
> +-                            print_file("module voice not loaded!!!!")
> +-                    else:
> +-                            print_file("module voice loaded... nr 
> #"+str(moduleIndex))
> ++                    print_file("active pcm: set audio path on")
> ++                    setAudioPathOn()
> +             elif(vc_state == "disconnected"):
> +-                    print_file("inactive pcm: unload voice module")
> +-                    if(moduleIndex != 65535):
> +-                            UnloadVoiceModule(moduleIndex)
> ++                    print_file("active pcm: set audio path off")
> ++                    setAudioPathOff()
> +             else:
> +                     print_file("other value changed")
> +     else:
> +@@ -101,26 +103,27 @@ def voicecalls_call_added(path, properties):
> +
> + def voicecalls_call_removed(path):
> +     print_file("    Voice Call [ %s ] Removed" % (path))
> +-
> +-
> +
> + if __name__ == "__main__":
> +-    global vcmanager
> +-    moduleIndex = 65535
> +-    ring=0
> +-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
> +-    sys_bus = dbus.SystemBus()
> +-    ofono_manager = dbus.Interface(sys_bus.get_object('org.ofono', '/'),
> 'org.ofono.Manager')
> +-    modems = ofono_manager.GetModems()
> +-
> +-    if (len(modems[0]) > 0):
> +-            path = modems[0][0]
> +-            vcmanager = dbus.Interface(sys_bus.get_object('org.ofono',
> path),'org.ofono.VoiceCallManager')
> +-            vcmanager.connect_to_signal("CallAdded", voicecalls_call_added)
> +-            vcmanager.connect_to_signal("CallRemoved",
> voicecalls_call_removed)
> +-
> +-
> +-    mainloop = gobject.MainLoop()
> +-    mainloop.run()
> ++    global vcmanager
> ++    global bridgeInstance
> ++    ring=0
> ++    i2sAudio = False
> ++    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
> ++    sys_bus = dbus.SystemBus()
> ++    ofono_manager = dbus.Interface(sys_bus.get_object('org.ofono', '/'),
> 'org.ofono.Manager')
> ++    modems = ofono_manager.GetModems()
> ++
> ++    if (len(modems[0]) > 0):
> (47 more lines skipped)
> 
> ++++++ monitor-call-audio-setting-mid-1.0.tar.bz2
> --- monitor-call-audio-setting-mid.spec
> +++ monitor-call-audio-setting-mid.spec
> @@ -1,8 +1,9 @@
>  Name:       monitor-call-audio-setting-mid
>  Summary:    Monitor Call Audio Settings
> -Version:    1.0
> +Version:    1.2
>  Release:    1
>  Group:      Applications/System
> +
>  License:    GPLv2
>  Source0:    %{name}-%{version}.tar.bz2
>  Requires:   pulseaudio
> @@ -20,13 +21,21 @@
>  %prep
>  %setup -q
> 
> +0001-DBUS-signal-from-PropertyChanged-of-org.ofono.VoiceC.patch
> +%patch0 -p1
> +
>  %build
> 
>  %install
>  rm -rf %{buildroot}
> 
>  mkdir -p %{buildroot}/usr/bin
> +mkdir -p %{buildroot}/etc/dbus-1/system.d
> +
>  install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/monitor-call-audio-setting-mid %{buildr
> oot}/usr/bin
> +install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/test_interface_bridge.py %{buildroot}/
> usr/bin
> +install -m 755
> $RPM_BUILD_DIR/%{name}-%{version}/interface.conf %{buildroot}/etc/dbus-1
> /system.d
> +
>  mkdir -p %{buildroot}/etc/xdg/autostart
>  cp -a
> $RPM_BUILD_DIR/%{name}-%{version}/monitor-call-audio-setting-mid.desktop
>  %{buildroot}/etc/xdg/autostart
> 
> @@ -37,6 +46,8 @@
>  %files
>  %defattr(-,root,root,-)
>  /usr/bin/monitor-call-audio-setting-mid
> +/usr/bin/test_interface_bridge.py
> +/etc/dbus-1/system.d/interface.conf
>  %config /etc/xdg/autostart/monitor-call-audio-setting-mid.desktop
> 
> 
> 
> _______________________________________________
> MeeGo-commits mailing list
> [email protected]
> http://lists.meego.com/listinfo/meego-commits
_______________________________________________
MeeGo-packaging mailing list
[email protected]
http://lists.meego.com/listinfo/meego-packaging

Reply via email to