2
0
Fork 0

MIDI menu fixes

This commit is contained in:
George Reales 2021-05-20 19:12:33 +02:00
parent b5c671a8f9
commit a1b851a4eb
2 changed files with 13 additions and 13 deletions

View file

@ -588,6 +588,7 @@ void ObxdAudioProcessorEditor::createMidi(int menuNo, PopupMenu &menuMidi) {
void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
{
createMenu();
int result = popupMenus[0]->showAt (Rectangle<int> (pos.getX(), pos.getY(), 1, 1));
if (result >= (skinStart + 1) && result <= (skinStart + skins.size()))
@ -625,7 +626,7 @@ void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
}
else if (result == progStart + 1000){
processor.setShowPresetBar(!processor.getShowPresetBar());
createMenu();
//createMenu();
updatePresetBar();
}
else if (result >= menuMidiNum){
@ -637,7 +638,7 @@ void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
processor.bindings.loadFile(f);
processor.updateConfig();
createMenu();
//createMenu();
}
}
}
@ -677,7 +678,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
if (result == file || result.copyFileTo(file)){
processor.loadFromFXBFile(file);
processor.scanAndUpdateBanks();
createMenu();
//createMenu();
}
}
};
@ -733,7 +734,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
if (name.isNotEmpty())
{
processor.newPreset(name);
createMenu();
//createMenu();
}
}
@ -762,7 +763,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
if (name.isNotEmpty())
{
processor.changePresetName(name);
createMenu();
//createMenu();
}
}
@ -780,7 +781,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
{
if(NativeMessageBox::showOkCancelBox(AlertWindow::NoIcon, "Delete Preset", "Delete current preset " + processor.currentPreset + "?")){
processor.deletePreset();
createMenu();
//createMenu();
}
return;
}
@ -798,7 +799,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
DBG("Import Preset: " << result.getFileName());
//if (result == file || result.copyFileTo(file)){
processor.loadPreset(result);
createMenu();
//createMenu();
//}
}
};
@ -992,7 +993,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
if (ext == ".fxp") {
processor.loadPreset(file);
createMenu();
//createMenu();
} else if (ext == ".fxb") {
auto name = file.getFileName().replace("%20", " ");
auto result = processor.getBanksFolder().getChildFile(name);
@ -1000,7 +1001,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
if (file.copyFileTo(result)){
processor.loadFromFXBFile(result);
processor.scanAndUpdateBanks();
createMenu();
//createMenu();
}
}
} else {
@ -1018,7 +1019,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
}
}
processor.sendChangeMessage();
createMenu();
//createMenu();
}
}
/*

View file

@ -606,7 +606,7 @@ bool ObxdAudioProcessor::saveFXBFile(const File& fxbFile) {
return true;
}
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile, bool changeProgram)
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile)
{
MemoryBlock mb;
if (! fxbFile.loadFileAsData(mb))
@ -681,7 +681,6 @@ bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile, bool changeProgram
return false;
setStateInformation(cset->chunk, fxbSwap (cset->chunkSize));
if (changeProgram)
setCurrentProgram(0); // Set to first preset position
}
else if (compareMagic (set->fxMagic, "FPCh"))