X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/8a421d33328f7dd6d6bff38cc04f53cdf25de3a9..346a9b8e1fcfe30629f0d1ee4675e9e8f89890cf:/src/app/widgets/playingscreen.py?ds=sidebyside diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py index 77a17a7..0735825 100755 --- a/src/app/widgets/playingscreen.py +++ b/src/app/widgets/playingscreen.py @@ -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