From: pin Date: Mon, 19 Apr 2010 12:27:24 +0000 (+0000) Subject: log++ qq bugfixes. X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/commitdiff_plain/820dda3f2152d653172c5caef86ddf33fb7abc0e log++ qq bugfixes. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@150 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/app/config.py b/src/app/config.py index a8410d2..1c2b9bd 100755 --- a/src/app/config.py +++ b/src/app/config.py @@ -81,3 +81,6 @@ INSTRUMENTS = ( 'octave' : -2 }, ) + +for i in INSTRUMENTS : + i['octave'] = i.get('octave', 0) \ No newline at end of file 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) : diff --git a/src/app/widgets/instrumentselector.py b/src/app/widgets/instrumentselector.py index 990f275..6861643 100755 --- a/src/app/widgets/instrumentselector.py +++ b/src/app/widgets/instrumentselector.py @@ -29,6 +29,7 @@ class InstrumentSelector(pygame.sprite.LayeredDirty, EventHandlerMixin) : self._initTiles() self._initCursor() self._inflatedTile = None + self.selectedInstrument = None def _initTiles(self) : screen = pygame.display.get_surface()