Affichage écran de lancement.
authorpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Tue, 23 Mar 2010 14:01:31 +0000 (14:01 +0000)
committerpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Tue, 23 Mar 2010 14:01:31 +0000 (14:01 +0000)
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@112 fe552daf-6dbe-4428-90eb-1537e0879342

src/app/minwii.py
src/app/start.py
src/app/widgets/data/accueil.png [new file with mode: 0644]
src/app/widgets/launch.py [new file with mode: 0755]

index dbf1b23..06e33f7 100755 (executable)
@@ -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)
index 9cfbd40..c71bc45 100755 (executable)
@@ -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 (file)
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 (executable)
index 0000000..04f1cbd
--- /dev/null
@@ -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()