Ajout du mode débutant.
[minwii.git] / src / app / widgets / playingscreen.py
index 77a17a7..0735825 100755 (executable)
@@ -191,7 +191,11 @@ class SongPlayingScreen(PlayingScreenBase) :
     def _plugListeners(self, mode) :
         "initialisation des gestionnaires d'événements en fonction du mode"
 
-        if mode == PLAYING_MODES_DICT['EASY'] :
+        if mode == PLAYING_MODES_DICT['BEGINNER'] :
+            EventDispatcher.addEventListener(events.COLOVER, self.handleBeginnerColumnOver)
+
+        elif mode == PLAYING_MODES_DICT['EASY'] :
+            EventDispatcher.addEventListener(events.COLDOWN, self.handleEasyColumnDown)
             EventDispatcher.addEventListener(events.COLOVER, self.handleEasyColumnOver)
         
         elif mode == PLAYING_MODES_DICT['NORMAL'] :
@@ -209,7 +213,7 @@ class SongPlayingScreen(PlayingScreenBase) :
 
             
     # --- HID listeners ---
-    def handleEasyColumnOver(self, event) :
+    def handleBeginnerColumnOver(self, event) :
         col = event.column
         if col.state and not self.currentNotePlayed :
             self.playnote(col, event.pos)
@@ -218,6 +222,19 @@ class SongPlayingScreen(PlayingScreenBase) :
                             self.quarterNoteDuration)
                                             )
             self.currentNotePlayed = True
+
+    def handleEasyColumnOver(self, event) :
+        col = event.column
+        if col.state and \
+           any(event.mouseEvent.buttons) and \
+           not self.currentNotePlayed :
+            self.playnote(col, event.pos)
+            SongPlayingScreen.setNoteTimeout(
+                        int(self.currentNote.duration * \
+                            self.quarterNoteDuration)
+                                            )
+            self.currentNotePlayed = True
+
     
     def handleNormalColumnOver(self, event) :
         col = event.column
@@ -232,6 +249,18 @@ class SongPlayingScreen(PlayingScreenBase) :
         if col.state:
             self.playnote(col, event.pos)
             self.currentNotePlayed = True
+    
+    def handleEasyColumnDown(self, event) :
+        col = event.column
+        if col.state and \
+           not self.currentNotePlayed :
+            self.playnote(col, event.pos)
+            SongPlayingScreen.setNoteTimeout(
+                        int(self.currentNote.duration * \
+                            self.quarterNoteDuration)
+                                            )
+            self.currentNotePlayed = True
+
 
     def handleExpertColumnDown(self, event) :
         col = event.column