350f32dddafbf4fdb4b64e8349340f878572f70b
[minwii.git] / src / app / minwii.py
1 # -*- coding: utf-8 -*-
2 """
3 l'application winwii
4
5 $Id$
6 $URL$
7 """
8
9 import pygame
10 from pgu.gui import Desktop
11 from pgu.gui import QUIT
12 from widgets.home import Home
13 from widgets.playingscreen import SongPlayingScreen, PlayingScreen
14 from synth import Synth
15 from eventutils import EventDispatcher
16 from musicxml import musicXml2Song
17 from config import SONG_FILE_PATH
18
19 class MinWii(object):
20
21 def __init__(self) :
22 app = Desktop()
23 synth = Synth()
24
25 while True :
26 home = Home(songPath=SONG_FILE_PATH)
27 home.connect(QUIT, app.quit)
28 app.run(home)
29 app.close(home)
30
31 song = musicXml2Song(home.songFile, printNotes=True)
32 synth.program_select(0, 0, 45)
33 playingScreen = SongPlayingScreen(synth, song)
34 playingScreen.run()
35 pygame.event.clear()
36 EventDispatcher.reset()