Retrait monitoring vidéo.
[minwii.git] / src / minwii / start.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 """
4 lancement de l'application winwii
5
6 $Id$
7 $URL$
8 """
9
10
11 from optparse import OptionParser
12 import pygame
13 from app import MinWii
14
15 def main(wiimoteSupport, fullscreen, audioDriver) :
16 pygame.init()
17 audioDriver = None if not audioDriver else audioDriver # cast de '' en None. fluidsynth le teste spécifiquement…
18 minwii = MinWii(wiimoteSupport=wiimoteSupport, fullscreen=fullscreen, audioDriver=audioDriver)
19 minwii.run()
20 pygame.quit()
21
22 if __name__ == "__main__" :
23 usage = "%prog [options]"
24 op = OptionParser(usage)
25
26 op.add_option("--no-wii", dest="wiimoteSupport"
27 , action="store_false"
28 , default=True
29 , help = u"désactivation du support des wiimotes"
30 u" [%default]")
31
32 op.add_option("--fullscreen", dest="fullscreen"
33 , action="store_true"
34 , default=False
35 , help = u"activation du mode plein écran"
36 u" [%default]")
37 op.add_option("--audio-driver", dest="audio_driver"
38 , action="store"
39 , default="coreaudio"
40 , help=u"driver audio pour le synthétiseur (fluidsynth) [%default]"
41 )
42 options, args = op.parse_args()
43
44 main(options.wiimoteSupport, options.fullscreen, options.audio_driver)