-
Notifications
You must be signed in to change notification settings - Fork 272
Sound selecting with arrow keys #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -256,6 +256,36 @@ void CartManager::programSelected(ProgramListBox *source, int pos) { | |
| } | ||
| } | ||
|
|
||
| void CartManager::programAutoCopied(ProgramListBox *source, int pos) { | ||
|
|
||
| ProgramListBox *otherListBox; | ||
|
|
||
| if ( source == activeCart.get() ) { | ||
| otherListBox = browserCart.get(); | ||
| } else { | ||
| otherListBox = activeCart.get(); | ||
| } | ||
|
|
||
| int i; | ||
| int foundIndex = -1; | ||
|
|
||
| for ( i = 0; i < otherListBox->programNames.size(); i++ ) { | ||
| if ( otherListBox->programNames[i] == "- " || otherListBox->programNames[i] == " " ) { | ||
| foundIndex = i; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if ( foundIndex < 0 ){ | ||
| AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, "Auto Copy", "No free program slot found!"); | ||
| return; | ||
| } | ||
|
|
||
| char *sourceSysExPointer = source->getCurrentCart().getRawVoice() + (pos*128); | ||
|
|
||
| programDragged(otherListBox, foundIndex, sourceSysExPointer); | ||
| } | ||
|
|
||
| void CartManager::buttonClicked(juce::Button *buttonThatWasClicked) { | ||
| if ( buttonThatWasClicked == closeButton.get() ) { | ||
| hideCartridgeManager(); | ||
|
|
@@ -306,6 +336,11 @@ void CartManager::buttonClicked(juce::Button *buttonThatWasClicked) { | |
| void CartManager::fileDoubleClicked(const File& file) { | ||
| if ( file.isDirectory() ) | ||
| return; | ||
| int rc = AlertWindow::showOkCancelBox(AlertWindow::QuestionIcon, "Load Cartridge", | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not too sure if we should confirm with the user when he wants to load a cartridge to the synth. Personally I would be overwhelmed each time I load a cartridge from the browser. Usually a CTRL-Z from the DAW should revert the load. I will test that. The confirmation should be applicable when a user wants to insert a program into an external cartridge that could possibly change user file. To me this is were we should confirm this operation. |
||
| "This will replace the current cartridge. " | ||
| "Are you sure?"); | ||
| if ( rc == 0 ) | ||
| return; | ||
| mainWindow->loadCart(file); | ||
| activeCart->setCartridge(mainWindow->processor->currentCart); | ||
| updateCartFilename(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ bool ProgramListBox::keyPressed(const KeyPress &key, Component *originatingCompo | |
| if ( key.isKeyCode(KeyPress::returnKey) ) { | ||
| activePgm = programLabel->idx; | ||
| if ( activePgm != -1 ) { | ||
| listener->programSelected(this, activePgm); | ||
| listener->programAutoCopied(this, activePgm); | ||
| } | ||
| return true; | ||
| } | ||
|
|
@@ -108,6 +108,11 @@ bool ProgramListBox::keyPressed(const KeyPress &key, Component *originatingCompo | |
| return false; | ||
| } | ||
|
|
||
| activePgm = currentIdx; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is a good idea. I've checked with other synths and browsing presets with arrows keys does change the preset. We should do the same. |
||
| if ( activePgm != -1 ) { | ||
| listener->programSelected(this, activePgm); | ||
| } | ||
|
|
||
| labels[currentIdx]->grabKeyboardFocus(); | ||
|
|
||
| repaint(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting idea, but I would rather see a CTRL-C that copies the program and CTRL-V that paste the program from the clipboard. Unless the user reads the documentation, I doubt this feature will be used organically.