| @@ -282,36 +282,36 @@ Menu *ModuleWidget::createContextMenu() { | |||
| MenuLabel *menuLabel = new MenuLabel(); | |||
| menuLabel->text = model->manufacturer + " " + model->name; | |||
| menu->pushChild(menuLabel); | |||
| menu->addChild(menuLabel); | |||
| ResetMenuItem *resetItem = new ResetMenuItem(); | |||
| resetItem->text = "Initialize"; | |||
| resetItem->rightText = GUI_MOD_KEY_NAME "+I"; | |||
| resetItem->moduleWidget = this; | |||
| menu->pushChild(resetItem); | |||
| menu->addChild(resetItem); | |||
| RandomizeMenuItem *randomizeItem = new RandomizeMenuItem(); | |||
| randomizeItem->text = "Randomize"; | |||
| randomizeItem->rightText = GUI_MOD_KEY_NAME "+R"; | |||
| randomizeItem->moduleWidget = this; | |||
| menu->pushChild(randomizeItem); | |||
| menu->addChild(randomizeItem); | |||
| DisconnectMenuItem *disconnectItem = new DisconnectMenuItem(); | |||
| disconnectItem->text = "Disconnect cables"; | |||
| disconnectItem->moduleWidget = this; | |||
| menu->pushChild(disconnectItem); | |||
| menu->addChild(disconnectItem); | |||
| CloneMenuItem *cloneItem = new CloneMenuItem(); | |||
| cloneItem->text = "Duplicate"; | |||
| cloneItem->rightText = GUI_MOD_KEY_NAME "+D"; | |||
| cloneItem->moduleWidget = this; | |||
| menu->pushChild(cloneItem); | |||
| menu->addChild(cloneItem); | |||
| DeleteMenuItem *deleteItem = new DeleteMenuItem(); | |||
| deleteItem->text = "Delete"; | |||
| deleteItem->rightText = "Backspace/Delete"; | |||
| deleteItem->moduleWidget = this; | |||
| menu->pushChild(deleteItem); | |||
| menu->addChild(deleteItem); | |||
| return menu; | |||
| } | |||
| @@ -43,11 +43,11 @@ struct FileChoice : ChoiceButton { | |||
| menu->box.size.x = box.size.x; | |||
| { | |||
| menu->pushChild(construct<NewItem>(&MenuItem::text, "New", &MenuItem::rightText, GUI_MOD_KEY_NAME "+N")); | |||
| menu->pushChild(construct<OpenItem>(&MenuItem::text, "Open", &MenuItem::rightText, GUI_MOD_KEY_NAME "+O")); | |||
| menu->pushChild(construct<SaveItem>(&MenuItem::text, "Save", &MenuItem::rightText, GUI_MOD_KEY_NAME "+S")); | |||
| menu->pushChild(construct<SaveAsItem>(&MenuItem::text, "Save as", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Shift+S")); | |||
| menu->pushChild(construct<QuitItem>(&MenuItem::text, "Quit", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Q")); | |||
| menu->addChild(construct<NewItem>(&MenuItem::text, "New", &MenuItem::rightText, GUI_MOD_KEY_NAME "+N")); | |||
| menu->addChild(construct<OpenItem>(&MenuItem::text, "Open", &MenuItem::rightText, GUI_MOD_KEY_NAME "+O")); | |||
| menu->addChild(construct<SaveItem>(&MenuItem::text, "Save", &MenuItem::rightText, GUI_MOD_KEY_NAME "+S")); | |||
| menu->addChild(construct<SaveAsItem>(&MenuItem::text, "Save as", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Shift+S")); | |||
| menu->addChild(construct<QuitItem>(&MenuItem::text, "Quit", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Q")); | |||
| } | |||
| } | |||
| }; | |||
| @@ -75,7 +75,7 @@ struct SampleRateChoice : ChoiceButton { | |||
| PauseItem *pauseItem = new PauseItem(); | |||
| pauseItem->text = gPaused ? "Resume engine" : "Pause engine"; | |||
| menu->pushChild(pauseItem); | |||
| menu->addChild(pauseItem); | |||
| float sampleRates[] = {44100, 48000, 88200, 96000, 176400, 192000}; | |||
| int sampleRatesLen = sizeof(sampleRates) / sizeof(sampleRates[0]); | |||
| @@ -83,7 +83,7 @@ struct SampleRateChoice : ChoiceButton { | |||
| SampleRateItem *item = new SampleRateItem(); | |||
| item->text = stringf("%.0f Hz", sampleRates[i]); | |||
| item->sampleRate = sampleRates[i]; | |||
| menu->pushChild(item); | |||
| menu->addChild(item); | |||
| } | |||
| } | |||
| void step() override { | |||
| @@ -414,7 +414,7 @@ struct AudioDriverChoice : ChoiceButton { | |||
| audioItem->audioInterface = audioInterface; | |||
| audioItem->driver = driver; | |||
| audioItem->text = audioInterface->getDriverName(driver); | |||
| menu->pushChild(audioItem); | |||
| menu->addChild(audioItem); | |||
| } | |||
| } | |||
| void step() override { | |||
| @@ -446,14 +446,14 @@ struct AudioDeviceChoice : ChoiceButton { | |||
| audioItem->audioInterface = audioInterface; | |||
| audioItem->device = -1; | |||
| audioItem->text = "No device"; | |||
| menu->pushChild(audioItem); | |||
| menu->addChild(audioItem); | |||
| } | |||
| for (int device = 0; device < deviceCount; device++) { | |||
| AudioDeviceItem *audioItem = new AudioDeviceItem(); | |||
| audioItem->audioInterface = audioInterface; | |||
| audioItem->device = device; | |||
| audioItem->text = audioInterface->getDeviceName(device); | |||
| menu->pushChild(audioItem); | |||
| menu->addChild(audioItem); | |||
| } | |||
| } | |||
| void step() override { | |||
| @@ -487,7 +487,7 @@ struct SampleRateChoice : ChoiceButton { | |||
| item->audioInterface = audioInterface; | |||
| item->sampleRate = sampleRate; | |||
| item->text = stringf("%.0f Hz", sampleRate); | |||
| menu->pushChild(item); | |||
| menu->addChild(item); | |||
| } | |||
| } | |||
| void step() override { | |||
| @@ -519,7 +519,7 @@ struct BlockSizeChoice : ChoiceButton { | |||
| item->audioInterface = audioInterface; | |||
| item->blockSize = blockSizes[i]; | |||
| item->text = stringf("%d", blockSizes[i]); | |||
| menu->pushChild(item); | |||
| menu->addChild(item); | |||
| } | |||
| } | |||
| void step() override { | |||
| @@ -1,9 +1,9 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| struct CCValue { | |||
| int val = 0; // Controller value | |||
| TransitionSmoother tSmooth; | |||
| @@ -1,10 +1,10 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| #include "dsp/digital.hpp" | |||
| using namespace rack; | |||
| struct MIDIClockToCVInterface : MidiIO, Module { | |||
| @@ -236,7 +236,7 @@ struct ClockRatioChoice : ChoiceButton { | |||
| clockRatioItem->ratio = ratio; | |||
| clockRatioItem->clockRatio = clockRatio; | |||
| clockRatioItem->text = ratioNames[ratio]; | |||
| menu->pushChild(clockRatioItem); | |||
| menu->addChild(clockRatioItem); | |||
| } | |||
| } | |||
| @@ -1,9 +1,9 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| using namespace rack; | |||
| @@ -209,7 +209,7 @@ void MidiChoice::onAction(EventAction &e) { | |||
| MidiItem *midiItem = new MidiItem(); | |||
| midiItem->midiModule = midiModule; | |||
| midiItem->text = ""; | |||
| menu->pushChild(midiItem); | |||
| menu->addChild(midiItem); | |||
| } | |||
| std::vector<std::string> deviceNames = midiModule->getDevices(); | |||
| @@ -217,7 +217,7 @@ void MidiChoice::onAction(EventAction &e) { | |||
| MidiItem *midiItem = new MidiItem(); | |||
| midiItem->midiModule = midiModule; | |||
| midiItem->text = deviceNames[i]; | |||
| menu->pushChild(midiItem); | |||
| menu->addChild(midiItem); | |||
| } | |||
| } | |||
| @@ -245,14 +245,14 @@ void ChannelChoice::onAction(EventAction &e) { | |||
| channelItem->midiModule = midiModule; | |||
| channelItem->channel = -1; | |||
| channelItem->text = "All"; | |||
| menu->pushChild(channelItem); | |||
| menu->addChild(channelItem); | |||
| } | |||
| for (int channel = 0; channel < 16; channel++) { | |||
| ChannelItem *channelItem = new ChannelItem(); | |||
| channelItem->midiModule = midiModule; | |||
| channelItem->channel = channel; | |||
| channelItem->text = stringf("%d", channel + 1); | |||
| menu->pushChild(channelItem); | |||
| menu->addChild(channelItem); | |||
| } | |||
| } | |||
| @@ -1,6 +1,10 @@ | |||
| #include <unordered_map> | |||
| #include "rack.hpp" | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wsuggest-override" | |||
| #include "rtmidi/RtMidi.h" | |||
| #pragma GCC diagnostic pop | |||
| using namespace rack; | |||
| @@ -1,10 +1,10 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| #include "dsp/digital.hpp" | |||
| /* | |||
| * MIDIToCVInterface converts midi note on/off events, velocity , channel aftertouch, pitch wheel and mod wheel to | |||
| * CV | |||
| @@ -1,10 +1,10 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| #include "dsp/digital.hpp" | |||
| using namespace rack; | |||
| struct TriggerValue { | |||
| @@ -1,10 +1,10 @@ | |||
| #include <list> | |||
| #include <algorithm> | |||
| #include "rtmidi/RtMidi.h" | |||
| #include "core.hpp" | |||
| #include "MidiIO.hpp" | |||
| #include "dsp/digital.hpp" | |||
| struct MidiKey { | |||
| int pitch = 60; | |||
| int at = 0; // aftertouch | |||
| @@ -254,7 +254,7 @@ struct ModeItem : MenuItem { | |||
| int mode; | |||
| QuadMIDIToCVInterface *module; | |||
| void onAction(EventAction &e) { | |||
| void onAction(EventAction &e) override { | |||
| module->setMode(mode); | |||
| } | |||
| }; | |||
| @@ -264,7 +264,7 @@ struct ModeChoice : ChoiceButton { | |||
| const std::vector<std::string> modeNames = {"ROTATE", "RESET", "REASSIGN"}; | |||
| void onAction(EventAction &e) { | |||
| void onAction(EventAction &e) override { | |||
| Menu *menu = gScene->createMenu(); | |||
| menu->box.pos = getAbsoluteOffset(Vec(0, box.size.y)).round(); | |||
| menu->box.size.x = box.size.x; | |||
| @@ -274,11 +274,11 @@ struct ModeChoice : ChoiceButton { | |||
| modeItem->mode = i; | |||
| modeItem->module = module; | |||
| modeItem->text = modeNames[i]; | |||
| menu->pushChild(modeItem); | |||
| menu->addChild(modeItem); | |||
| } | |||
| } | |||
| void step() { | |||
| void step() override { | |||
| text = modeNames[module->getMode()]; | |||
| } | |||
| }; | |||