From 60c8c786f6f07fc66a84282f6b0d671bf0c6d9a5 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 8 Dec 2017 08:00:03 -0500 Subject: [PATCH] Clean up warnings --- src/app/ModuleWidget.cpp | 12 ++++++------ src/app/Toolbar.cpp | 14 +++++++------- src/core/AudioInterface.cpp | 10 +++++----- src/core/MidiCCToCV.cpp | 2 +- src/core/MidiClockToCV.cpp | 4 ++-- src/core/MidiIO.cpp | 10 +++++----- src/core/MidiIO.hpp | 4 ++++ src/core/MidiToCV.cpp | 2 +- src/core/MidiTriggerToCV.cpp | 2 +- src/core/QuadMidiToCV.cpp | 10 +++++----- 10 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 8c04a89b..7de226f6 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -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; } diff --git a/src/app/Toolbar.cpp b/src/app/Toolbar.cpp index 4414b2ee..6fe03649 100644 --- a/src/app/Toolbar.cpp +++ b/src/app/Toolbar.cpp @@ -43,11 +43,11 @@ struct FileChoice : ChoiceButton { menu->box.size.x = box.size.x; { - menu->pushChild(construct(&MenuItem::text, "New", &MenuItem::rightText, GUI_MOD_KEY_NAME "+N")); - menu->pushChild(construct(&MenuItem::text, "Open", &MenuItem::rightText, GUI_MOD_KEY_NAME "+O")); - menu->pushChild(construct(&MenuItem::text, "Save", &MenuItem::rightText, GUI_MOD_KEY_NAME "+S")); - menu->pushChild(construct(&MenuItem::text, "Save as", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Shift+S")); - menu->pushChild(construct(&MenuItem::text, "Quit", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Q")); + menu->addChild(construct(&MenuItem::text, "New", &MenuItem::rightText, GUI_MOD_KEY_NAME "+N")); + menu->addChild(construct(&MenuItem::text, "Open", &MenuItem::rightText, GUI_MOD_KEY_NAME "+O")); + menu->addChild(construct(&MenuItem::text, "Save", &MenuItem::rightText, GUI_MOD_KEY_NAME "+S")); + menu->addChild(construct(&MenuItem::text, "Save as", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Shift+S")); + menu->addChild(construct(&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 { diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index 4f6b5159..937ace0d 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -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 { diff --git a/src/core/MidiCCToCV.cpp b/src/core/MidiCCToCV.cpp index 706b84b8..a5f42fa1 100644 --- a/src/core/MidiCCToCV.cpp +++ b/src/core/MidiCCToCV.cpp @@ -1,9 +1,9 @@ #include #include -#include "rtmidi/RtMidi.h" #include "core.hpp" #include "MidiIO.hpp" + struct CCValue { int val = 0; // Controller value TransitionSmoother tSmooth; diff --git a/src/core/MidiClockToCV.cpp b/src/core/MidiClockToCV.cpp index 8e3f5516..543ab370 100644 --- a/src/core/MidiClockToCV.cpp +++ b/src/core/MidiClockToCV.cpp @@ -1,10 +1,10 @@ #include #include -#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); } } diff --git a/src/core/MidiIO.cpp b/src/core/MidiIO.cpp index 2ca166ee..efd4fcd7 100644 --- a/src/core/MidiIO.cpp +++ b/src/core/MidiIO.cpp @@ -1,9 +1,9 @@ #include #include -#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 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); } } diff --git a/src/core/MidiIO.hpp b/src/core/MidiIO.hpp index 5148c5fa..0c1d8899 100644 --- a/src/core/MidiIO.hpp +++ b/src/core/MidiIO.hpp @@ -1,6 +1,10 @@ #include #include "rack.hpp" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" #include "rtmidi/RtMidi.h" +#pragma GCC diagnostic pop using namespace rack; diff --git a/src/core/MidiToCV.cpp b/src/core/MidiToCV.cpp index 69be33be..4a417ba6 100644 --- a/src/core/MidiToCV.cpp +++ b/src/core/MidiToCV.cpp @@ -1,10 +1,10 @@ #include #include -#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 diff --git a/src/core/MidiTriggerToCV.cpp b/src/core/MidiTriggerToCV.cpp index ec0f11db..2503745a 100644 --- a/src/core/MidiTriggerToCV.cpp +++ b/src/core/MidiTriggerToCV.cpp @@ -1,10 +1,10 @@ #include #include -#include "rtmidi/RtMidi.h" #include "core.hpp" #include "MidiIO.hpp" #include "dsp/digital.hpp" + using namespace rack; struct TriggerValue { diff --git a/src/core/QuadMidiToCV.cpp b/src/core/QuadMidiToCV.cpp index 39982913..7df68601 100644 --- a/src/core/QuadMidiToCV.cpp +++ b/src/core/QuadMidiToCV.cpp @@ -1,10 +1,10 @@ #include #include -#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 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()]; } };