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