Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Source/CartManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,36 @@ void CartManager::programSelected(ProgramListBox *source, int pos) {
}
}

void CartManager::programAutoCopied(ProgramListBox *source, int pos) {
Copy link
Owner

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.


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();
Expand Down Expand Up @@ -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",
Copy link
Owner

Choose a reason for hiding this comment

The 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();
Expand Down
1 change: 1 addition & 0 deletions Source/CartManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class CartManager : public Component, public Button::Listener, public DragAndDr
virtual void programSelected(ProgramListBox *source, int pos) override;
virtual void programRightClicked(ProgramListBox *source, int pos) override;
virtual void programDragged(ProgramListBox *destListBox, int dest, char *packedPgm) override;
virtual void programAutoCopied(ProgramListBox *source, int pos) override;
virtual bool keyPressed(const KeyPress& key, Component* originatingComponent) override;

void initialFocus();
Expand Down
7 changes: 6 additions & 1 deletion Source/ProgramListBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -108,6 +108,11 @@ bool ProgramListBox::keyPressed(const KeyPress &key, Component *originatingCompo
return false;
}

activePgm = currentIdx;
Copy link
Owner

Choose a reason for hiding this comment

The 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();
Expand Down
1 change: 1 addition & 0 deletions Source/ProgramListBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ProgramListBoxListener {
virtual void programSelected(ProgramListBox *source, int pos) = 0;
virtual void programRightClicked(ProgramListBox *source, int pos) = 0;
virtual void programDragged(ProgramListBox *destListBox, int dest, char *packedPgm) = 0;
virtual void programAutoCopied(ProgramListBox *source, int pos) = 0;
};

class ProgramLabel;
Expand Down