X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/2b9d34e4fd258c988ccb7796d918fdf40f4d9937..46f3ffd7fdde386f41020171b5733e55a8e64a85:/src/app/widgets/playingscreen.py diff --git a/src/app/widgets/playingscreen.py b/src/app/widgets/playingscreen.py deleted file mode 100755 index f65d8e5..0000000 --- a/src/app/widgets/playingscreen.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Écran de jeu MinWii : -bandes arc-en-ciel représentant un clavier. - -$Id$ -$URL$ -""" -import pygame -# TODO : positionner cette constance en fonction de la résolution d'affichage -BORDER = 5 # 5px - -class _PlayingScreenBase(object) : - def __init__(self, distinctNotes=[]) : - """ - distinctNotes : notes disctinctes présentes dans la chanson - triées du plus grave au plus aigu. - """ - self.distinctNotes = distinctNotes - self.keyboardRects = [] - self._initRects() - self.drawColumns() - - - def _initRects(self) : - """ création des espaces réservés pour - afficher les colonnes. - """ - ambitus = self.distinctNotes[-1].midi - self.distinctNotes[0].midi - if ambitus <= 12 : - keyboardLength = 8 - else : - keyboardLength = 11 - - screen = pygame.display.get_surface() - - # taille de la zone d'affichage utile (bordure autour) - dispWidth = screen.get_width() - 2 * BORDER - dispHeight = screen.get_height() - 2 * BORDER - - columnWidth = int(round(float(dispWidth) / keyboardLength)) - - rects = [] - for i in range(keyboardLength) : - upperLeftCorner = (i*columnWidth + BORDER, BORDER) - rect = pygame.Rect(upperLeftCorner, (columnWidth, dispHeight)) - rects.append(rect) - - self.keyboardRects = rects - - - def drawColumns(self) : - pass - - def highLightColumn(self) : - pass - - -class SongPlayingScreen(_PlayingScreenBase) : - - def __init__(self, song) : - super(SongPlayingScreen, self).__init__(song.) - self.song = song - - - -class Column(pygame.sprite.Sprite) : - - def __init__(self, color) : - pass \ No newline at end of file