projects
/
minwii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gestion du flash du curseur.
[minwii.git]
/
src
/
app
/
widgets
/
playingscreen.py
diff --git
a/src/app/widgets/playingscreen.py
b/src/app/widgets/playingscreen.py
index
23f2643
..
248f0bb
100755
(executable)
--- a/
src/app/widgets/playingscreen.py
+++ b/
src/app/widgets/playingscreen.py
@@
-10,7
+10,7
@@
import pygame
from colorsys import hls_to_rgb
from gradients import gradients
from cursors import WarpingCursor
from colorsys import hls_to_rgb
from gradients import gradients
from cursors import WarpingCursor
-from eventutils import event_handler, EventHandlerMixin
+from eventutils import event_handler, Event
Dispatcher, Event
HandlerMixin
from math import floor
import types
# TODO : positionner cette constance en fonction de la résolution d'affichage
from math import floor
import types
# TODO : positionner cette constance en fonction de la résolution d'affichage
@@
-32,6
+32,7
@@
class _PlayingScreenBase(pygame.sprite.OrderedUpdates, EventHandlerMixin) :
distinctNotes : notes disctinctes présentes dans la chanson
triées du plus grave au plus aigu.
"""
distinctNotes : notes disctinctes présentes dans la chanson
triées du plus grave au plus aigu.
"""
+ print '__init__ _PlayingScreenBase'
super(_PlayingScreenBase, self).__init__()
self.distinctNotes = distinctNotes
self.keyboardLength = 0
super(_PlayingScreenBase, self).__init__()
self.distinctNotes = distinctNotes
self.keyboardLength = 0
@@
-76,7
+77,6
@@
class _PlayingScreenBase(pygame.sprite.OrderedUpdates, EventHandlerMixin) :
hueStep = FIRST_HUE / (self.keyboardLength - 1)
for i, rect in enumerate(self.keyboardRects) :
hue = FIRST_HUE - hueStep * i
hueStep = FIRST_HUE / (self.keyboardLength - 1)
for i, rect in enumerate(self.keyboardRects) :
hue = FIRST_HUE - hueStep * i
- print hue
c = Column(hue, rect)
self.add(c)
c = Column(hue, rect)
self.add(c)
@@
-92,15
+92,11
@@
class _PlayingScreenBase(pygame.sprite.OrderedUpdates, EventHandlerMixin) :
def run(self):
self._running = True
def run(self):
self._running = True
+ clock = pygame.time.Clock()
while self._running :
pygame.display.flip()
while self._running :
pygame.display.flip()
- events = pygame.event.get()
- for event in events:
- self.input(event)
-
- def input(self, event) :
- handler = getattr(self, 'eventHandler%s' % event.type, lambda e:None)
- handler(event)
+ EventDispatcher.dispatchEvents()
+ clock.tick(50)
@event_handler(pygame.KEYDOWN)
def handleKeyDown(self, event) :
@event_handler(pygame.KEYDOWN)
def handleKeyDown(self, event) :
@@
-126,6
+122,7
@@
class SongPlayingScreen(_PlayingScreenBase) :
class SongPlayingScreenTest(_PlayingScreenBase) :
def __init__(self) :
class SongPlayingScreenTest(_PlayingScreenBase) :
def __init__(self) :
+ print '__init__ SongPlayingScreenTest'
class C:pass
o = C()
o.midi=1
class C:pass
o = C()
o.midi=1