From 3abe6aa804488711ada2a0952eab0552443cefe6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 26 Oct 2021 15:53:18 -0400 Subject: [PATCH] Implement all Core panel redesigns. Reorganize Core module class and SVG names. --- res/Core/{CV-MIDI.svg => CV_MIDI.svg} | 0 res/Core/{CV-MIDI CC.svg => CV_MIDICC.svg} | 0 res/Core/{Gate-MIDI.svg => Gate_MIDI.svg} | 0 res/Core/{MIDI CC-CV.svg => MIDICC_CV.svg} | 0 res/Core/{MIDI Map.svg => MIDIMap.svg} | 0 res/Core/{MIDI-CV.svg => MIDI_CV.svg} | 0 res/Core/{MIDI-Gate.svg => MIDI_Gate.svg} | 0 src/core/{AudioInterface.cpp => Audio.cpp} | 205 ++++++++++----------- src/core/CV_MIDI.cpp | 2 +- src/core/{CV_CC.cpp => CV_MIDICC.cpp} | 52 +++--- src/core/{CV_Gate.cpp => Gate_MIDI.cpp} | 54 +++--- src/core/{MIDI_CC.cpp => MIDICC_CV.cpp} | 50 ++--- src/core/{MIDI_Map.cpp => MIDIMap.cpp} | 36 ++-- src/core/MIDI_CV.cpp | 2 +- src/core/MIDI_Gate.cpp | 2 +- src/core/plugin.cpp | 14 +- src/core/plugin.hpp | 14 +- 17 files changed, 215 insertions(+), 216 deletions(-) rename res/Core/{CV-MIDI.svg => CV_MIDI.svg} (100%) rename res/Core/{CV-MIDI CC.svg => CV_MIDICC.svg} (100%) rename res/Core/{Gate-MIDI.svg => Gate_MIDI.svg} (100%) rename res/Core/{MIDI CC-CV.svg => MIDICC_CV.svg} (100%) rename res/Core/{MIDI Map.svg => MIDIMap.svg} (100%) rename res/Core/{MIDI-CV.svg => MIDI_CV.svg} (100%) rename res/Core/{MIDI-Gate.svg => MIDI_Gate.svg} (100%) rename src/core/{AudioInterface.cpp => Audio.cpp} (77%) rename src/core/{CV_CC.cpp => CV_MIDICC.cpp} (58%) rename src/core/{CV_Gate.cpp => Gate_MIDI.cpp} (65%) rename src/core/{MIDI_CC.cpp => MIDICC_CV.cpp} (86%) rename src/core/{MIDI_Map.cpp => MIDIMap.cpp} (93%) diff --git a/res/Core/CV-MIDI.svg b/res/Core/CV_MIDI.svg similarity index 100% rename from res/Core/CV-MIDI.svg rename to res/Core/CV_MIDI.svg diff --git a/res/Core/CV-MIDI CC.svg b/res/Core/CV_MIDICC.svg similarity index 100% rename from res/Core/CV-MIDI CC.svg rename to res/Core/CV_MIDICC.svg diff --git a/res/Core/Gate-MIDI.svg b/res/Core/Gate_MIDI.svg similarity index 100% rename from res/Core/Gate-MIDI.svg rename to res/Core/Gate_MIDI.svg diff --git a/res/Core/MIDI CC-CV.svg b/res/Core/MIDICC_CV.svg similarity index 100% rename from res/Core/MIDI CC-CV.svg rename to res/Core/MIDICC_CV.svg diff --git a/res/Core/MIDI Map.svg b/res/Core/MIDIMap.svg similarity index 100% rename from res/Core/MIDI Map.svg rename to res/Core/MIDIMap.svg diff --git a/res/Core/MIDI-CV.svg b/res/Core/MIDI_CV.svg similarity index 100% rename from res/Core/MIDI-CV.svg rename to res/Core/MIDI_CV.svg diff --git a/res/Core/MIDI-Gate.svg b/res/Core/MIDI_Gate.svg similarity index 100% rename from res/Core/MIDI-Gate.svg rename to res/Core/MIDI_Gate.svg diff --git a/src/core/AudioInterface.cpp b/src/core/Audio.cpp similarity index 77% rename from src/core/AudioInterface.cpp rename to src/core/Audio.cpp index 890c921d..1abda50a 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/Audio.cpp @@ -13,7 +13,7 @@ namespace core { template -struct AudioInterfacePort : audio::Port { +struct AudioPort : audio::Port { Module* module; dsp::DoubleRingBuffer, 32768> engineInputBuffer; @@ -28,7 +28,7 @@ struct AudioInterfacePort : audio::Port { float deviceSampleRate = 0.f; int requestedEngineFrames = 0; - AudioInterfacePort(Module* module) { + AudioPort(Module* module) { this->module = module; maxOutputs = NUM_AUDIO_INPUTS; maxInputs = NUM_AUDIO_OUTPUTS; @@ -172,7 +172,7 @@ struct AudioInterfacePort : audio::Port { template -struct AudioInterface : Module { +struct Audio : Module { static constexpr int NUM_INPUT_LIGHTS = (NUM_AUDIO_INPUTS > 2) ? (NUM_AUDIO_INPUTS / 2) : 0; static constexpr int NUM_OUTPUT_LIGHTS = (NUM_AUDIO_OUTPUTS > 2) ? (NUM_AUDIO_OUTPUTS / 2) : 0; @@ -195,7 +195,7 @@ struct AudioInterface : Module { NUM_LIGHTS }; - AudioInterfacePort port; + AudioPort port; dsp::RCFilter dcFilters[NUM_AUDIO_INPUTS]; bool dcFilterEnabled = false; @@ -206,7 +206,7 @@ struct AudioInterface : Module { float outputClipTimers[(NUM_AUDIO_INPUTS > 0) ? NUM_OUTPUT_LIGHTS : 0] = {}; dsp::VuMeter2 vuMeter[(NUM_AUDIO_INPUTS == 2) ? 2 : 0]; - AudioInterface() : port(this) { + Audio() : port(this) { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); if (NUM_AUDIO_INPUTS == 2) configParam(LEVEL_PARAM, 0.f, 2.f, 1.f, "Level", " dB", -10, 40); @@ -229,8 +229,8 @@ struct AudioInterface : Module { onReset(); } - ~AudioInterface() { - // Close stream here before destructing AudioInterfacePort, so processBuffer() etc are not called on another thread while destructing. + ~Audio() { + // Close stream here before destructing AudioPort, so processBuffer() etc are not called on another thread while destructing. port.setDriverId(-1); } @@ -399,10 +399,10 @@ struct AudioInterface : Module { template -struct AudioInterfaceWidget : ModuleWidget { - typedef AudioInterface TAudioInterface; +struct AudioWidget : ModuleWidget { + typedef Audio TAudio; - AudioInterfaceWidget(TAudioInterface* module) { + AudioWidget(TAudio* module) { setModule(module); if (NUM_AUDIO_INPUTS == 8 && NUM_AUDIO_OUTPUTS == 8) { @@ -413,35 +413,35 @@ struct AudioInterfaceWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addInput(createInputCentered(mm2px(Vec(7.81, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 0)); - addInput(createInputCentered(mm2px(Vec(19.359, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 1)); - addInput(createInputCentered(mm2px(Vec(30.909, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 2)); - addInput(createInputCentered(mm2px(Vec(42.459, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 3)); - addInput(createInputCentered(mm2px(Vec(7.81, 74.286)), module, TAudioInterface::AUDIO_INPUTS + 4)); - addInput(createInputCentered(mm2px(Vec(19.359, 74.286)), module, TAudioInterface::AUDIO_INPUTS + 5)); - addInput(createInputCentered(mm2px(Vec(30.909, 74.286)), module, TAudioInterface::AUDIO_INPUTS + 6)); - addInput(createInputCentered(mm2px(Vec(42.459, 74.286)), module, TAudioInterface::AUDIO_INPUTS + 7)); - - addOutput(createOutputCentered(mm2px(Vec(7.81, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 0)); - addOutput(createOutputCentered(mm2px(Vec(19.359, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 1)); - addOutput(createOutputCentered(mm2px(Vec(30.909, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 2)); - addOutput(createOutputCentered(mm2px(Vec(42.459, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 3)); - addOutput(createOutputCentered(mm2px(Vec(7.81, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 4)); - addOutput(createOutputCentered(mm2px(Vec(19.359, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 5)); - addOutput(createOutputCentered(mm2px(Vec(30.909, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 6)); - addOutput(createOutputCentered(mm2px(Vec(42.459, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 7)); - - addChild(createLightCentered>(mm2px(Vec(13.54, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 0)); - addChild(createLightCentered>(mm2px(Vec(36.774, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 1)); - addChild(createLightCentered>(mm2px(Vec(13.54, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 2)); - addChild(createLightCentered>(mm2px(Vec(36.774, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 3)); - - addChild(createLightCentered>(mm2px(Vec(13.54, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 0)); - addChild(createLightCentered>(mm2px(Vec(36.638, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 1)); - addChild(createLightCentered>(mm2px(Vec(13.54, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 2)); - addChild(createLightCentered>(mm2px(Vec(36.638, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 3)); - - AudioWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); + addInput(createInputCentered(mm2px(Vec(7.81, 57.929)), module, TAudio::AUDIO_INPUTS + 0)); + addInput(createInputCentered(mm2px(Vec(19.359, 57.929)), module, TAudio::AUDIO_INPUTS + 1)); + addInput(createInputCentered(mm2px(Vec(30.909, 57.929)), module, TAudio::AUDIO_INPUTS + 2)); + addInput(createInputCentered(mm2px(Vec(42.459, 57.929)), module, TAudio::AUDIO_INPUTS + 3)); + addInput(createInputCentered(mm2px(Vec(7.81, 74.286)), module, TAudio::AUDIO_INPUTS + 4)); + addInput(createInputCentered(mm2px(Vec(19.359, 74.286)), module, TAudio::AUDIO_INPUTS + 5)); + addInput(createInputCentered(mm2px(Vec(30.909, 74.286)), module, TAudio::AUDIO_INPUTS + 6)); + addInput(createInputCentered(mm2px(Vec(42.459, 74.286)), module, TAudio::AUDIO_INPUTS + 7)); + + addOutput(createOutputCentered(mm2px(Vec(7.81, 96.859)), module, TAudio::AUDIO_OUTPUTS + 0)); + addOutput(createOutputCentered(mm2px(Vec(19.359, 96.859)), module, TAudio::AUDIO_OUTPUTS + 1)); + addOutput(createOutputCentered(mm2px(Vec(30.909, 96.859)), module, TAudio::AUDIO_OUTPUTS + 2)); + addOutput(createOutputCentered(mm2px(Vec(42.459, 96.859)), module, TAudio::AUDIO_OUTPUTS + 3)); + addOutput(createOutputCentered(mm2px(Vec(7.81, 113.115)), module, TAudio::AUDIO_OUTPUTS + 4)); + addOutput(createOutputCentered(mm2px(Vec(19.359, 113.115)), module, TAudio::AUDIO_OUTPUTS + 5)); + addOutput(createOutputCentered(mm2px(Vec(30.909, 113.115)), module, TAudio::AUDIO_OUTPUTS + 6)); + addOutput(createOutputCentered(mm2px(Vec(42.459, 113.115)), module, TAudio::AUDIO_OUTPUTS + 7)); + + addChild(createLightCentered>(mm2px(Vec(13.54, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 0)); + addChild(createLightCentered>(mm2px(Vec(36.774, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 1)); + addChild(createLightCentered>(mm2px(Vec(13.54, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 2)); + addChild(createLightCentered>(mm2px(Vec(36.774, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 3)); + + addChild(createLightCentered>(mm2px(Vec(13.54, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 0)); + addChild(createLightCentered>(mm2px(Vec(36.638, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 1)); + addChild(createLightCentered>(mm2px(Vec(13.54, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 2)); + addChild(createLightCentered>(mm2px(Vec(36.638, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 3)); + + app::AudioWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); audioWidget->box.size = mm2px(Vec(50.8, 29.021)); audioWidget->setAudioPort(module ? &module->port : NULL); addChild(audioWidget); @@ -454,59 +454,59 @@ struct AudioInterfaceWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addInput(createInputCentered(mm2px(Vec(7.815, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 0)); - addInput(createInputCentered(mm2px(Vec(19.364, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 1)); - addInput(createInputCentered(mm2px(Vec(30.914, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 2)); - addInput(createInputCentered(mm2px(Vec(42.464, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 3)); - addInput(createInputCentered(mm2px(Vec(54.015, 57.929)), module, TAudioInterface::AUDIO_INPUTS + 4)); - addInput(createInputCentered(mm2px(Vec(65.565, 57.914)), module, TAudioInterface::AUDIO_INPUTS + 5)); - addInput(createInputCentered(mm2px(Vec(77.114, 57.914)), module, TAudioInterface::AUDIO_INPUTS + 6)); - addInput(createInputCentered(mm2px(Vec(88.664, 57.914)), module, TAudioInterface::AUDIO_INPUTS + 7)); - addInput(createInputCentered(mm2px(Vec(7.815, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 8)); - addInput(createInputCentered(mm2px(Vec(19.364, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 9)); - addInput(createInputCentered(mm2px(Vec(30.914, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 10)); - addInput(createInputCentered(mm2px(Vec(42.464, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 11)); - addInput(createInputCentered(mm2px(Vec(54.015, 74.291)), module, TAudioInterface::AUDIO_INPUTS + 12)); - addInput(createInputCentered(mm2px(Vec(65.565, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 13)); - addInput(createInputCentered(mm2px(Vec(77.114, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 14)); - addInput(createInputCentered(mm2px(Vec(88.664, 74.276)), module, TAudioInterface::AUDIO_INPUTS + 15)); - - addOutput(createOutputCentered(mm2px(Vec(7.815, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 0)); - addOutput(createOutputCentered(mm2px(Vec(19.364, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 1)); - addOutput(createOutputCentered(mm2px(Vec(30.914, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 2)); - addOutput(createOutputCentered(mm2px(Vec(42.464, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 3)); - addOutput(createOutputCentered(mm2px(Vec(54.015, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 4)); - addOutput(createOutputCentered(mm2px(Vec(65.565, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 5)); - addOutput(createOutputCentered(mm2px(Vec(77.114, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 6)); - addOutput(createOutputCentered(mm2px(Vec(88.664, 96.859)), module, TAudioInterface::AUDIO_OUTPUTS + 7)); - addOutput(createOutputCentered(mm2px(Vec(7.815, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 8)); - addOutput(createOutputCentered(mm2px(Vec(19.364, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 9)); - addOutput(createOutputCentered(mm2px(Vec(30.914, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 10)); - addOutput(createOutputCentered(mm2px(Vec(42.464, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 11)); - addOutput(createOutputCentered(mm2px(Vec(65.565, 112.962)), module, TAudioInterface::AUDIO_OUTPUTS + 12)); - addOutput(createOutputCentered(mm2px(Vec(54.015, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 13)); - addOutput(createOutputCentered(mm2px(Vec(88.664, 112.962)), module, TAudioInterface::AUDIO_OUTPUTS + 14)); - addOutput(createOutputCentered(mm2px(Vec(77.114, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 15)); - - addChild(createLightCentered>(mm2px(Vec(13.545, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 0)); - addChild(createLightCentered>(mm2px(Vec(36.779, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 1)); - addChild(createLightCentered>(mm2px(Vec(59.745, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 2)); - addChild(createLightCentered>(mm2px(Vec(82.98, 52.168)), module, TAudioInterface::INPUT_LIGHTS + 2 * 3)); - addChild(createLightCentered>(mm2px(Vec(13.545, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 4)); - addChild(createLightCentered>(mm2px(Vec(36.779, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 5)); - addChild(createLightCentered>(mm2px(Vec(59.745, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 6)); - addChild(createLightCentered>(mm2px(Vec(82.98, 68.53)), module, TAudioInterface::INPUT_LIGHTS + 2 * 7)); - - addChild(createLightCentered>(mm2px(Vec(13.545, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 0)); - addChild(createLightCentered>(mm2px(Vec(36.644, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 1)); - addChild(createLightCentered>(mm2px(Vec(59.745, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 2)); - addChild(createLightCentered>(mm2px(Vec(82.844, 90.791)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 3)); - addChild(createLightCentered>(mm2px(Vec(13.545, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 4)); - addChild(createLightCentered>(mm2px(Vec(36.644, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 5)); - addChild(createLightCentered>(mm2px(Vec(59.745, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 6)); - addChild(createLightCentered>(mm2px(Vec(82.844, 107.097)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 7)); - - AudioWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); + addInput(createInputCentered(mm2px(Vec(7.815, 57.929)), module, TAudio::AUDIO_INPUTS + 0)); + addInput(createInputCentered(mm2px(Vec(19.364, 57.929)), module, TAudio::AUDIO_INPUTS + 1)); + addInput(createInputCentered(mm2px(Vec(30.914, 57.929)), module, TAudio::AUDIO_INPUTS + 2)); + addInput(createInputCentered(mm2px(Vec(42.464, 57.929)), module, TAudio::AUDIO_INPUTS + 3)); + addInput(createInputCentered(mm2px(Vec(54.015, 57.929)), module, TAudio::AUDIO_INPUTS + 4)); + addInput(createInputCentered(mm2px(Vec(65.565, 57.914)), module, TAudio::AUDIO_INPUTS + 5)); + addInput(createInputCentered(mm2px(Vec(77.114, 57.914)), module, TAudio::AUDIO_INPUTS + 6)); + addInput(createInputCentered(mm2px(Vec(88.664, 57.914)), module, TAudio::AUDIO_INPUTS + 7)); + addInput(createInputCentered(mm2px(Vec(7.815, 74.276)), module, TAudio::AUDIO_INPUTS + 8)); + addInput(createInputCentered(mm2px(Vec(19.364, 74.276)), module, TAudio::AUDIO_INPUTS + 9)); + addInput(createInputCentered(mm2px(Vec(30.914, 74.276)), module, TAudio::AUDIO_INPUTS + 10)); + addInput(createInputCentered(mm2px(Vec(42.464, 74.276)), module, TAudio::AUDIO_INPUTS + 11)); + addInput(createInputCentered(mm2px(Vec(54.015, 74.291)), module, TAudio::AUDIO_INPUTS + 12)); + addInput(createInputCentered(mm2px(Vec(65.565, 74.276)), module, TAudio::AUDIO_INPUTS + 13)); + addInput(createInputCentered(mm2px(Vec(77.114, 74.276)), module, TAudio::AUDIO_INPUTS + 14)); + addInput(createInputCentered(mm2px(Vec(88.664, 74.276)), module, TAudio::AUDIO_INPUTS + 15)); + + addOutput(createOutputCentered(mm2px(Vec(7.815, 96.859)), module, TAudio::AUDIO_OUTPUTS + 0)); + addOutput(createOutputCentered(mm2px(Vec(19.364, 96.859)), module, TAudio::AUDIO_OUTPUTS + 1)); + addOutput(createOutputCentered(mm2px(Vec(30.914, 96.859)), module, TAudio::AUDIO_OUTPUTS + 2)); + addOutput(createOutputCentered(mm2px(Vec(42.464, 96.859)), module, TAudio::AUDIO_OUTPUTS + 3)); + addOutput(createOutputCentered(mm2px(Vec(54.015, 96.859)), module, TAudio::AUDIO_OUTPUTS + 4)); + addOutput(createOutputCentered(mm2px(Vec(65.565, 96.859)), module, TAudio::AUDIO_OUTPUTS + 5)); + addOutput(createOutputCentered(mm2px(Vec(77.114, 96.859)), module, TAudio::AUDIO_OUTPUTS + 6)); + addOutput(createOutputCentered(mm2px(Vec(88.664, 96.859)), module, TAudio::AUDIO_OUTPUTS + 7)); + addOutput(createOutputCentered(mm2px(Vec(7.815, 113.115)), module, TAudio::AUDIO_OUTPUTS + 8)); + addOutput(createOutputCentered(mm2px(Vec(19.364, 113.115)), module, TAudio::AUDIO_OUTPUTS + 9)); + addOutput(createOutputCentered(mm2px(Vec(30.914, 113.115)), module, TAudio::AUDIO_OUTPUTS + 10)); + addOutput(createOutputCentered(mm2px(Vec(42.464, 113.115)), module, TAudio::AUDIO_OUTPUTS + 11)); + addOutput(createOutputCentered(mm2px(Vec(65.565, 112.962)), module, TAudio::AUDIO_OUTPUTS + 12)); + addOutput(createOutputCentered(mm2px(Vec(54.015, 113.115)), module, TAudio::AUDIO_OUTPUTS + 13)); + addOutput(createOutputCentered(mm2px(Vec(88.664, 112.962)), module, TAudio::AUDIO_OUTPUTS + 14)); + addOutput(createOutputCentered(mm2px(Vec(77.114, 113.115)), module, TAudio::AUDIO_OUTPUTS + 15)); + + addChild(createLightCentered>(mm2px(Vec(13.545, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 0)); + addChild(createLightCentered>(mm2px(Vec(36.779, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 1)); + addChild(createLightCentered>(mm2px(Vec(59.745, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 2)); + addChild(createLightCentered>(mm2px(Vec(82.98, 52.168)), module, TAudio::INPUT_LIGHTS + 2 * 3)); + addChild(createLightCentered>(mm2px(Vec(13.545, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 4)); + addChild(createLightCentered>(mm2px(Vec(36.779, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 5)); + addChild(createLightCentered>(mm2px(Vec(59.745, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 6)); + addChild(createLightCentered>(mm2px(Vec(82.98, 68.53)), module, TAudio::INPUT_LIGHTS + 2 * 7)); + + addChild(createLightCentered>(mm2px(Vec(13.545, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 0)); + addChild(createLightCentered>(mm2px(Vec(36.644, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 1)); + addChild(createLightCentered>(mm2px(Vec(59.745, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 2)); + addChild(createLightCentered>(mm2px(Vec(82.844, 90.791)), module, TAudio::OUTPUT_LIGHTS + 2 * 3)); + addChild(createLightCentered>(mm2px(Vec(13.545, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 4)); + addChild(createLightCentered>(mm2px(Vec(36.644, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 5)); + addChild(createLightCentered>(mm2px(Vec(59.745, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 6)); + addChild(createLightCentered>(mm2px(Vec(82.844, 107.097)), module, TAudio::OUTPUT_LIGHTS + 2 * 7)); + + app::AudioWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); audioWidget->box.size = mm2px(Vec(96.52, 29.021)); audioWidget->setAudioPort(module ? &module->port : NULL); addChild(audioWidget); @@ -519,15 +519,15 @@ struct AudioInterfaceWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addParam(createParamCentered(mm2px(Vec(12.869, 77.362)), module, TAudioInterface::LEVEL_PARAM)); + addParam(createParamCentered(mm2px(Vec(12.869, 77.362)), module, TAudio::LEVEL_PARAM)); - addInput(createInputCentered(mm2px(Vec(7.285, 96.859)), module, TAudioInterface::AUDIO_INPUTS + 0)); - addInput(createInputCentered(mm2px(Vec(18.122, 96.859)), module, TAudioInterface::AUDIO_INPUTS + 1)); + addInput(createInputCentered(mm2px(Vec(7.285, 96.859)), module, TAudio::AUDIO_INPUTS + 0)); + addInput(createInputCentered(mm2px(Vec(18.122, 96.859)), module, TAudio::AUDIO_INPUTS + 1)); - addOutput(createOutputCentered(mm2px(Vec(7.285, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 0)); - addOutput(createOutputCentered(mm2px(Vec(18.122, 113.115)), module, TAudioInterface::AUDIO_OUTPUTS + 1)); + addOutput(createOutputCentered(mm2px(Vec(7.285, 113.115)), module, TAudio::AUDIO_OUTPUTS + 0)); + addOutput(createOutputCentered(mm2px(Vec(18.122, 113.115)), module, TAudio::AUDIO_OUTPUTS + 1)); - AudioDeviceWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); + app::AudioDeviceWidget* audioWidget = createWidget(mm2px(Vec(0.0, 13.039))); audioWidget->box.size = mm2px(Vec(25.4, 47.726)); audioWidget->setAudioPort(module ? &module->port : NULL); // Adjust deviceChoice position @@ -546,7 +546,7 @@ struct AudioInterfaceWidget : ModuleWidget { } void appendContextMenu(Menu* menu) override { - TAudioInterface* module = dynamic_cast(this->module); + TAudio* module = dynamic_cast(this->module); menu->addChild(new MenuSeparator); @@ -560,10 +560,9 @@ struct AudioInterfaceWidget : ModuleWidget { }; -Model* modelAudioInterface2 = createModel, AudioInterfaceWidget<2, 2>>("AudioInterface2"); -// Legacy name for Audio-8 -Model* modelAudioInterface = createModel, AudioInterfaceWidget<8, 8>>("AudioInterface"); -Model* modelAudioInterface16 = createModel, AudioInterfaceWidget<16, 16>>("AudioInterface16"); +Model* modelAudio2 = createModel, AudioWidget<2, 2>>("AudioInterface2"); +Model* modelAudio8 = createModel, AudioWidget<8, 8>>("AudioInterface"); +Model* modelAudio16 = createModel, AudioWidget<16, 16>>("AudioInterface16"); } // namespace core diff --git a/src/core/CV_MIDI.cpp b/src/core/CV_MIDI.cpp index 74ba44a6..135e66ec 100644 --- a/src/core/CV_MIDI.cpp +++ b/src/core/CV_MIDI.cpp @@ -149,7 +149,7 @@ struct CV_MIDIPanicItem : MenuItem { struct CV_MIDIWidget : ModuleWidget { CV_MIDIWidget(CV_MIDI* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/CV-MIDI.svg"))); + setPanel(Svg::load(asset::system("res/Core/CV_MIDI.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); diff --git a/src/core/CV_CC.cpp b/src/core/CV_MIDICC.cpp similarity index 58% rename from src/core/CV_CC.cpp rename to src/core/CV_MIDICC.cpp index deb2f3aa..a3065a2d 100644 --- a/src/core/CV_CC.cpp +++ b/src/core/CV_MIDICC.cpp @@ -39,7 +39,7 @@ struct CCMidiOutput : midi::Output { }; -struct CV_CC : Module { +struct CV_MIDICC : Module { enum ParamIds { NUM_PARAMS }; @@ -59,7 +59,7 @@ struct CV_CC : Module { int learningId = -1; int learnedCcs[16] = {}; - CV_CC() { + CV_MIDICC() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); for (int i = 0; i < 16; i++) configInput(CC_INPUTS + i, string::f("Cell %d", i + 1)); @@ -122,36 +122,36 @@ struct CV_CC : Module { }; -struct CV_CCWidget : ModuleWidget { - CV_CCWidget(CV_CC* module) { +struct CV_MIDICCWidget : ModuleWidget { + CV_MIDICCWidget(CV_MIDICC* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/CV-CC.svg"))); + setPanel(Svg::load(asset::system("res/Core/CV_MIDICC.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addInput(createInputCentered(mm2px(Vec(8, 77)), module, CV_CC::CC_INPUTS + 0)); - addInput(createInputCentered(mm2px(Vec(20, 77)), module, CV_CC::CC_INPUTS + 1)); - addInput(createInputCentered(mm2px(Vec(31, 77)), module, CV_CC::CC_INPUTS + 2)); - addInput(createInputCentered(mm2px(Vec(43, 77)), module, CV_CC::CC_INPUTS + 3)); - addInput(createInputCentered(mm2px(Vec(8, 89)), module, CV_CC::CC_INPUTS + 4)); - addInput(createInputCentered(mm2px(Vec(20, 89)), module, CV_CC::CC_INPUTS + 5)); - addInput(createInputCentered(mm2px(Vec(31, 89)), module, CV_CC::CC_INPUTS + 6)); - addInput(createInputCentered(mm2px(Vec(43, 89)), module, CV_CC::CC_INPUTS + 7)); - addInput(createInputCentered(mm2px(Vec(8, 101)), module, CV_CC::CC_INPUTS + 8)); - addInput(createInputCentered(mm2px(Vec(20, 101)), module, CV_CC::CC_INPUTS + 9)); - addInput(createInputCentered(mm2px(Vec(31, 101)), module, CV_CC::CC_INPUTS + 10)); - addInput(createInputCentered(mm2px(Vec(43, 101)), module, CV_CC::CC_INPUTS + 11)); - addInput(createInputCentered(mm2px(Vec(8, 112)), module, CV_CC::CC_INPUTS + 12)); - addInput(createInputCentered(mm2px(Vec(20, 112)), module, CV_CC::CC_INPUTS + 13)); - addInput(createInputCentered(mm2px(Vec(31, 112)), module, CV_CC::CC_INPUTS + 14)); - addInput(createInputCentered(mm2px(Vec(43, 112)), module, CV_CC::CC_INPUTS + 15)); - - typedef Grid16MidiWidget> TMidiWidget; - TMidiWidget* midiWidget = createWidget(mm2px(Vec(3.399621, 14.837339))); - midiWidget->box.size = mm2px(Vec(44, 54.667)); + addInput(createInputCentered(mm2px(Vec(8.189, 78.431)), module, CV_MIDICC::CC_INPUTS + 0)); + addInput(createInputCentered(mm2px(Vec(19.739, 78.431)), module, CV_MIDICC::CC_INPUTS + 1)); + addInput(createInputCentered(mm2px(Vec(31.289, 78.431)), module, CV_MIDICC::CC_INPUTS + 2)); + addInput(createInputCentered(mm2px(Vec(42.838, 78.431)), module, CV_MIDICC::CC_INPUTS + 3)); + addInput(createInputCentered(mm2px(Vec(8.189, 89.946)), module, CV_MIDICC::CC_INPUTS + 4)); + addInput(createInputCentered(mm2px(Vec(19.739, 89.946)), module, CV_MIDICC::CC_INPUTS + 5)); + addInput(createInputCentered(mm2px(Vec(31.289, 89.946)), module, CV_MIDICC::CC_INPUTS + 6)); + addInput(createInputCentered(mm2px(Vec(42.838, 89.946)), module, CV_MIDICC::CC_INPUTS + 7)); + addInput(createInputCentered(mm2px(Vec(8.189, 101.466)), module, CV_MIDICC::CC_INPUTS + 8)); + addInput(createInputCentered(mm2px(Vec(19.739, 101.466)), module, CV_MIDICC::CC_INPUTS + 9)); + addInput(createInputCentered(mm2px(Vec(31.289, 101.466)), module, CV_MIDICC::CC_INPUTS + 10)); + addInput(createInputCentered(mm2px(Vec(42.838, 101.466)), module, CV_MIDICC::CC_INPUTS + 11)); + addInput(createInputCentered(mm2px(Vec(8.189, 112.998)), module, CV_MIDICC::CC_INPUTS + 12)); + addInput(createInputCentered(mm2px(Vec(19.739, 112.984)), module, CV_MIDICC::CC_INPUTS + 13)); + addInput(createInputCentered(mm2px(Vec(31.289, 112.984)), module, CV_MIDICC::CC_INPUTS + 14)); + addInput(createInputCentered(mm2px(Vec(42.838, 112.984)), module, CV_MIDICC::CC_INPUTS + 15)); + + typedef Grid16MidiWidget> TMidiWidget; + TMidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); + midiWidget->box.size = mm2px(Vec(50.8, 55.88)); midiWidget->setMidiPort(module ? &module->midiOutput : NULL); midiWidget->setModule(module); addChild(midiWidget); @@ -159,7 +159,7 @@ struct CV_CCWidget : ModuleWidget { }; -Model* modelCV_CC = createModel("CV-CC"); +Model* modelCV_MIDICC = createModel("CV-CC"); } // namespace core diff --git a/src/core/CV_Gate.cpp b/src/core/Gate_MIDI.cpp similarity index 65% rename from src/core/CV_Gate.cpp rename to src/core/Gate_MIDI.cpp index ee375c71..6d9b1c70 100644 --- a/src/core/CV_Gate.cpp +++ b/src/core/Gate_MIDI.cpp @@ -68,7 +68,7 @@ struct GateMidiOutput : midi::Output { }; -struct CV_Gate : Module { +struct Gate_MIDI : Module { enum ParamIds { NUM_PARAMS }; @@ -88,7 +88,7 @@ struct CV_Gate : Module { int learningId = -1; uint8_t learnedNotes[16] = {}; - CV_Gate() { + Gate_MIDI() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); for (int i = 0; i < 16; i++) configInput(GATE_INPUTS + i, string::f("Cell %d", i + 1)); @@ -162,43 +162,43 @@ struct CV_Gate : Module { }; -struct CV_GateWidget : ModuleWidget { - CV_GateWidget(CV_Gate* module) { +struct Gate_MIDIWidget : ModuleWidget { + Gate_MIDIWidget(Gate_MIDI* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/CV-Gate.svg"))); + setPanel(Svg::load(asset::system("res/Core/Gate_MIDI.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addInput(createInputCentered(mm2px(Vec(8, 77)), module, CV_Gate::GATE_INPUTS + 0)); - addInput(createInputCentered(mm2px(Vec(20, 77)), module, CV_Gate::GATE_INPUTS + 1)); - addInput(createInputCentered(mm2px(Vec(31, 77)), module, CV_Gate::GATE_INPUTS + 2)); - addInput(createInputCentered(mm2px(Vec(43, 77)), module, CV_Gate::GATE_INPUTS + 3)); - addInput(createInputCentered(mm2px(Vec(8, 89)), module, CV_Gate::GATE_INPUTS + 4)); - addInput(createInputCentered(mm2px(Vec(20, 89)), module, CV_Gate::GATE_INPUTS + 5)); - addInput(createInputCentered(mm2px(Vec(31, 89)), module, CV_Gate::GATE_INPUTS + 6)); - addInput(createInputCentered(mm2px(Vec(43, 89)), module, CV_Gate::GATE_INPUTS + 7)); - addInput(createInputCentered(mm2px(Vec(8, 101)), module, CV_Gate::GATE_INPUTS + 8)); - addInput(createInputCentered(mm2px(Vec(20, 101)), module, CV_Gate::GATE_INPUTS + 9)); - addInput(createInputCentered(mm2px(Vec(31, 101)), module, CV_Gate::GATE_INPUTS + 10)); - addInput(createInputCentered(mm2px(Vec(43, 101)), module, CV_Gate::GATE_INPUTS + 11)); - addInput(createInputCentered(mm2px(Vec(8, 112)), module, CV_Gate::GATE_INPUTS + 12)); - addInput(createInputCentered(mm2px(Vec(20, 112)), module, CV_Gate::GATE_INPUTS + 13)); - addInput(createInputCentered(mm2px(Vec(31, 112)), module, CV_Gate::GATE_INPUTS + 14)); - addInput(createInputCentered(mm2px(Vec(43, 112)), module, CV_Gate::GATE_INPUTS + 15)); - - typedef Grid16MidiWidget> TMidiWidget; - TMidiWidget* midiWidget = createWidget(mm2px(Vec(3.399621, 14.837339))); - midiWidget->box.size = mm2px(Vec(44, 54.667)); + addInput(createInputCentered(mm2px(Vec(9.137, 78.431)), module, Gate_MIDI::GATE_INPUTS + 0)); + addInput(createInputCentered(mm2px(Vec(20.686, 78.431)), module, Gate_MIDI::GATE_INPUTS + 1)); + addInput(createInputCentered(mm2px(Vec(32.236, 78.431)), module, Gate_MIDI::GATE_INPUTS + 2)); + addInput(createInputCentered(mm2px(Vec(43.786, 78.431)), module, Gate_MIDI::GATE_INPUTS + 3)); + addInput(createInputCentered(mm2px(Vec(9.137, 89.946)), module, Gate_MIDI::GATE_INPUTS + 4)); + addInput(createInputCentered(mm2px(Vec(20.686, 89.946)), module, Gate_MIDI::GATE_INPUTS + 5)); + addInput(createInputCentered(mm2px(Vec(32.236, 89.946)), module, Gate_MIDI::GATE_INPUTS + 6)); + addInput(createInputCentered(mm2px(Vec(43.786, 89.946)), module, Gate_MIDI::GATE_INPUTS + 7)); + addInput(createInputCentered(mm2px(Vec(9.137, 101.466)), module, Gate_MIDI::GATE_INPUTS + 8)); + addInput(createInputCentered(mm2px(Vec(20.686, 101.466)), module, Gate_MIDI::GATE_INPUTS + 9)); + addInput(createInputCentered(mm2px(Vec(32.236, 101.466)), module, Gate_MIDI::GATE_INPUTS + 10)); + addInput(createInputCentered(mm2px(Vec(43.786, 101.466)), module, Gate_MIDI::GATE_INPUTS + 11)); + addInput(createInputCentered(mm2px(Vec(9.137, 112.998)), module, Gate_MIDI::GATE_INPUTS + 12)); + addInput(createInputCentered(mm2px(Vec(20.686, 112.984)), module, Gate_MIDI::GATE_INPUTS + 13)); + addInput(createInputCentered(mm2px(Vec(32.236, 112.984)), module, Gate_MIDI::GATE_INPUTS + 14)); + addInput(createInputCentered(mm2px(Vec(43.786, 112.984)), module, Gate_MIDI::GATE_INPUTS + 15)); + + typedef Grid16MidiWidget> TMidiWidget; + TMidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); + midiWidget->box.size = mm2px(Vec(50.8, 55.88)); midiWidget->setMidiPort(module ? &module->midiOutput : NULL); midiWidget->setModule(module); addChild(midiWidget); } void appendContextMenu(Menu* menu) override { - CV_Gate* module = dynamic_cast(this->module); + Gate_MIDI* module = dynamic_cast(this->module); menu->addChild(new MenuSeparator); @@ -211,7 +211,7 @@ struct CV_GateWidget : ModuleWidget { }; -Model* modelCV_Gate = createModel("CV-Gate"); +Model* modelGate_MIDI = createModel("CV-Gate"); } // namespace core diff --git a/src/core/MIDI_CC.cpp b/src/core/MIDICC_CV.cpp similarity index 86% rename from src/core/MIDI_CC.cpp rename to src/core/MIDICC_CV.cpp index 0dca1802..917984ec 100644 --- a/src/core/MIDI_CC.cpp +++ b/src/core/MIDICC_CV.cpp @@ -5,7 +5,7 @@ namespace rack { namespace core { -struct MIDI_CC : Module { +struct MIDICC_CV : Module { enum ParamIds { NUM_PARAMS }; @@ -36,7 +36,7 @@ struct MIDI_CC : Module { bool mpeMode; bool lsbMode; - MIDI_CC() { + MIDICC_CV() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); for (int i = 0; i < 16; i++) configOutput(CC_OUTPUT + i, string::f("Cell %d", i + 1)); @@ -211,34 +211,34 @@ struct MIDI_CC : Module { }; -struct MIDI_CCWidget : ModuleWidget { - MIDI_CCWidget(MIDI_CC* module) { +struct MIDICC_CVWidget : ModuleWidget { + MIDICC_CVWidget(MIDICC_CV* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI CC-CV.svg"))); + setPanel(Svg::load(asset::system("res/Core/MIDICC_CV.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDI_CC::CC_OUTPUT + 0)); - addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDI_CC::CC_OUTPUT + 1)); - addOutput(createOutputCentered(mm2px(Vec(31.289, 78.431)), module, MIDI_CC::CC_OUTPUT + 2)); - addOutput(createOutputCentered(mm2px(Vec(42.838, 78.431)), module, MIDI_CC::CC_OUTPUT + 3)); - addOutput(createOutputCentered(mm2px(Vec(8.189, 89.946)), module, MIDI_CC::CC_OUTPUT + 4)); - addOutput(createOutputCentered(mm2px(Vec(19.739, 89.946)), module, MIDI_CC::CC_OUTPUT + 5)); - addOutput(createOutputCentered(mm2px(Vec(31.289, 89.946)), module, MIDI_CC::CC_OUTPUT + 6)); - addOutput(createOutputCentered(mm2px(Vec(42.838, 89.946)), module, MIDI_CC::CC_OUTPUT + 7)); - addOutput(createOutputCentered(mm2px(Vec(8.189, 101.466)), module, MIDI_CC::CC_OUTPUT + 8)); - addOutput(createOutputCentered(mm2px(Vec(19.739, 101.466)), module, MIDI_CC::CC_OUTPUT + 9)); - addOutput(createOutputCentered(mm2px(Vec(31.289, 101.466)), module, MIDI_CC::CC_OUTPUT + 10)); - addOutput(createOutputCentered(mm2px(Vec(42.838, 101.466)), module, MIDI_CC::CC_OUTPUT + 11)); - addOutput(createOutputCentered(mm2px(Vec(8.19, 112.998)), module, MIDI_CC::CC_OUTPUT + 12)); - addOutput(createOutputCentered(mm2px(Vec(19.739, 112.984)), module, MIDI_CC::CC_OUTPUT + 13)); - addOutput(createOutputCentered(mm2px(Vec(31.289, 112.984)), module, MIDI_CC::CC_OUTPUT + 14)); - addOutput(createOutputCentered(mm2px(Vec(42.839, 112.984)), module, MIDI_CC::CC_OUTPUT + 15)); - - typedef Grid16MidiWidget> TMidiWidget; + addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDICC_CV::CC_OUTPUT + 0)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDICC_CV::CC_OUTPUT + 1)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 78.431)), module, MIDICC_CV::CC_OUTPUT + 2)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 78.431)), module, MIDICC_CV::CC_OUTPUT + 3)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 89.946)), module, MIDICC_CV::CC_OUTPUT + 4)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 89.946)), module, MIDICC_CV::CC_OUTPUT + 5)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 89.946)), module, MIDICC_CV::CC_OUTPUT + 6)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 89.946)), module, MIDICC_CV::CC_OUTPUT + 7)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 101.466)), module, MIDICC_CV::CC_OUTPUT + 8)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 101.466)), module, MIDICC_CV::CC_OUTPUT + 9)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 101.466)), module, MIDICC_CV::CC_OUTPUT + 10)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 101.466)), module, MIDICC_CV::CC_OUTPUT + 11)); + addOutput(createOutputCentered(mm2px(Vec(8.19, 112.998)), module, MIDICC_CV::CC_OUTPUT + 12)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 112.984)), module, MIDICC_CV::CC_OUTPUT + 13)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 112.984)), module, MIDICC_CV::CC_OUTPUT + 14)); + addOutput(createOutputCentered(mm2px(Vec(42.839, 112.984)), module, MIDICC_CV::CC_OUTPUT + 15)); + + typedef Grid16MidiWidget> TMidiWidget; TMidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); midiWidget->box.size = mm2px(Vec(50.8, 55.88)); midiWidget->setMidiPort(module ? &module->midiInput : NULL); @@ -247,7 +247,7 @@ struct MIDI_CCWidget : ModuleWidget { } void appendContextMenu(Menu* menu) override { - MIDI_CC* module = dynamic_cast(this->module); + MIDICC_CV* module = dynamic_cast(this->module); menu->addChild(new MenuSeparator); @@ -261,7 +261,7 @@ struct MIDI_CCWidget : ModuleWidget { // Use legacy slug for compatibility -Model* modelMIDI_CC = createModel("MIDICCToCVInterface"); +Model* modelMIDICC_CV = createModel("MIDICCToCVInterface"); } // namespace core diff --git a/src/core/MIDI_Map.cpp b/src/core/MIDIMap.cpp similarity index 93% rename from src/core/MIDI_Map.cpp rename to src/core/MIDIMap.cpp index 449b7205..60d60b1a 100644 --- a/src/core/MIDI_Map.cpp +++ b/src/core/MIDIMap.cpp @@ -8,7 +8,7 @@ namespace core { static const int MAX_CHANNELS = 128; -struct MIDI_Map : Module { +struct MIDIMap : Module { enum ParamIds { NUM_PARAMS }; @@ -46,7 +46,7 @@ struct MIDI_Map : Module { bool filterInitialized[MAX_CHANNELS] = {}; dsp::ClockDivider divider; - MIDI_Map() { + MIDIMap() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); for (int id = 0; id < MAX_CHANNELS; id++) { paramHandles[id].color = nvgRGB(0xff, 0xff, 0x40); @@ -59,7 +59,7 @@ struct MIDI_Map : Module { onReset(); } - ~MIDI_Map() { + ~MIDIMap() { for (int id = 0; id < MAX_CHANNELS; id++) { APP->engine->removeParamHandle(¶mHandles[id]); } @@ -288,12 +288,12 @@ struct MIDI_Map : Module { }; -struct MIDI_MapChoice : LedDisplayChoice { - MIDI_Map* module; +struct MIDIMapChoice : LedDisplayChoice { + MIDIMap* module; int id; int disableLearnFrames = -1; - void setModule(MIDI_Map* module) { + void setModule(MIDIMap* module) { this->module = module; } @@ -416,13 +416,13 @@ struct MIDI_MapChoice : LedDisplayChoice { }; -struct MIDI_MapDisplay : MidiWidget { - MIDI_Map* module; +struct MIDIMapDisplay : MidiWidget { + MIDIMap* module; ScrollWidget* scroll; - MIDI_MapChoice* choices[MAX_CHANNELS]; + MIDIMapChoice* choices[MAX_CHANNELS]; LedDisplaySeparator* separators[MAX_CHANNELS]; - void setModule(MIDI_Map* module) { + void setModule(MIDIMap* module) { this->module = module; scroll = new ScrollWidget; @@ -445,7 +445,7 @@ struct MIDI_MapDisplay : MidiWidget { separators[id] = separator; } - MIDI_MapChoice* choice = createWidget(pos); + MIDIMapChoice* choice = createWidget(pos); choice->box.size.x = box.size.x; choice->id = id; choice->setModule(module); @@ -470,25 +470,25 @@ struct MIDI_MapDisplay : MidiWidget { }; -struct MIDI_MapWidget : ModuleWidget { - MIDI_MapWidget(MIDI_Map* module) { +struct MIDIMapWidget : ModuleWidget { + MIDIMapWidget(MIDIMap* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI-Map.svg"))); + setPanel(Svg::load(asset::system("res/Core/MIDIMap.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - MIDI_MapDisplay* midiWidget = createWidget(mm2px(Vec(3.41891, 14.8373))); - midiWidget->box.size = mm2px(Vec(43.999, 102.664)); + MIDIMapDisplay* midiWidget = createWidget(mm2px(Vec(0.0, 12.869))); + midiWidget->box.size = mm2px(Vec(50.8, 105.567)); midiWidget->setMidiPort(module ? &module->midiInput : NULL); midiWidget->setModule(module); addChild(midiWidget); } void appendContextMenu(Menu* menu) override { - MIDI_Map* module = dynamic_cast(this->module); + MIDIMap* module = dynamic_cast(this->module); menu->addChild(new MenuSeparator); @@ -497,7 +497,7 @@ struct MIDI_MapWidget : ModuleWidget { }; -Model* modelMIDI_Map = createModel("MIDI-Map"); +Model* modelMIDIMap = createModel("MIDI-Map"); } // namespace core diff --git a/src/core/MIDI_CV.cpp b/src/core/MIDI_CV.cpp index 8543e1fe..00cc5193 100644 --- a/src/core/MIDI_CV.cpp +++ b/src/core/MIDI_CV.cpp @@ -470,7 +470,7 @@ struct MIDI_CV : Module { struct MIDI_CVWidget : ModuleWidget { MIDI_CVWidget(MIDI_CV* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI-CV.svg"))); + setPanel(Svg::load(asset::system("res/Core/MIDI_CV.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); diff --git a/src/core/MIDI_Gate.cpp b/src/core/MIDI_Gate.cpp index 46561823..022773ec 100644 --- a/src/core/MIDI_Gate.cpp +++ b/src/core/MIDI_Gate.cpp @@ -182,7 +182,7 @@ struct MIDI_Gate : Module { struct MIDI_GateWidget : ModuleWidget { MIDI_GateWidget(MIDI_Gate* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI-Gate.svg"))); + setPanel(Svg::load(asset::system("res/Core/MIDI_Gate.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index 1112ee99..2eaa0e1c 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -6,16 +6,16 @@ namespace core { void init(rack::Plugin* p) { - p->addModel(modelAudioInterface2); - p->addModel(modelAudioInterface); - p->addModel(modelAudioInterface16); + p->addModel(modelAudio2); + p->addModel(modelAudio8); + p->addModel(modelAudio16); p->addModel(modelMIDI_CV); - p->addModel(modelMIDI_CC); + p->addModel(modelMIDICC_CV); p->addModel(modelMIDI_Gate); - p->addModel(modelMIDI_Map); + p->addModel(modelMIDIMap); p->addModel(modelCV_MIDI); - p->addModel(modelCV_CC); - p->addModel(modelCV_Gate); + p->addModel(modelCV_MIDICC); + p->addModel(modelGate_MIDI); p->addModel(modelBlank); p->addModel(modelNotes); } diff --git a/src/core/plugin.hpp b/src/core/plugin.hpp index 251eaad0..080ee1c1 100644 --- a/src/core/plugin.hpp +++ b/src/core/plugin.hpp @@ -5,16 +5,16 @@ namespace rack { namespace core { -extern Model* modelAudioInterface2; -extern Model* modelAudioInterface; -extern Model* modelAudioInterface16; +extern Model* modelAudio2; +extern Model* modelAudio8; +extern Model* modelAudio16; extern Model* modelMIDI_CV; -extern Model* modelMIDI_CC; +extern Model* modelMIDICC_CV; extern Model* modelMIDI_Gate; -extern Model* modelMIDI_Map; +extern Model* modelMIDIMap; extern Model* modelCV_MIDI; -extern Model* modelCV_CC; -extern Model* modelCV_Gate; +extern Model* modelCV_MIDICC; +extern Model* modelGate_MIDI; extern Model* modelBlank; extern Model* modelNotes;