From 9523d87c367937b4a78ba17b030277512619e7b2 Mon Sep 17 00:00:00 2001 From: Nat Date: Sat, 21 Jul 2007 06:00:41 +0000 Subject: Merge branch 'master' of git+ssh://natcl@dev.laptop.org/git/projects/tamtam --- diff --git a/Resources/Images/helpShow4.jpg b/Resources/Images/helpShow4.jpg index 21acecf..f5ef420 100755 --- a/Resources/Images/helpShow4.jpg +++ b/Resources/Images/helpShow4.jpg Binary files differ diff --git a/SynthLab/SynthLabWindow.py b/SynthLab/SynthLabWindow.py index 17b420f..231e9ee 100644 --- a/SynthLab/SynthLabWindow.py +++ b/SynthLab/SynthLabWindow.py @@ -55,8 +55,6 @@ class SynthLabWindow(SubActivity): self.journalCalled = True #Toolbars - if self.activity.activity_toolbar.helpButton: - self.activity.activity_toolbar.helpButton.hide() self._mainToolbar = mainToolbar(self.activity.toolbox, self) self._presetToolbar = presetToolbar(self.activity.toolbox, self) self.activity.toolbox.add_toolbar(_('Main'), self._mainToolbar) diff --git a/Util/LoopSettings.py b/Util/LoopSettings.py index f4c7ebb..7416544 100644 --- a/Util/LoopSettings.py +++ b/Util/LoopSettings.py @@ -22,6 +22,7 @@ class LoopSettings( gtk.VBox ): self.end = 1.00 self.dur = 0.01 self.register = 0 + self.ok = True self.settingsBox = gtk.HBox() self.pack_start(self.settingsBox) @@ -61,7 +62,7 @@ class LoopSettings( gtk.VBox ): self.categoryButton = gtk.Button("Category") self.categoryButton.connect_object("event", self.categoryBtnPress, cmenu) categoryBox.pack_end(self.categoryButton) - self.mainBox.pack_start(categoryBox, False, False, 5) + #self.mainBox.pack_start(categoryBox, False, False, 5) registerBox = gtk.HBox() registerMenu = gtk.MenuBar() @@ -152,15 +153,13 @@ class LoopSettings( gtk.VBox ): ofile.close() (s,o) = commands.getstatusoutput('cp ' + Config.SNDS_DIR + '/' + self.oldName + ' ' + Config.SNDS_DIR + '/' + name) - if self.playStopButton.get_active() == False: - self.playStopButton.set_active(True) - self.handlePlayButton(self.playStopButton) - self.doneLoopSettingsPopup() - def set_values(self, name, soundLength): + def set_name(self, name): self.oldName = name - self.nameEntry.set_text(name) + self.nameEntry.set_text('_' + name) + + def set_values(self, soundLength): self.soundLength = soundLength self.handleStart(self.GUI['startSlider']) self.handleEnd(self.GUI['endSlider']) @@ -213,11 +212,19 @@ class LoopSettings( gtk.VBox ): self.setChannel('ldur', self.dur) def handlePlayButton(self, widget, data=None): - self.playFunction(widget.get_active(), self.loopedSound) - if self.loopedSound == False and widget.get_active() == False: - self.timeoutStop = gobject.timeout_add(int(self.soundLength * 1000), self.playButtonState) + print widget.get_active() + if self.ok: + self.playFunction(widget.get_active(), self.loopedSound) + if self.loopedSound == False and widget.get_active() == False: + self.timeoutStop = gobject.timeout_add(int(self.soundLength * 1000)+500, self.playButtonState) + + def setButtonState(self): + self.ok = False + self.playStopButton.set_active(False) + self.ok = True def playButtonState(self): - # something's weird here - self.playStopButton.set_active(True) + self.ok = False + self.playStopButton.set_active(False) gobject.source_remove(self.timeoutStop) + self.ok = True diff --git a/Welcome.py b/Welcome.py index 04daf0d..bd0f8f8 100644 --- a/Welcome.py +++ b/Welcome.py @@ -191,7 +191,10 @@ class Welcome(SubActivity): def onActivate(self, arg): self.show_all() + self.helpButton.show() def onDeactivate(self): if self.playStopButton.get_active(): self.playStopButton.set_active(False) + + self.helpButton.hide() diff --git a/miniTamTam/KeyboardStandAlone.py b/miniTamTam/KeyboardStandAlone.py index 1560023..67d3d44 100644 --- a/miniTamTam/KeyboardStandAlone.py +++ b/miniTamTam/KeyboardStandAlone.py @@ -112,7 +112,7 @@ class KeyboardStandAlone: def onKeyRelease(self,widget,event): key = event.hardware_keycode - if key == 50: + if key == 50 or key == 62: self.loopSustain = False if key in Config.LOOP_KEYS: diff --git a/miniTamTam/miniTamTamMain.py b/miniTamTam/miniTamTamMain.py index 9d34eb0..871d9f5 100644 --- a/miniTamTam/miniTamTamMain.py +++ b/miniTamTam/miniTamTamMain.py @@ -102,6 +102,7 @@ class miniTamTamMain(SubActivity): self.loopSettingsPopup.connect("button-release-event", lambda w,e:self.doneLoopSettingsPopup() ) self.loopSettings = LoopSettings( self.loopSettingsPopup, self.loopSettingsPlayStop, self.loopSettingsChannel, self.doneLoopSettingsPopup ) self.loopSettingsPopup.add( self.loopSettings ) + self.loopSettingsPlaying = False self.drawInstrumentButtons() @@ -144,8 +145,6 @@ class miniTamTamMain(SubActivity): # Toolbar self.activity.activity_toolbar.share.show() - if self.activity.activity_toolbar.helpButton: - self.activity.activity_toolbar.helpButton.hide() self._playToolbar = playToolbar(self.activity.toolbox, self) self._recordToolbar = recordToolbar(self.activity.toolbox, self) self.activity.toolbox.add_toolbar(_('Play'), self._playToolbar) @@ -353,18 +352,20 @@ class miniTamTamMain(SubActivity): def loopSettingsPlayStop(self, state, loop): if not state: if loop: + self.loopSettingsPlaying = True self.csnd.inputMessage(Config.CSOUND_PLAY_LS_NOTE % 5022) else: self.csnd.inputMessage(Config.CSOUND_PLAY_LS_NOTE % 5023) else: if loop: + self.loopSettingsPlaying = False self.csnd.inputMessage(Config.CSOUND_STOP_LS_NOTE) def doneLoopSettingsPopup(self): if self._recordToolbar.loopSetButton.get_active(): - if self.loopSettings.playStopButton.get_active() == False: - self.loopSettings.playStopButton.set_active(True) - self.loopSettings.handlePlayButton(self.loopSettings.playStopButton) + if self.loopSettingsPlaying: + self.csnd.inputMessage(Config.CSOUND_STOP_LS_NOTE) + self.loopSettingsPlaying = False self._recordToolbar.loopSetButton.set_active(False) def handleLoopSettingsBtn(self, widget, data=None): @@ -392,15 +393,17 @@ class miniTamTamMain(SubActivity): list = results[1].split() pos = list.index('seconds') soundLength = float(list[pos-1]) - self.loopSettings.set_values(soundName, soundLength) + self.loopSettings.set_name(soundName) + self.loopSettings.setButtonState() self.loopSettingsPopup.show() self.loopSettingsPopup.move( 600, 200 ) - self.timeoutLoad = gobject.timeout_add(1000, self.load_ls_instrument, soundName) + self.timeoutLoad = gobject.timeout_add(1000, self.load_ls_instrument, soundName, soundLength) else: self.loopSettingsPopup.hide() - def load_ls_instrument(self, name): - self.csnd.load_ls_instrument(name) + def load_ls_instrument(self, soundName, soundLength): + self.csnd.load_ls_instrument(soundName) + self.loopSettings.set_values(soundLength) gobject.source_remove( self.timeoutLoad ) def drawInstrumentButtons(self): -- cgit v0.9.1