b279000d6d5f3c204e2a7d5ed7a337b0aa093708
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 globals import PLAYING_MODES_DICT
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 songFile
= home
.songFile
53 playMode
= home
.modeSelect
.value
54 playMode
= PLAYING_MODES_DICT
[playMode
]
55 song
= musicXml2Song(songFile
)
56 bank
, preset
= instrumentDescription
['bank'], instrumentDescription
['preset']
57 octave
= instrumentDescription
.get('octave', 0)
58 synth
.adjust_octave(0, octave
)
59 synth
.program_select(0, bank
, preset
)
60 playingScreen
= SongPlayingScreen(synth
, song
, mode
=playMode
)
63 EventDispatcher
.reset()