diff options
author | amartin <olpc@xo-05-28-21.localdomain> | 2007-07-19 08:33:05 (GMT) |
---|---|---|
committer | amartin <olpc@xo-05-28-21.localdomain> | 2007-07-19 08:33:05 (GMT) |
commit | 00178f104ce1c9a0cf449046b1e5d9a9dbf94b46 (patch) | |
tree | c06c5d1d5331a247ab4743beb46de9c04ccfd2d1 /miniTamTam | |
parent | a4344555b21eb1e534aabab0ce39183f64b0381f (diff) | |
parent | 36b024ff659878920fe1378bbb81820dc0ab4b13 (diff) |
Merge branch 'master' of git+ssh://amartin@dev.laptop.org/git/projects/tamtam
Diffstat (limited to 'miniTamTam')
-rw-r--r-- | miniTamTam/miniTamTamMain.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/miniTamTam/miniTamTamMain.py b/miniTamTam/miniTamTamMain.py index 8fc767b..03649c0 100644 --- a/miniTamTam/miniTamTamMain.py +++ b/miniTamTam/miniTamTamMain.py @@ -96,7 +96,7 @@ class miniTamTamMain(SubActivity): self.loopSettingsPopup.set_modal(True) self.loopSettingsPopup.add_events( gtk.gdk.BUTTON_PRESS_MASK ) self.loopSettingsPopup.connect("button-release-event", lambda w,e:self.doneLoopSettingsPopup() ) - self.loopSettings = LoopSettings( self.loopSettingsPopup, self.loopSettingsPlayStop ) + self.loopSettings = LoopSettings( self.loopSettingsPopup, self.loopSettingsPlayStop, self.loopSettingsChannel ) self.loopSettingsPopup.add( self.loopSettings ) @@ -333,6 +333,15 @@ class miniTamTamMain(SubActivity): self.rightBox.pack_start(slidersBox, True) self.rightBox.pack_start(geneButtonBox, True) + def loopSettingsChannel(self, channel, value): + self.csnd.setChannel(channel, value) + + def loopSettingsPlayStop(self, state): + if not state: + self.csnd.inputMessage(Config.CSOUND_PLAY_LS_NOTE) + else: + self.csnd.inputMessage(Config.CSOUND_STOP_LS_NOTE) + def doneLoopSettingsPopup(self): if self.loopSettingsBtn.get_active(): self.loopSettingsBtn.set_active(False) @@ -357,14 +366,18 @@ class miniTamTamMain(SubActivity): except IOError: print 'ERROR: failed to load Sound from file %s' % chooser.get_filename() chooser.destroy() - - self.csnd.load_ls_instrument(soundName) + self.loopSettings.set_name(soundName) self.loopSettingsPopup.show() self.loopSettingsPopup.move( 600, 200 ) + self.timeoutLoad = gobject.timeout_add(1000, self.load_ls_instrument, soundName) else: self.loopSettingsPopup.hide() - + + def load_ls_instrument(self, name): + self.csnd.load_ls_instrument(name) + gobject.source_remove( self.timeoutLoad ) + def drawInstrumentButtons(self): self.instrumentPanelBox = gtk.HBox() # InstrumentPanel(elf.setInstrument,self.playInstrumentNote, False, self.micRec, self.synthRec) @@ -452,7 +465,9 @@ class miniTamTamMain(SubActivity): def handleGenerationSliderRelease(self, widget, event): self.regularity = widget.get_adjustment().value + self.beatPickup = False self.regenerate() + self.beatPickup = True def pickupNewBeat(self): self.beat = random.randint(2, 12) @@ -634,12 +649,6 @@ class miniTamTamMain(SubActivity): def onKeyRelease(self, widget, event): self.keyboardStandAlone.onKeyRelease(widget, event) - def loopSettingsPlayStop(self, state): - if state: - self.csnd.inputMessage(Config.PLAY_LS_NOTE) - else: - self.csnd.inputMessage(Config.STOP_LS_NOTE) - def playStartupSound(self): r = str(random.randrange(1,11)) self.playInstrumentNote('guidice' + r) |