Author: jerome
Date: 2009-12-16 12:55:34 +0100 (Wed, 16 Dec 2009)
New Revision: 5991

Modified:
   
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py
   
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
Log:
* Sending call partner TTS message in case of incoming call.

Modified: 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py
===================================================================
--- 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py
   2009-12-16 11:19:55 UTC (rev 5990)
+++ 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/communicator.py
   2009-12-16 11:55:34 UTC (rev 5991)
@@ -487,7 +487,7 @@
     # ------------------------------
     # Incoming triggered events.
     # ------------------------------
-    #...@params : ttsName skype name otherwise.
+    #...@params : ttsName, skype name otherwise.
     OnIncomingCall = None
     OnIncomingFinished = None
     #Incoming call was refused because a call is in progress.

Modified: 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
===================================================================
--- 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
   2009-12-16 11:19:55 UTC (rev 5990)
+++ 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
   2009-12-16 11:55:34 UTC (rev 5991)
@@ -42,12 +42,17 @@
 
 from util.SimplePlugin.SimplePluginConfiguration import 
SimplePluginConfiguration
 from util.SimplePlugin.SimplePlugin import SimplePlugin
- 
+
+
+# 
==============================================================================
+# Declaration of the "SkypePluginConfiguration" object.
+# 
==============================================================================  
 class SkypePluginConfiguration(SimplePluginConfiguration):
+    '''Skype plugin configuration.
     '''
-    Skype plugin configuration.
-    '''
-    
+    # 
--------------------------------------------------------------------------
+    # Configuration initialization.
+    # 
--------------------------------------------------------------------------
     def __init__(self):
         '''
         Configuration initialization.
@@ -57,45 +62,52 @@
         self.__throwTTS = True
         self.__isOutgoing = False    
     
+    # 
--------------------------------------------------------------------------
+    # Return true if emoticons will be thrown.
+    # 
--------------------------------------------------------------------------
     def getThrowEmoticons(self):
+        '''Return true if emoticons will be thrown.
         '''
-        Return true if emoticons will be thrown.
-        '''
         return self.__throwEmoticons
     
-    
+    # 
--------------------------------------------------------------------------
+    #  Set the throwEmoticons parameter value.
+    # 
--------------------------------------------------------------------------
     def setThrowEmoticons(self, throwEmoticons):
+        '''Set the throwEmoticons parameter value.
         '''
-        Set the throwEmoticons parameter value.
-        '''
         self.__throwEmoticons = throwEmoticons
     
-    
+    # 
--------------------------------------------------------------------------
+    #  Return the throwTTS parameter value.
+    # 
--------------------------------------------------------------------------
     def getThrowTTS(self):
+        '''Return the throwTTS parameter value.
         '''
-        Return the throwTTS parameter value.
-        '''
         return self.__throwTTS
     
-    
+    # 
--------------------------------------------------------------------------
+    #  Set the throwTTS parameter value.
+    # 
--------------------------------------------------------------------------
     def setThrowTTS(self, throwTTS):
+        '''Set the throwTTS parameter value.
         '''
-        Set the throwTTS parameter value.
-        '''
         self.__throwTTS = throwTTS
     
-    
+    # 
--------------------------------------------------------------------------
+    #  Return the outgoing parameter value.
+    # 
--------------------------------------------------------------------------
     def getIsOutgoing(self):
+        '''Return the outgoing parameter value.
         '''
-        Return the outgoing parameter value.
-        '''
         return self.__isOutgoing
     
-    
+    # 
--------------------------------------------------------------------------
+    #  Set the outgoing parameter value.
+    # 
--------------------------------------------------------------------------
     def setIsOutgoing(self, isOutgoing):
+        '''Set the outgoing parameter value.
         '''
-        Set the outgoing parameter value.
-        '''
         self.__isOutgoing = isOutgoing
  
  
@@ -121,6 +133,7 @@
     #Used for outgoing parameter only.
     onlineList = []
     currentContact = -1
+    partner = ""
     
     
     ##----------------------------------------------------------------
@@ -170,12 +183,16 @@
         '''
         Tux Droid plugin event callback.
         '''
+        request = '/tts/stop?'
         if self.command == 'incoming':
             #Accept call 
             if eventName   == 'head':
+                #Stop current tts message.
+                TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, 
request)
                 self.client.notify('accept_call')
             #Reject Call          
             elif eventName in ['left', 'right']:
+                TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, 
request)
                 self.client.notify('reject_call')
                 
         #endcall command, waiting for the call ends.
@@ -223,7 +240,6 @@
         if Message == 'command>incoming':
             self.throwNotification("start")
             self.throwActuation("upFlippers")
-            self.throwActuation("openMouth")
             self.throwNotification("stop")
             self.command = 'incoming'
         
@@ -255,6 +271,15 @@
             self.throwMessage('%s' % Message[4:])
             self.throwNotification("stop")
         
+        elif Message[:18].find("tts_incoming_call>") != -1:
+            self.throwNotification("start")
+            self.throwMessage('{0} is calling you', Message[18:])
+            self.throwNotification("stop")
+            #Re - open mouth
+            self.throwNotification("start")
+            self.throwActuation("openMouth")
+            self.throwNotification("stop")
+        
         elif Message == 'command>interface_outgoing_call':
             self.throwNotification("start")
             self.throwActuation("upFlippers")
@@ -356,6 +381,7 @@
         Incoming call event.
         '''
         #Set up Tux Droid motors.
+        self.partner = self.synchronious.getTTSName(contactHandle)
         thread = threading.Thread(target=self.startRunMode)
         thread.start()
     
@@ -368,6 +394,7 @@
         request = '/plugins_server/start_plugin?command=run&uuid='+ self.uuid 
+'&parameters='
         TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request)
         self.command = 'incoming'
+        self.serv.notify("tts>%s" % tts)
     
     
     def OnIncomingFinished(self, contactHandle):
@@ -537,6 +564,10 @@
         '''
         if not self.configuration().getIsOutgoing():
             self.serv.notify( "command>" + self.command )
+            time.sleep(0.2)
+            #Sending call partner tts name.
+            self.serv.notify("tts_incoming_call>%s" % self.partner)
+            self.partner = ""
         
     
     def ServerOnClientRemoved(self, idClient):


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to