MIDI menu fixes
This commit is contained in:
parent
b5c671a8f9
commit
a1b851a4eb
2 changed files with 13 additions and 13 deletions
|
@ -588,6 +588,7 @@ void ObxdAudioProcessorEditor::createMidi(int menuNo, PopupMenu &menuMidi) {
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
|
void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
|
||||||
{
|
{
|
||||||
|
createMenu();
|
||||||
int result = popupMenus[0]->showAt (Rectangle<int> (pos.getX(), pos.getY(), 1, 1));
|
int result = popupMenus[0]->showAt (Rectangle<int> (pos.getX(), pos.getY(), 1, 1));
|
||||||
|
|
||||||
if (result >= (skinStart + 1) && result <= (skinStart + skins.size()))
|
if (result >= (skinStart + 1) && result <= (skinStart + skins.size()))
|
||||||
|
@ -625,7 +626,7 @@ void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
|
||||||
}
|
}
|
||||||
else if (result == progStart + 1000){
|
else if (result == progStart + 1000){
|
||||||
processor.setShowPresetBar(!processor.getShowPresetBar());
|
processor.setShowPresetBar(!processor.getShowPresetBar());
|
||||||
createMenu();
|
//createMenu();
|
||||||
updatePresetBar();
|
updatePresetBar();
|
||||||
}
|
}
|
||||||
else if (result >= menuMidiNum){
|
else if (result >= menuMidiNum){
|
||||||
|
@ -637,7 +638,7 @@ void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
|
||||||
processor.bindings.loadFile(f);
|
processor.bindings.loadFile(f);
|
||||||
processor.updateConfig();
|
processor.updateConfig();
|
||||||
|
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -677,7 +678,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
|
||||||
if (result == file || result.copyFileTo(file)){
|
if (result == file || result.copyFileTo(file)){
|
||||||
processor.loadFromFXBFile(file);
|
processor.loadFromFXBFile(file);
|
||||||
processor.scanAndUpdateBanks();
|
processor.scanAndUpdateBanks();
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -733,7 +734,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
|
||||||
if (name.isNotEmpty())
|
if (name.isNotEmpty())
|
||||||
{
|
{
|
||||||
processor.newPreset(name);
|
processor.newPreset(name);
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +763,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
|
||||||
if (name.isNotEmpty())
|
if (name.isNotEmpty())
|
||||||
{
|
{
|
||||||
processor.changePresetName(name);
|
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 + "?")){
|
if(NativeMessageBox::showOkCancelBox(AlertWindow::NoIcon, "Delete Preset", "Delete current preset " + processor.currentPreset + "?")){
|
||||||
processor.deletePreset();
|
processor.deletePreset();
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +799,7 @@ void ObxdAudioProcessorEditor::MenuActionCallback(int action){
|
||||||
DBG("Import Preset: " << result.getFileName());
|
DBG("Import Preset: " << result.getFileName());
|
||||||
//if (result == file || result.copyFileTo(file)){
|
//if (result == file || result.copyFileTo(file)){
|
||||||
processor.loadPreset(result);
|
processor.loadPreset(result);
|
||||||
createMenu();
|
//createMenu();
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -992,7 +993,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
|
||||||
|
|
||||||
if (ext == ".fxp") {
|
if (ext == ".fxp") {
|
||||||
processor.loadPreset(file);
|
processor.loadPreset(file);
|
||||||
createMenu();
|
//createMenu();
|
||||||
} else if (ext == ".fxb") {
|
} else if (ext == ".fxb") {
|
||||||
auto name = file.getFileName().replace("%20", " ");
|
auto name = file.getFileName().replace("%20", " ");
|
||||||
auto result = processor.getBanksFolder().getChildFile(name);
|
auto result = processor.getBanksFolder().getChildFile(name);
|
||||||
|
@ -1000,7 +1001,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
|
||||||
if (file.copyFileTo(result)){
|
if (file.copyFileTo(result)){
|
||||||
processor.loadFromFXBFile(result);
|
processor.loadFromFXBFile(result);
|
||||||
processor.scanAndUpdateBanks();
|
processor.scanAndUpdateBanks();
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1018,7 +1019,7 @@ void ObxdAudioProcessorEditor::filesDropped(const StringArray& files, int x, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processor.sendChangeMessage();
|
processor.sendChangeMessage();
|
||||||
createMenu();
|
//createMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -606,7 +606,7 @@ bool ObxdAudioProcessor::saveFXBFile(const File& fxbFile) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile, bool changeProgram)
|
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile)
|
||||||
{
|
{
|
||||||
MemoryBlock mb;
|
MemoryBlock mb;
|
||||||
if (! fxbFile.loadFileAsData(mb))
|
if (! fxbFile.loadFileAsData(mb))
|
||||||
|
@ -681,7 +681,6 @@ bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile, bool changeProgram
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
setStateInformation(cset->chunk, fxbSwap (cset->chunkSize));
|
setStateInformation(cset->chunk, fxbSwap (cset->chunkSize));
|
||||||
if (changeProgram)
|
|
||||||
setCurrentProgram(0); // Set to first preset position
|
setCurrentProgram(0); // Set to first preset position
|
||||||
}
|
}
|
||||||
else if (compareMagic (set->fxMagic, "FPCh"))
|
else if (compareMagic (set->fxMagic, "FPCh"))
|
||||||
|
|
Loading…
Reference in a new issue