X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/ee24fce216592a13d95977d7d4e3374692fd6924..820dda3f2152d653172c5caef86ddf33fb7abc0e:/src/app/minwii.py diff --git a/src/app/minwii.py b/src/app/minwii.py index fe17218..da69dd9 100755 --- a/src/app/minwii.py +++ b/src/app/minwii.py @@ -29,6 +29,7 @@ class MinWii(object): self.app = Desktop() self.synth = Synth() self.screenResolution = (1024,768) + console.info('résolution écran : %s', self.screenResolution) self.nwiimotes = 0 self.initWiimotes() @@ -59,6 +60,10 @@ class MinWii(object): WT.resume() instrumentDescription = self.selectInstrument() + if not instrumentDescription : + WT.pause() + continue + self.runPlayingScreen(songFile, playMode, instrumentDescription) WT.pause() @@ -79,20 +84,23 @@ class MinWii(object): app.close(home) - actual_wiimotes = self.WT.get_count() - if actual_wiimotes is None : - msg = 'chanson : %s\nmode : %s\nHID : souris' - msg = msg % (home.songFile, - home.modeSelect.value) - elif actual_wiimotes == 0 : - msg = 'chanson : %s\nmode : %s\nHID : souris (pas de wiimote trouvée)' - msg = msg % (home.songFile, - home.modeSelect.value) + if home.exitApp : + msg = "sortie de l'application" else : - msg = 'chanson : %s\nmode : %s\nHID : wiimote %d' - msg = msg % (home.songFile, - home.modeSelect.value, - home.selectedWiimote.value + 1) + actual_wiimotes = self.WT.get_count() + if actual_wiimotes is None : + msg = 'chanson : %s\nmode : %s\nHID : souris' + msg = msg % (home.songFile, + home.modeSelect.value) + elif actual_wiimotes == 0 : + msg = 'chanson : %s\nmode : %s\nHID : souris (pas de wiimote trouvée)' + msg = msg % (home.songFile, + home.modeSelect.value) + else : + msg = 'chanson : %s\nmode : %s\nHID : wiimote %d' + msg = msg % (home.songFile, + home.modeSelect.value, + home.selectedWiimote.value + 1) console.info(msg) @@ -110,6 +118,9 @@ class MinWii(object): selector.stop() pygame.event.clear() EventDispatcher.reset() + if selector.selectedInstrument : + console.info('instrument : %(name)s\npreset : %(preset)d\nbank : %(bank)d\najustement octave : %(octave)d' % \ + selector.selectedInstrument) return selector.selectedInstrument def runPlayingScreen(self, songFile, playMode, instrumentDescription) :