06e33f703f150bd636246e8567a8d5aedf930ff8
1 # -*- coding: utf-8 -*-
10 from pgu
.gui
import Desktop
11 from pgu
.gui
import QUIT
12 from widgets
.launch
import LaunchScreen
13 from widgets
.home
import Home
14 from widgets
.playingscreen
import SongPlayingScreen
, PlayingScreen
15 from widgets
.instrumentselector
import InstrumentSelector
16 from synth
import Synth
17 from eventutils
import EventDispatcher
18 from musicxml
import musicXml2Song
19 from config
import SONG_FILE_PATH
20 from time
import sleep
29 modeResolution
= (1024,768)
30 pygame
.display
.set_mode(modeResolution
)
31 pygame
.display
.set_caption('MinWii')
34 # sélection de la chanson
35 home
= Home(songPath
=SONG_FILE_PATH
)
36 home
.connect(QUIT
, app
.quit
)
39 returnValue
= home
.returnValue
43 # sélection de l'instrument
44 selector
= InstrumentSelector()
48 EventDispatcher
.reset()
49 instrumentDescription
= selector
.selectedInstrument
51 # lancement du lecteur / clavier
52 song
= musicXml2Song(home
.songFile
)
53 bank
, preset
= instrumentDescription
['bank'], instrumentDescription
['preset']
54 synth
.program_select(0, bank
, preset
)
55 playingScreen
= SongPlayingScreen(synth
, song
)
58 EventDispatcher
.reset()