X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/1146c6cc44b9dfde050dd218f343811661796ecc..d2d0e07ee1695d69a6954133c7997974b55c62c8:/src/app/widgets/playingscreen.py?ds=inline diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py index 736dd06..67039e7 100755 --- a/src/app/widgets/playingscreen.py +++ b/src/app/widgets/playingscreen.py @@ -23,14 +23,14 @@ from globals import BACKGROUND_LAYER from globals import CURSOR_LAYER from globals import PLAYING_MODES_DICT -class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : +class PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : def __init__(self, synth, distinctNotes=[]) : """ distinctNotes : notes disctinctes présentes dans la chanson triées du plus grave au plus aigu. """ - super(_PlayingScreenBase, self).__init__() + super(PlayingScreenBase, self).__init__() self.synth = synth self.distinctNotes = distinctNotes self.keyboardLength = 0 @@ -47,16 +47,10 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : """ création des espaces réservés pour afficher les colonnes. """ - #ambitus = self.distinctNotes[-1].midi - self.distinctNotes[0].midi - #if ambitus <= 12 : - # self.keyboardLength = 8 - #else : - # self.keyboardLength = 11 self.keyboardLength = len(self.distinctNotes) screen = pygame.display.get_surface() - # taille de la zone d'affichage utile (bordure autour) self.dispWidth = dispWidth = screen.get_width() self.dispHeight = dispHeight = screen.get_height() @@ -94,7 +88,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() def stop(self) : self._running = False @@ -153,7 +147,7 @@ class _PlayingScreenBase(pygame.sprite.LayeredDirty, EventHandlerMixin) : return pan -class PlayingScreen(_PlayingScreenBase) : +class PlayingScreen(PlayingScreenBase) : "fenêtre de jeu pour improvisation" scale = [55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72] @@ -177,7 +171,7 @@ class PlayingScreen(_PlayingScreenBase) : self.synth.noteoff(0, tone.midi) -class SongPlayingScreen(_PlayingScreenBase) : +class SongPlayingScreen(PlayingScreenBase) : def __init__(self, synth, song, mode=PLAYING_MODES_DICT['EASY']) : super(SongPlayingScreen, self).__init__(synth, song.distinctNotes) @@ -244,4 +238,5 @@ class SongPlayingScreen(_PlayingScreenBase) : def stop(self) : pygame.time.set_timer(events.NOTEEND, 0) super(SongPlayingScreen, self).stop() - + + \ No newline at end of file