From: pin Date: Thu, 28 Feb 2013 10:45:44 +0000 (+0000) Subject: Ajout de l'option --audio-driver. X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/commitdiff_plain/50de70078a398fcefd89b1171cd8d0026d716e61?ds=sidebyside;hp=1c6473aa5c111d888ac8b7f656c4bf21045a8125 Ajout de l'option --audio-driver. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@410 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/app.py b/src/minwii/app.py index 444aafc..a0fa9da 100755 --- a/src/minwii/app.py +++ b/src/minwii/app.py @@ -34,7 +34,7 @@ SCREEN_PLAY = 2 class MinWii(object): - def __init__(self, wiimoteSupport=True, fullscreen=False) : + def __init__(self, wiimoteSupport=True, fullscreen=False, audioDriver=None) : envLogger.info('winwii log format version : %s', LOG_FORMAT_VERSION) self.wiimoteSupport = wiimoteSupport self.fullscreen = fullscreen @@ -43,7 +43,7 @@ class MinWii(object): themedir = os.path.sep.join(themedir) theme = Theme(themedir) self.app = Desktop(theme=theme) - self.synth = Synth() + self.synth = Synth(driver=audioDriver) self.screenResolution = SCREEN_RESOLUTION envLogger.info('résolution écran : %s', self.screenResolution) self.nwiimotes = 0 diff --git a/src/minwii/start.py b/src/minwii/start.py index 7de9b7a..74ab5bf 100755 --- a/src/minwii/start.py +++ b/src/minwii/start.py @@ -12,9 +12,10 @@ from optparse import OptionParser import pygame from app import MinWii -def main(wiimoteSupport, fullscreen) : +def main(wiimoteSupport, fullscreen, audioDriver) : pygame.init() - minwii = MinWii(wiimoteSupport=wiimoteSupport, fullscreen=fullscreen) + audioDriver = None if not audioDriver else audioDriver # cast de '' en None. fluidsynth le teste spécifiquement… + minwii = MinWii(wiimoteSupport=wiimoteSupport, fullscreen=fullscreen, audioDriver=audioDriver) minwii.run() pygame.quit() @@ -33,6 +34,11 @@ if __name__ == "__main__" : , default=False , help = u"activation du mode plein écran" u" [%default]") + op.add_option("--audio-driver", dest="audio_driver" + , action="store" + , default="coreaudio" + , help=u"driver audio pour le synthétiseur (fluidsynth) [%default]" + ) options, args = op.parse_args() - main(options.wiimoteSupport, options.fullscreen) + main(options.wiimoteSupport, options.fullscreen, options.audio_driver)