From: pin Date: Tue, 23 Mar 2010 14:01:31 +0000 (+0000) Subject: Affichage écran de lancement. X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/commitdiff_plain/967c3023786aaf8753d5a7597c4a418d95807c5b?ds=inline Affichage écran de lancement. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@112 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/app/minwii.py b/src/app/minwii.py index dbf1b23..06e33f7 100755 --- a/src/app/minwii.py +++ b/src/app/minwii.py @@ -9,6 +9,7 @@ $URL$ import pygame from pgu.gui import Desktop from pgu.gui import QUIT +from widgets.launch import LaunchScreen from widgets.home import Home from widgets.playingscreen import SongPlayingScreen, PlayingScreen from widgets.instrumentselector import InstrumentSelector @@ -16,13 +17,19 @@ from synth import Synth from eventutils import EventDispatcher from musicxml import musicXml2Song from config import SONG_FILE_PATH +from time import sleep class MinWii(object): def __init__(self) : + LaunchScreen() app = Desktop() synth = Synth() + modeResolution = (1024,768) + pygame.display.set_mode(modeResolution) + pygame.display.set_caption('MinWii') + while True : # sélection de la chanson home = Home(songPath=SONG_FILE_PATH) @@ -42,7 +49,7 @@ class MinWii(object): instrumentDescription = selector.selectedInstrument # lancement du lecteur / clavier - song = musicXml2Song(home.songFile, printNotes=True) + song = musicXml2Song(home.songFile) bank, preset = instrumentDescription['bank'], instrumentDescription['preset'] synth.program_select(0, bank, preset) playingScreen = SongPlayingScreen(synth, song) diff --git a/src/app/start.py b/src/app/start.py index 9cfbd40..c71bc45 100755 --- a/src/app/start.py +++ b/src/app/start.py @@ -13,9 +13,9 @@ def main() : from minwii import MinWii pygame.init() - modeResolution = (1024,768) + #modeResolution = (1024,768) #modeResolution = (600,480) - window = pygame.display.set_mode(modeResolution)#, pygame.FULLSCREEN) + #pygame.display.set_mode(modeResolution, pygame.NOFRAME)#, pygame.FULLSCREEN) MinWii() # from gui.PGUConfiguration import PGUConfiguration # pygame.init() diff --git a/src/app/widgets/data/accueil.png b/src/app/widgets/data/accueil.png new file mode 100644 index 0000000..cd3224b Binary files /dev/null and b/src/app/widgets/data/accueil.png differ diff --git a/src/app/widgets/launch.py b/src/app/widgets/launch.py new file mode 100755 index 0000000..04f1cbd --- /dev/null +++ b/src/app/widgets/launch.py @@ -0,0 +1,19 @@ +import pygame +import os.path + +class LaunchScreen : + + @staticmethod + def _get_launch_image() : + imagePath = os.path.abspath(__file__).split(os.path.sep)[:-1] + imagePath.extend(['data', 'accueil.png']) + return os.path.sep.join(imagePath) + + def __init__(self) : + imagePath = LaunchScreen._get_launch_image() + self.image = pygame.image.load(imagePath) + size = self.image.get_size() + pygame.display.set_mode(size, pygame.NOFRAME) + screen = pygame.display.get_surface() + screen.blit(self.image, (0,0)) + pygame.display.flip()