Author: simplet
Date: 2008-12-01 13:18:59 +0100 (Mon, 01 Dec 2008)
New Revision: 2959

Modified:
   software_suite_v2/software/scripts/poker_blind/trunk/poker.py
Log:
* added sound
* event on head and remote (says the blinds)


Modified: software_suite_v2/software/scripts/poker_blind/trunk/poker.py
===================================================================
--- software_suite_v2/software/scripts/poker_blind/trunk/poker.py       
2008-12-01 12:10:25 UTC (rev 2958)
+++ software_suite_v2/software/scripts/poker_blind/trunk/poker.py       
2008-12-01 12:18:59 UTC (rev 2959)
@@ -5,15 +5,21 @@
 ======================================================================
 
  Poker blind annunciator. When you play texas Hold'em, it says
- the blind, and says when they change.
+ the blinds, and says when they change.
  
  Original script by MCMic.
- Conversion to API V2 by Simplet <simplet _at_ ptigeek _dot_ net>
+ Conversion to API V2 and improvements by Simplet <simplet _at_ ptigeek _dot_ 
net>
+
+ Changelog:
+ ==========
+ 12/01/2008 One click on the head or on the remote (OK button) say the current 
blind (simplet)
+            sound added (simplet).
+ 11/28/2008 Conversion to API V2 (simplet)
+ ??/??/2007 MCMic first version
  
- 
- TODO:
-  
- - One click on the head say the current blind (simplet)
+ TODO: 
+ =====
+   
  - Get the blinds from a file (simplet)
  
 ======================================================================
@@ -36,32 +42,37 @@
 # each x minutes, blinds rise
 MIN = 10
 
+i = 0
+
 # blind schedule
-blinds = ["2, 4",
-          "5, 10",
-          "10, 20",
-          "25, 50",
+blinds = ["20, 40",
           "50, 100",
           "100, 200",
           "200, 400",
           "500, 1000"]
- 
 
+def SayIt(*args):
+    tux_speak("Les blindes sont actuellement à [" + blinds[i] + "].")
+
 def tux_speak(text):
+    tux.soundFlash.play(14)
     tux.mouth.open()
-    tux.tts.speak(text,"Bruno",100)
+    tux.tts.speak(text, "Julie", 100)
     tux.mouth.close()
 
-tux = TuxAPI('127.0.0.1', 270)
+tux = TuxAPI('192.168.1.5', 270)
 tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 'PokerBlind', 'NONE')
 tux.server.waitConnected(10.0)
 tux.dongle.waitConnected(10.0)
 tux.radio.waitConnected(10.0)
 if tux.access.waitAcquire(10.0, ACCESS_PRIORITY_NORMAL):
 
-  i = 0
+  # register events
+  tux.button.remote.registerEventOnPressed(SayIt, K_OK)
+  tux.button.head.registerEventOnPressed(SayIt)
 
-  tux_speak("Les blindes actuelles sont de [" + blinds[i] + "].")
+  tux_speak("Bonjour ! Je suis le pingouin chronometreur ! Les blindes 
actuelles sont à [" + blinds[i] + "]. Bonne chance a tous !")
+  
   while i < len(blinds):
       time.sleep(60 * MIN)
       tux_speak("Les blindes passent maintenant à [" + blinds[i] + "].")


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to