premier jet sur le replay d'une chanson à partir d'un fichier de log.
[minwii.git] / src / app / widgets / playingscreen.py
index 736dd06..67039e7 100755 (executable)
@@ -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