X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/5f3d5fdc66dc67db40c5021a44380283bf97c9f7..f930cbccef5ed34b7b17b9e738458b048d93d1da:/src/app/widgets/playingscreen.py diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py index 4638267..47898fa 100755 --- a/src/app/widgets/playingscreen.py +++ b/src/app/widgets/playingscreen.py @@ -76,7 +76,7 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : for i, rect in enumerate(self.keyboardRects) : hue = FIRST_HUE - hueStep * i tone = self.distinctNotes[i] - c = Column(self, hue, rect, tone) + c = Column(self, i, hue, rect, tone) self.add(c, layer=BACKGROUND_LAYER) self.columns[tone.midi] = c @@ -94,7 +94,7 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : EventDispatcher.dispatchEvents() dirty = self.draw(pygame.display.get_surface()) pygame.display.update(dirty) - clock.tick(FRAMERATE) + clock.tick()#FRAMERATE) def stop(self) : self._running = False @@ -113,33 +113,33 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : # parce qu'il s'agit du curseur for col in reversed(self.sprites()[:-1]) : if col.rect.collidepoint(*event.pos): - self.raiseColDown(col) + self.raiseColDown(col, event.pos) break @event_handler(pygame.MOUSEBUTTONUP) def onMouseUp(self, event) : for col in reversed(self.sprites()[:-1]) : if col.rect.collidepoint(*event.pos) : - self.raiseColUp(col) + self.raiseColUp(col, event.pos) break @event_handler(pygame.MOUSEMOTION) def onMouseMove(self, event) : for col in reversed(self.sprites()[:-1]) : if col.rect.collidepoint(*event.pos) : - self.raiseColOver(col) + self.raiseColOver(col, event.pos) break - def raiseColDown(self, col) : - evt = pygame.event.Event(events.COLDOWN, column=col) + def raiseColDown(self, col, pos) : + evt = pygame.event.Event(events.COLDOWN, column=col, pos=pos) pygame.event.post(evt) - def raiseColUp(self, col) : - evt = pygame.event.Event(events.COLUP, column=col) + def raiseColUp(self, col, pos) : + evt = pygame.event.Event(events.COLUP, column=col, pos=pos) pygame.event.post(evt) - def raiseColOver(self, col) : - evt = pygame.event.Event(events.COLOVER, column=col) + def raiseColOver(self, col, pos) : + evt = pygame.event.Event(events.COLOVER, column=col, pos=pos) pygame.event.post(evt)