Skip to content

Commit

Permalink
Midi-Cat, Mem - fixes for prev/next module mapping #200
Browse files Browse the repository at this point in the history
  • Loading branch information
stoermelder committed Oct 31, 2020
1 parent 4790da4 commit aedd8a5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
Binary file modified res-src/MidiCatEx.afdesign
Binary file not shown.
Binary file modified res-src/dark/MidiCatEx.afdesign
Binary file not shown.
17 changes: 17 additions & 0 deletions res/MidiCatEx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions res/dark/MidiCatEx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/MidiCat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ struct MidiCatModule : Module, StripIdFixModule {
updateMapLen();
}

bool memApplyTest(Module* m) {
bool memTest(Module* m) {
if (!m) return false;
auto p = std::pair<std::string, std::string>(m->model->plugin->slug, m->model->slug);
auto it = memStorage->find(p);
Expand Down Expand Up @@ -1412,12 +1412,11 @@ struct MidiCatWidget : ThemedModuleWidget<MidiCatModule> {
f:
std::list<Widget*>::iterator it = modules.begin();
// Scan for current module in the list
if (module->memModuleId >= 0) {
if (module->memModuleId != -1) {
for (; it != modules.end(); it++) {
ModuleWidget* mw = dynamic_cast<ModuleWidget*>(*it);
Module* m = mw->module;
if (m->id == module->memModuleId) {
module->memApplyTest(m);
it++;
break;
}
Expand All @@ -1431,7 +1430,7 @@ struct MidiCatWidget : ThemedModuleWidget<MidiCatModule> {
for (; it != modules.end(); it++) {
ModuleWidget* mw = dynamic_cast<ModuleWidget*>(*it);
Module* m = mw->module;
if (module->memApplyTest(m)) {
if (module->memTest(m)) {
module->memApply(m);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/MidiCatEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct MidiCatExWidget : ThemedModuleWidget<MidiCatExModule> {

addChild(createParamCentered<TL1105>(Vec(15.0f, 227.1f), module, MidiCatExModule::PARAM_PREV));
addChild(createParamCentered<TL1105>(Vec(15.0f, 258.5f), module, MidiCatExModule::PARAM_NEXT));
addChild(createLightCentered<TinyLight<WhiteLight>>(Vec(15.f, 291.3f), module, MidiCatExModule::LIGHT_APPLY));
addChild(createLightCentered<TinyLight<WhiteLight>>(Vec(15.f, 284.4f), module, MidiCatExModule::LIGHT_APPLY));
addChild(createParamCentered<TL1105>(Vec(15.0f, 306.7f), module, MidiCatExModule::PARAM_APPLY));
MemDisplay* memDisplay = createWidgetCentered<MemDisplay>(Vec(15.0f, 336.2f));
memDisplay->module = module;
Expand Down

0 comments on commit aedd8a5

Please sign in to comment.