[tuxdroid-svn] r5979 - software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/execut
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2009-12-15 11:17:45
|
Author: jerome Date: 2009-12-15 12:17:33 +0100 (Tue, 15 Dec 2009) New Revision: 5979 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * First draft of outgoing functionality. 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-15 10:33:37 UTC (rev 5978) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-15 11:17:33 UTC (rev 5979) @@ -190,6 +190,12 @@ self.client.notify('next_contact') elif eventName == 'right': self.client.notify('previous_contact') + + #endcall command, waiting for the call ends. + if self.command == 'wait_end_call': + if eventName == 'head': + #Then send finish call command to IPN server. + self.client.notify('end_call') @@ -211,15 +217,31 @@ self.throwActuation("openMouth") self.throwNotification("stop") self.command = 'incoming' + elif Message == 'command>wait_end_call': self.command = 'wait_end_call' + + #Flippers up and mouth open if outgoing call. + if self.configuration().getIsOutgoing(): + #Stop tts. + request = '/tts/stop?' + TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) + self.throwNotification("start") + self.throwActuation("upFlippers") + self.throwActuation("openMouth") + self.throwNotification("stop") + elif Message == 'command>endcall': self.throwNotification("start") self.throwActuation("downFlippers") self.throwActuation("closeMouth") self.throwNotification("stop") self.stop() + elif Message[:4].find('tts>') != -1: + #Stop current tts message. + request = '/tts/stop?' + TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request) self.throwNotification("start") self.throwMessage('%s' % Message[4:]) self.throwNotification("stop") @@ -390,7 +412,7 @@ ''' Call the current selected contact. ''' - pass + self.synchronious.call(self.onlineList[self.currentContact]) def nextContact(self): @@ -399,7 +421,11 @@ ''' try: self.currentContact += 1 - self.serv.notify('tts>%s' % self.onlineList[self.currentUser]) + + if self.currentContact >= len(self.onlineList): + self.currentContact = 0 + + self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) except: self.serv.notify('tts>%s' % self.onlineList[0]) @@ -408,7 +434,16 @@ ''' Go previous in the online contacts list. ''' - pass + try: + self.currentContact -= 1 + + if self.currentContact <= -1: + #Then going to the last online list entry. + self.currentContact = len(self.onlineList) - 1 + + self.serv.notify('tts>%s' % self.onlineList[self.currentContact]) + except: + self.serv.notify('tts>%s' % self.onlineList[0]) def mainloop(self): @@ -489,6 +524,7 @@ self.serv.notify('command>wait_end_call') thread = threading.Thread(target=self.synchronious.acceptCall, args =(self.asynchronious.call, )) thread.start() + elif Message == 'reject_call' : #Reject call. self.synchronious.rejectCall() @@ -497,14 +533,18 @@ elif Message == 'outgoing_call': #Outgoing call requested, so getting online list and sending outgoing command. self.onlineList = self.synchronious.getOnlineList() - self.throwTrace(self.onlineList) + #Outgoing elif Message == 'call_contact': + #Proceed call. + self.serv.notify('command>wait_end_call') thread = threading.Thread(target=self.callCurrentContact) thread.start() + elif Message == 'next_contact': thread = threading.Thread(target=self.nextContact) thread.start() + elif Message == 'previous_contact': thread = threading.Thread(target=self.previousContact) thread.start() |