[tuxdroid-svn] r5933 - 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-04 10:09:12
|
Author: jerome Date: 2009-12-04 11:09:00 +0100 (Fri, 04 Dec 2009) New Revision: 5933 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Changed the way to check audio in / out peripherals * TuxDroid is now automatically set as audio in /out peripheral once detected. * Added contacts status changes notifications. 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-04 10:06:58 UTC (rev 5932) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-04 10:09:00 UTC (rev 5933) @@ -114,14 +114,6 @@ #Api ready and connected so creatin other commands objects. self.synchronious = SynchroniousCommands(self.connectorObj) - #Setting Tux Droid as audio peripheral. - - if not self.synchronious.isTuxDroidAudioCard(): - if not self.synchronious.setAudioCards(): - self.throwNotification("start") - self.throwMessage('An error occured trying to set Tux Droid as audio card.') - self.throwNotification("stop") - #Initializing contacts list. #self.connectorObj.getContacts() @@ -140,6 +132,8 @@ self.asynchronious.OnOutgoingCallRefused = self.OnOutgoingRefused self.asynchronious.OnOutgoingCall = self.OnOutgoingCall self.asynchronious.OnOutgoingFinished = self.OnOutgoingFinished + + self.asynchronious.OnlineContactStatusChanged = self.ContactStatusChanged def OnIncomingRefused(self, contactHandle): @@ -206,13 +200,29 @@ self.throwNotification("stop") + def ContactStatusChanged(self, UserHandle, Status): + ''' + Event that notify a contact status changed. + ''' + #Moved 'INVISIBLE to OFFLINE' in case of contact become ivisible. + if Status == 'INVISIBLE': + Status = 'OFFLINE' + self.throwNotification("start") + self.throwMessage('{0} is now {1}', UserHandle, Status) + self.throwNotification("stop") + + def mainloop(self): ''' Run main loop. ''' while 1: time.sleep(2.0) + #Setting Tux Droid as audio peripheral. + if ( self.synchronious != None ) and ( not self.synchronious.isTuxDroidAudioCard() ): + self.synchronious.setAudioCards() + def onPluginStop(self): |