@@ -29,14 +29,14 @@ struct SVGPanel : FramebufferWidget { | |||||
} | } | ||||
void setBackground(std::shared_ptr<SVG> svg) { | void setBackground(std::shared_ptr<SVG> svg) { | ||||
SVGWidget *sw = new SVGWidget(); | |||||
SVGWidget *sw = new SVGWidget; | |||||
sw->setSVG(svg); | sw->setSVG(svg); | ||||
addChild(sw); | addChild(sw); | ||||
// Set size | // Set size | ||||
box.size = sw->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE); | box.size = sw->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE); | ||||
PanelBorder *pb = new PanelBorder(); | |||||
PanelBorder *pb = new PanelBorder; | |||||
pb->box.size = box.size; | pb->box.size = box.size; | ||||
addChild(pb); | addChild(pb); | ||||
} | } | ||||
@@ -88,7 +88,7 @@ Example: | |||||
*/ | */ | ||||
template<typename T> | template<typename T> | ||||
T *construct() { | T *construct() { | ||||
return new T(); | |||||
return new T; | |||||
} | } | ||||
template<typename T, typename F, typename V, typename... Args> | template<typename T, typename F, typename V, typename... Args> | ||||
@@ -284,7 +284,7 @@ struct SynthTechAlco : SVGKnob { | |||||
minAngle = -0.82*M_PI; | minAngle = -0.82*M_PI; | ||||
maxAngle = 0.82*M_PI; | maxAngle = 0.82*M_PI; | ||||
setSVG(SVG::load(asset::global("res/ComponentLibrary/SynthTechAlco.svg"))); | setSVG(SVG::load(asset::global("res/ComponentLibrary/SynthTechAlco.svg"))); | ||||
SVGWidget *cap = new SVGWidget(); | |||||
SVGWidget *cap = new SVGWidget; | |||||
cap->setSVG(SVG::load(asset::global("res/ComponentLibrary/SynthTechAlco_cap.svg"))); | cap->setSVG(SVG::load(asset::global("res/ComponentLibrary/SynthTechAlco_cap.svg"))); | ||||
addChild(cap); | addChild(cap); | ||||
} | } | ||||
@@ -11,11 +11,11 @@ template <class TModule, class TModuleWidget, typename... Tags> | |||||
Model *createModel(std::string author, std::string slug, std::string name, Tags... tags) { | Model *createModel(std::string author, std::string slug, std::string name, Tags... tags) { | ||||
struct TModel : Model { | struct TModel : Model { | ||||
Module *createModule() override { | Module *createModule() override { | ||||
TModule *o = new TModule(); | |||||
TModule *o = new TModule; | |||||
return o; | return o; | ||||
} | } | ||||
ModuleWidget *createModuleWidget() override { | ModuleWidget *createModuleWidget() override { | ||||
TModule *module = new TModule(); | |||||
TModule *module = new TModule; | |||||
TModuleWidget *o = new TModuleWidget(module); | TModuleWidget *o = new TModuleWidget(module); | ||||
o->model = this; | o->model = this; | ||||
return o; | return o; | ||||
@@ -27,7 +27,7 @@ Model *createModel(std::string author, std::string slug, std::string name, Tags. | |||||
} | } | ||||
}; | }; | ||||
Model *o = new TModel(); | |||||
Model *o = new TModel; | |||||
o->author = author; | o->author = author; | ||||
o->slug = slug; | o->slug = slug; | ||||
o->name = name; | o->name = name; | ||||
@@ -37,14 +37,14 @@ Model *createModel(std::string author, std::string slug, std::string name, Tags. | |||||
template <class TWidget> | template <class TWidget> | ||||
TWidget *createWidget(math::Vec pos) { | TWidget *createWidget(math::Vec pos) { | ||||
TWidget *o = new TWidget(); | |||||
TWidget *o = new TWidget; | |||||
o->box.pos = pos; | o->box.pos = pos; | ||||
return o; | return o; | ||||
} | } | ||||
template <class TParamWidget> | template <class TParamWidget> | ||||
TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { | TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { | ||||
TParamWidget *o = new TParamWidget(); | |||||
TParamWidget *o = new TParamWidget; | |||||
o->box.pos = pos; | o->box.pos = pos; | ||||
o->module = module; | o->module = module; | ||||
o->paramId = paramId; | o->paramId = paramId; | ||||
@@ -55,7 +55,7 @@ TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minV | |||||
template <class TParamWidget> | template <class TParamWidget> | ||||
TParamWidget *createParamCentered(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { | TParamWidget *createParamCentered(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { | ||||
TParamWidget *o = new TParamWidget(); | |||||
TParamWidget *o = new TParamWidget; | |||||
o->box.pos = pos.minus(o->box.size.div(2)); | o->box.pos = pos.minus(o->box.size.div(2)); | ||||
o->module = module; | o->module = module; | ||||
o->paramId = paramId; | o->paramId = paramId; | ||||
@@ -66,7 +66,7 @@ TParamWidget *createParamCentered(math::Vec pos, Module *module, int paramId, fl | |||||
template <class TPort> | template <class TPort> | ||||
TPort *createInput(math::Vec pos, Module *module, int inputId) { | TPort *createInput(math::Vec pos, Module *module, int inputId) { | ||||
TPort *o = new TPort(); | |||||
TPort *o = new TPort; | |||||
o->box.pos = pos; | o->box.pos = pos; | ||||
o->module = module; | o->module = module; | ||||
o->type = Port::INPUT; | o->type = Port::INPUT; | ||||
@@ -76,7 +76,7 @@ TPort *createInput(math::Vec pos, Module *module, int inputId) { | |||||
template <class TPort> | template <class TPort> | ||||
TPort *createInputCentered(math::Vec pos, Module *module, int inputId) { | TPort *createInputCentered(math::Vec pos, Module *module, int inputId) { | ||||
TPort *o = new TPort(); | |||||
TPort *o = new TPort; | |||||
o->box.pos = pos.minus(o->box.size.div(2)); | o->box.pos = pos.minus(o->box.size.div(2)); | ||||
o->module = module; | o->module = module; | ||||
o->type = Port::INPUT; | o->type = Port::INPUT; | ||||
@@ -86,7 +86,7 @@ TPort *createInputCentered(math::Vec pos, Module *module, int inputId) { | |||||
template <class TPort> | template <class TPort> | ||||
TPort *createOutput(math::Vec pos, Module *module, int outputId) { | TPort *createOutput(math::Vec pos, Module *module, int outputId) { | ||||
TPort *o = new TPort(); | |||||
TPort *o = new TPort; | |||||
o->box.pos = pos; | o->box.pos = pos; | ||||
o->module = module; | o->module = module; | ||||
o->type = Port::OUTPUT; | o->type = Port::OUTPUT; | ||||
@@ -96,7 +96,7 @@ TPort *createOutput(math::Vec pos, Module *module, int outputId) { | |||||
template <class TPort> | template <class TPort> | ||||
TPort *createOutputCentered(math::Vec pos, Module *module, int outputId) { | TPort *createOutputCentered(math::Vec pos, Module *module, int outputId) { | ||||
TPort *o = new TPort(); | |||||
TPort *o = new TPort; | |||||
o->box.pos = pos.minus(o->box.size.div(2)); | o->box.pos = pos.minus(o->box.size.div(2)); | ||||
o->module = module; | o->module = module; | ||||
o->type = Port::OUTPUT; | o->type = Port::OUTPUT; | ||||
@@ -106,7 +106,7 @@ TPort *createOutputCentered(math::Vec pos, Module *module, int outputId) { | |||||
template <class TModuleLightWidget> | template <class TModuleLightWidget> | ||||
TModuleLightWidget *createLight(math::Vec pos, Module *module, int firstLightId) { | TModuleLightWidget *createLight(math::Vec pos, Module *module, int firstLightId) { | ||||
TModuleLightWidget *o = new TModuleLightWidget(); | |||||
TModuleLightWidget *o = new TModuleLightWidget; | |||||
o->box.pos = pos; | o->box.pos = pos; | ||||
o->module = module; | o->module = module; | ||||
o->firstLightId = firstLightId; | o->firstLightId = firstLightId; | ||||
@@ -115,7 +115,7 @@ TModuleLightWidget *createLight(math::Vec pos, Module *module, int firstLightId) | |||||
template <class TModuleLightWidget> | template <class TModuleLightWidget> | ||||
TModuleLightWidget *createLightCentered(math::Vec pos, Module *module, int firstLightId) { | TModuleLightWidget *createLightCentered(math::Vec pos, Module *module, int firstLightId) { | ||||
TModuleLightWidget *o = new TModuleLightWidget(); | |||||
TModuleLightWidget *o = new TModuleLightWidget; | |||||
o->box.pos = pos.minus(o->box.size.div(2)); | o->box.pos = pos.minus(o->box.size.div(2)); | ||||
o->module = module; | o->module = module; | ||||
o->firstLightId = firstLightId; | o->firstLightId = firstLightId; | ||||
@@ -124,14 +124,14 @@ TModuleLightWidget *createLightCentered(math::Vec pos, Module *module, int first | |||||
template <class TMenuLabel = MenuLabel> | template <class TMenuLabel = MenuLabel> | ||||
TMenuLabel *createMenuLabel(std::string text) { | TMenuLabel *createMenuLabel(std::string text) { | ||||
TMenuLabel *o = new TMenuLabel(); | |||||
TMenuLabel *o = new TMenuLabel; | |||||
o->text = text; | o->text = text; | ||||
return o; | return o; | ||||
} | } | ||||
template <class TMenuItem = MenuItem> | template <class TMenuItem = MenuItem> | ||||
TMenuItem *createMenuItem(std::string text, std::string rightText = "") { | TMenuItem *createMenuItem(std::string text, std::string rightText = "") { | ||||
TMenuItem *o = new TMenuItem(); | |||||
TMenuItem *o = new TMenuItem; | |||||
o->text = text; | o->text = text; | ||||
o->rightText = rightText; | o->rightText = rightText; | ||||
return o; | return o; | ||||
@@ -139,10 +139,10 @@ TMenuItem *createMenuItem(std::string text, std::string rightText = "") { | |||||
// TODO Reevaluate this. Does it belong here? | // TODO Reevaluate this. Does it belong here? | ||||
inline Menu *createMenu() { | inline Menu *createMenu() { | ||||
Menu *o = new Menu(); | |||||
Menu *o = new Menu; | |||||
o->box.pos = gMousePos; | o->box.pos = gMousePos; | ||||
MenuOverlay *menuOverlay = new MenuOverlay(); | |||||
MenuOverlay *menuOverlay = new MenuOverlay; | |||||
menuOverlay->addChild(o); | menuOverlay->addChild(o); | ||||
gWidgetState->rootWidget->addChild(menuOverlay); | gWidgetState->rootWidget->addChild(menuOverlay); | ||||
@@ -13,11 +13,11 @@ struct IconButton : Button { | |||||
IconButton() { | IconButton() { | ||||
box.size.x = BND_TOOL_WIDTH; | box.size.x = BND_TOOL_WIDTH; | ||||
fw = new FramebufferWidget(); | |||||
fw = new FramebufferWidget; | |||||
fw->oversample = 2; | fw->oversample = 2; | ||||
addChild(fw); | addChild(fw); | ||||
sw = new SVGWidget(); | |||||
sw = new SVGWidget; | |||||
sw->box.pos = math::Vec(2, 2); | sw->box.pos = math::Vec(2, 2); | ||||
fw->addChild(sw); | fw->addChild(sw); | ||||
} | } | ||||
@@ -48,15 +48,15 @@ struct ScrollWidget : OpaqueWidget { | |||||
math::Vec offset; | math::Vec offset; | ||||
ScrollWidget() { | ScrollWidget() { | ||||
container = new Widget(); | |||||
container = new Widget; | |||||
addChild(container); | addChild(container); | ||||
horizontalScrollBar = new ScrollBar(); | |||||
horizontalScrollBar = new ScrollBar; | |||||
horizontalScrollBar->orientation = ScrollBar::HORIZONTAL; | horizontalScrollBar->orientation = ScrollBar::HORIZONTAL; | ||||
horizontalScrollBar->visible = false; | horizontalScrollBar->visible = false; | ||||
addChild(horizontalScrollBar); | addChild(horizontalScrollBar); | ||||
verticalScrollBar = new ScrollBar(); | |||||
verticalScrollBar = new ScrollBar; | |||||
verticalScrollBar->orientation = ScrollBar::VERTICAL; | verticalScrollBar->orientation = ScrollBar::VERTICAL; | ||||
verticalScrollBar->visible = false; | verticalScrollBar->visible = false; | ||||
addChild(verticalScrollBar); | addChild(verticalScrollBar); | ||||
@@ -66,13 +66,13 @@ struct BlankWidget : ModuleWidget { | |||||
box.size = Vec(RACK_GRID_WIDTH * 10, RACK_GRID_HEIGHT); | box.size = Vec(RACK_GRID_WIDTH * 10, RACK_GRID_HEIGHT); | ||||
// { | // { | ||||
// panel = new LightPanel(); | |||||
// panel = new LightPanel; | |||||
// panel->box.size = box.size; | // panel->box.size = box.size; | ||||
// addChild(panel); | // addChild(panel); | ||||
// } | // } | ||||
ModuleResizeHandle *leftHandle = new ModuleResizeHandle(); | |||||
ModuleResizeHandle *rightHandle = new ModuleResizeHandle(); | |||||
ModuleResizeHandle *leftHandle = new ModuleResizeHandle; | |||||
ModuleResizeHandle *rightHandle = new ModuleResizeHandle; | |||||
rightHandle->right = true; | rightHandle->right = true; | ||||
this->rightHandle = rightHandle; | this->rightHandle = rightHandle; | ||||
addChild(leftHandle); | addChild(leftHandle); | ||||
@@ -174,7 +174,7 @@ struct MidiCcChoice : GridChoice { | |||||
struct MidiCcWidget : Grid16MidiWidget { | struct MidiCcWidget : Grid16MidiWidget { | ||||
MIDICCToCVInterface *module; | MIDICCToCVInterface *module; | ||||
GridChoice *createGridChoice() override { | GridChoice *createGridChoice() override { | ||||
MidiCcChoice *gridChoice = new MidiCcChoice(); | |||||
MidiCcChoice *gridChoice = new MidiCcChoice; | |||||
gridChoice->module = module; | gridChoice->module = module; | ||||
return gridChoice; | return gridChoice; | ||||
} | } | ||||
@@ -301,7 +301,7 @@ struct MIDIToCVInterfaceWidget : ModuleWidget { | |||||
MIDIToCVInterface *module; | MIDIToCVInterface *module; | ||||
int index; | int index; | ||||
Menu *createChildMenu() override { | Menu *createChildMenu() override { | ||||
Menu *menu = new Menu(); | |||||
Menu *menu = new Menu; | |||||
std::vector<int> divisions = {24*4, 24*2, 24, 24/2, 24/4, 24/8, 2, 1}; | std::vector<int> divisions = {24*4, 24*2, 24, 24/2, 24/4, 24/8, 2, 1}; | ||||
std::vector<std::string> divisionNames = {"Whole", "Half", "Quarter", "8th", "16th", "32nd", "12 PPQN", "24 PPQN"}; | std::vector<std::string> divisionNames = {"Whole", "Half", "Quarter", "8th", "16th", "32nd", "12 PPQN", "24 PPQN"}; | ||||
for (size_t i = 0; i < divisions.size(); i++) { | for (size_t i = 0; i < divisions.size(); i++) { | ||||
@@ -191,7 +191,7 @@ struct MidiTrigChoice : GridChoice { | |||||
struct MidiTrigWidget : Grid16MidiWidget { | struct MidiTrigWidget : Grid16MidiWidget { | ||||
MIDITriggerToCVInterface *module; | MIDITriggerToCVInterface *module; | ||||
GridChoice *createGridChoice() override { | GridChoice *createGridChoice() override { | ||||
MidiTrigChoice *gridChoice = new MidiTrigChoice(); | |||||
MidiTrigChoice *gridChoice = new MidiTrigChoice; | |||||
gridChoice->module = module; | gridChoice->module = module; | ||||
return gridChoice; | return gridChoice; | ||||
} | } | ||||
@@ -242,7 +242,7 @@ struct MIDITriggerToCVInterfaceWidget : ModuleWidget { | |||||
} | } | ||||
}; | }; | ||||
menu->addChild(new MenuEntry()); | |||||
menu->addChild(new MenuEntry); | |||||
VelocityItem *velocityItem = createMenuItem<VelocityItem>("Velocity", CHECKMARK(module->velocity)); | VelocityItem *velocityItem = createMenuItem<VelocityItem>("Velocity", CHECKMARK(module->velocity)); | ||||
velocityItem->module = module; | velocityItem->module = module; | ||||
menu->addChild(velocityItem); | menu->addChild(velocityItem); | ||||
@@ -343,11 +343,11 @@ struct QuadMIDIToCVInterfaceWidget : ModuleWidget { | |||||
} | } | ||||
}; | }; | ||||
menu->addChild(new MenuEntry()); | |||||
menu->addChild(new MenuEntry); | |||||
menu->addChild(createMenuLabel("Polyphony mode")); | menu->addChild(createMenuLabel("Polyphony mode")); | ||||
auto addPolyphonyItem = [&](QuadMIDIToCVInterface::PolyMode polyMode, std::string name) { | auto addPolyphonyItem = [&](QuadMIDIToCVInterface::PolyMode polyMode, std::string name) { | ||||
PolyphonyItem *item = new PolyphonyItem(); | |||||
PolyphonyItem *item = new PolyphonyItem; | |||||
item->text = name; | item->text = name; | ||||
item->rightText = CHECKMARK(module->polyMode == polyMode); | item->rightText = CHECKMARK(module->polyMode == polyMode); | ||||
item->module = module; | item->module = module; | ||||
@@ -20,7 +20,7 @@ struct AudioDriverChoice : LedDisplayChoice { | |||||
Menu *menu = createMenu(); | Menu *menu = createMenu(); | ||||
menu->addChild(createMenuLabel("Audio driver")); | menu->addChild(createMenuLabel("Audio driver")); | ||||
for (int driver : audioWidget->audioIO->getDrivers()) { | for (int driver : audioWidget->audioIO->getDrivers()) { | ||||
AudioDriverItem *item = new AudioDriverItem(); | |||||
AudioDriverItem *item = new AudioDriverItem; | |||||
item->audioIO = audioWidget->audioIO; | item->audioIO = audioWidget->audioIO; | ||||
item->driver = driver; | item->driver = driver; | ||||
item->text = audioWidget->audioIO->getDriverName(driver); | item->text = audioWidget->audioIO->getDriverName(driver); | ||||
@@ -53,7 +53,7 @@ struct AudioDeviceChoice : LedDisplayChoice { | |||||
menu->addChild(createMenuLabel("Audio device")); | menu->addChild(createMenuLabel("Audio device")); | ||||
int deviceCount = audioWidget->audioIO->getDeviceCount(); | int deviceCount = audioWidget->audioIO->getDeviceCount(); | ||||
{ | { | ||||
AudioDeviceItem *item = new AudioDeviceItem(); | |||||
AudioDeviceItem *item = new AudioDeviceItem; | |||||
item->audioIO = audioWidget->audioIO; | item->audioIO = audioWidget->audioIO; | ||||
item->device = -1; | item->device = -1; | ||||
item->text = "(No device)"; | item->text = "(No device)"; | ||||
@@ -63,7 +63,7 @@ struct AudioDeviceChoice : LedDisplayChoice { | |||||
for (int device = 0; device < deviceCount; device++) { | for (int device = 0; device < deviceCount; device++) { | ||||
int channels = std::min(maxTotalChannels, audioWidget->audioIO->getDeviceChannels(device)); | int channels = std::min(maxTotalChannels, audioWidget->audioIO->getDeviceChannels(device)); | ||||
for (int offset = 0; offset < channels; offset += audioWidget->audioIO->maxChannels) { | for (int offset = 0; offset < channels; offset += audioWidget->audioIO->maxChannels) { | ||||
AudioDeviceItem *item = new AudioDeviceItem(); | |||||
AudioDeviceItem *item = new AudioDeviceItem; | |||||
item->audioIO = audioWidget->audioIO; | item->audioIO = audioWidget->audioIO; | ||||
item->device = device; | item->device = device; | ||||
item->offset = offset; | item->offset = offset; | ||||
@@ -104,7 +104,7 @@ struct AudioSampleRateChoice : LedDisplayChoice { | |||||
menu->addChild(createMenuLabel("(Locked by device)")); | menu->addChild(createMenuLabel("(Locked by device)")); | ||||
} | } | ||||
for (int sampleRate : sampleRates) { | for (int sampleRate : sampleRates) { | ||||
AudioSampleRateItem *item = new AudioSampleRateItem(); | |||||
AudioSampleRateItem *item = new AudioSampleRateItem; | |||||
item->audioIO = audioWidget->audioIO; | item->audioIO = audioWidget->audioIO; | ||||
item->sampleRate = sampleRate; | item->sampleRate = sampleRate; | ||||
item->text = string::stringf("%d Hz", sampleRate); | item->text = string::stringf("%d Hz", sampleRate); | ||||
@@ -136,7 +136,7 @@ struct AudioBlockSizeChoice : LedDisplayChoice { | |||||
menu->addChild(createMenuLabel("(Locked by device)")); | menu->addChild(createMenuLabel("(Locked by device)")); | ||||
} | } | ||||
for (int blockSize : blockSizes) { | for (int blockSize : blockSizes) { | ||||
AudioBlockSizeItem *item = new AudioBlockSizeItem(); | |||||
AudioBlockSizeItem *item = new AudioBlockSizeItem; | |||||
item->audioIO = audioWidget->audioIO; | item->audioIO = audioWidget->audioIO; | ||||
item->blockSize = blockSize; | item->blockSize = blockSize; | ||||
float latency = (float) blockSize / audioWidget->audioIO->sampleRate * 1000.0; | float latency = (float) blockSize / audioWidget->audioIO->sampleRate * 1000.0; | ||||
@@ -20,7 +20,7 @@ struct MidiDriverChoice : LedDisplayChoice { | |||||
Menu *menu = createMenu(); | Menu *menu = createMenu(); | ||||
menu->addChild(createMenuLabel("MIDI driver")); | menu->addChild(createMenuLabel("MIDI driver")); | ||||
for (int driverId : midiWidget->midiIO->getDriverIds()) { | for (int driverId : midiWidget->midiIO->getDriverIds()) { | ||||
MidiDriverItem *item = new MidiDriverItem(); | |||||
MidiDriverItem *item = new MidiDriverItem; | |||||
item->midiIO = midiWidget->midiIO; | item->midiIO = midiWidget->midiIO; | ||||
item->driverId = driverId; | item->driverId = driverId; | ||||
item->text = midiWidget->midiIO->getDriverName(driverId); | item->text = midiWidget->midiIO->getDriverName(driverId); | ||||
@@ -54,7 +54,7 @@ struct MidiDeviceChoice : LedDisplayChoice { | |||||
Menu *menu = createMenu(); | Menu *menu = createMenu(); | ||||
menu->addChild(createMenuLabel("MIDI device")); | menu->addChild(createMenuLabel("MIDI device")); | ||||
{ | { | ||||
MidiDeviceItem *item = new MidiDeviceItem(); | |||||
MidiDeviceItem *item = new MidiDeviceItem; | |||||
item->midiIO = midiWidget->midiIO; | item->midiIO = midiWidget->midiIO; | ||||
item->deviceId = -1; | item->deviceId = -1; | ||||
item->text = "(No device)"; | item->text = "(No device)"; | ||||
@@ -62,7 +62,7 @@ struct MidiDeviceChoice : LedDisplayChoice { | |||||
menu->addChild(item); | menu->addChild(item); | ||||
} | } | ||||
for (int deviceId : midiWidget->midiIO->getDeviceIds()) { | for (int deviceId : midiWidget->midiIO->getDeviceIds()) { | ||||
MidiDeviceItem *item = new MidiDeviceItem(); | |||||
MidiDeviceItem *item = new MidiDeviceItem; | |||||
item->midiIO = midiWidget->midiIO; | item->midiIO = midiWidget->midiIO; | ||||
item->deviceId = deviceId; | item->deviceId = deviceId; | ||||
item->text = midiWidget->midiIO->getDeviceName(deviceId); | item->text = midiWidget->midiIO->getDeviceName(deviceId); | ||||
@@ -96,7 +96,7 @@ struct MidiChannelChoice : LedDisplayChoice { | |||||
Menu *menu = createMenu(); | Menu *menu = createMenu(); | ||||
menu->addChild(createMenuLabel("MIDI channel")); | menu->addChild(createMenuLabel("MIDI channel")); | ||||
for (int channel = -1; channel < 16; channel++) { | for (int channel = -1; channel < 16; channel++) { | ||||
MidiChannelItem *item = new MidiChannelItem(); | |||||
MidiChannelItem *item = new MidiChannelItem; | |||||
item->midiIO = midiWidget->midiIO; | item->midiIO = midiWidget->midiIO; | ||||
item->channel = channel; | item->channel = channel; | ||||
item->text = midiWidget->midiIO->getChannelName(channel); | item->text = midiWidget->midiIO->getChannelName(channel); | ||||
@@ -290,16 +290,16 @@ struct ModuleBrowser : OpaqueWidget { | |||||
sTagFilter = NO_TAG; | sTagFilter = NO_TAG; | ||||
// Search | // Search | ||||
searchField = new SearchModuleField(); | |||||
searchField = new SearchModuleField; | |||||
searchField->box.size.x = box.size.x; | searchField->box.size.x = box.size.x; | ||||
searchField->moduleBrowser = this; | searchField->moduleBrowser = this; | ||||
addChild(searchField); | addChild(searchField); | ||||
moduleList = new BrowserList(); | |||||
moduleList = new BrowserList; | |||||
moduleList->box.size = math::Vec(box.size.x, 0.0); | moduleList->box.size = math::Vec(box.size.x, 0.0); | ||||
// Module Scroll | // Module Scroll | ||||
moduleScroll = new ScrollWidget(); | |||||
moduleScroll = new ScrollWidget; | |||||
moduleScroll->box.pos.y = searchField->box.size.y; | moduleScroll->box.pos.y = searchField->box.size.y; | ||||
moduleScroll->box.size.x = box.size.x; | moduleScroll->box.size.x = box.size.x; | ||||
moduleScroll->container->addChild(moduleList); | moduleScroll->container->addChild(moduleList); | ||||
@@ -352,39 +352,39 @@ struct ModuleBrowser : OpaqueWidget { | |||||
if (!filterPage) { | if (!filterPage) { | ||||
// Favorites | // Favorites | ||||
if (!sFavoriteModels.empty()) { | if (!sFavoriteModels.empty()) { | ||||
SeparatorItem *item = new SeparatorItem(); | |||||
SeparatorItem *item = new SeparatorItem; | |||||
item->setText("Favorites"); | item->setText("Favorites"); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
for (Model *model : sFavoriteModels) { | for (Model *model : sFavoriteModels) { | ||||
if (isModelFiltered(model) && isModelMatch(model, search)) { | if (isModelFiltered(model) && isModelMatch(model, search)) { | ||||
ModelItem *item = new ModelItem(); | |||||
ModelItem *item = new ModelItem; | |||||
item->setModel(model); | item->setModel(model); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
} | } | ||||
// Author items | // Author items | ||||
{ | { | ||||
SeparatorItem *item = new SeparatorItem(); | |||||
SeparatorItem *item = new SeparatorItem; | |||||
item->setText("Authors"); | item->setText("Authors"); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
for (std::string author : availableAuthors) { | for (std::string author : availableAuthors) { | ||||
if (isMatch(author, search)) { | if (isMatch(author, search)) { | ||||
AuthorItem *item = new AuthorItem(); | |||||
AuthorItem *item = new AuthorItem; | |||||
item->setAuthor(author); | item->setAuthor(author); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
} | } | ||||
// Tag items | // Tag items | ||||
{ | { | ||||
SeparatorItem *item = new SeparatorItem(); | |||||
SeparatorItem *item = new SeparatorItem; | |||||
item->setText("Tags"); | item->setText("Tags"); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
for (ModelTag tag : availableTags) { | for (ModelTag tag : availableTags) { | ||||
if (isMatch(gTagNames[tag], search)) { | if (isMatch(gTagNames[tag], search)) { | ||||
TagItem *item = new TagItem(); | |||||
TagItem *item = new TagItem; | |||||
item->setTag(tag); | item->setTag(tag); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
@@ -392,18 +392,18 @@ struct ModuleBrowser : OpaqueWidget { | |||||
} | } | ||||
else { | else { | ||||
// Clear filter | // Clear filter | ||||
ClearFilterItem *item = new ClearFilterItem(); | |||||
ClearFilterItem *item = new ClearFilterItem; | |||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
if (filterPage || !search.empty()) { | if (filterPage || !search.empty()) { | ||||
if (!search.empty()) { | if (!search.empty()) { | ||||
SeparatorItem *item = new SeparatorItem(); | |||||
SeparatorItem *item = new SeparatorItem; | |||||
item->setText("Modules"); | item->setText("Modules"); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
else if (filterPage) { | else if (filterPage) { | ||||
SeparatorItem *item = new SeparatorItem(); | |||||
SeparatorItem *item = new SeparatorItem; | |||||
if (!sAuthorFilter.empty()) | if (!sAuthorFilter.empty()) | ||||
item->setText(sAuthorFilter); | item->setText(sAuthorFilter); | ||||
else if (sTagFilter != NO_TAG) | else if (sTagFilter != NO_TAG) | ||||
@@ -414,7 +414,7 @@ struct ModuleBrowser : OpaqueWidget { | |||||
for (Plugin *plugin : gPlugins) { | for (Plugin *plugin : gPlugins) { | ||||
for (Model *model : plugin->models) { | for (Model *model : plugin->models) { | ||||
if (isModelFiltered(model) && isModelMatch(model, search)) { | if (isModelFiltered(model) && isModelMatch(model, search)) { | ||||
ModelItem *item = new ModelItem(); | |||||
ModelItem *item = new ModelItem; | |||||
item->setModel(model); | item->setModel(model); | ||||
moduleList->addChild(item); | moduleList->addChild(item); | ||||
} | } | ||||
@@ -536,9 +536,9 @@ void SearchModuleField::on(event::SelectKey &e) { | |||||
// Global functions | // Global functions | ||||
void appModuleBrowserCreate() { | void appModuleBrowserCreate() { | ||||
MenuOverlay *overlay = new MenuOverlay(); | |||||
MenuOverlay *overlay = new MenuOverlay; | |||||
ModuleBrowser *moduleBrowser = new ModuleBrowser(); | |||||
ModuleBrowser *moduleBrowser = new ModuleBrowser; | |||||
overlay->addChild(moduleBrowser); | overlay->addChild(moduleBrowser); | ||||
gRackScene->addChild(overlay); | gRackScene->addChild(overlay); | ||||
@@ -48,7 +48,7 @@ void ModuleWidget::setPanel(std::shared_ptr<SVG> svg) { | |||||
panel = NULL; | panel = NULL; | ||||
} | } | ||||
panel = new SVGPanel(); | |||||
panel = new SVGPanel; | |||||
panel->setBackground(svg); | panel->setBackground(svg); | ||||
addChild(panel); | addChild(panel); | ||||
@@ -485,57 +485,57 @@ struct ModuleDeleteItem : MenuItem { | |||||
Menu *ModuleWidget::createContextMenu() { | Menu *ModuleWidget::createContextMenu() { | ||||
Menu *menu = createMenu(); | Menu *menu = createMenu(); | ||||
MenuLabel *menuLabel = new MenuLabel(); | |||||
MenuLabel *menuLabel = new MenuLabel; | |||||
menuLabel->text = model->author + " " + model->name + " " + model->plugin->version; | menuLabel->text = model->author + " " + model->name + " " + model->plugin->version; | ||||
menu->addChild(menuLabel); | menu->addChild(menuLabel); | ||||
ModuleResetItem *resetItem = new ModuleResetItem(); | |||||
ModuleResetItem *resetItem = new ModuleResetItem; | |||||
resetItem->text = "Initialize"; | resetItem->text = "Initialize"; | ||||
resetItem->rightText = WINDOW_MOD_KEY_NAME "+I"; | resetItem->rightText = WINDOW_MOD_KEY_NAME "+I"; | ||||
resetItem->moduleWidget = this; | resetItem->moduleWidget = this; | ||||
menu->addChild(resetItem); | menu->addChild(resetItem); | ||||
ModuleRandomizeItem *randomizeItem = new ModuleRandomizeItem(); | |||||
ModuleRandomizeItem *randomizeItem = new ModuleRandomizeItem; | |||||
randomizeItem->text = "Randomize"; | randomizeItem->text = "Randomize"; | ||||
randomizeItem->rightText = WINDOW_MOD_KEY_NAME "+R"; | randomizeItem->rightText = WINDOW_MOD_KEY_NAME "+R"; | ||||
randomizeItem->moduleWidget = this; | randomizeItem->moduleWidget = this; | ||||
menu->addChild(randomizeItem); | menu->addChild(randomizeItem); | ||||
ModuleDisconnectItem *disconnectItem = new ModuleDisconnectItem(); | |||||
ModuleDisconnectItem *disconnectItem = new ModuleDisconnectItem; | |||||
disconnectItem->text = "Disconnect cables"; | disconnectItem->text = "Disconnect cables"; | ||||
disconnectItem->rightText = WINDOW_MOD_KEY_NAME "+U"; | disconnectItem->rightText = WINDOW_MOD_KEY_NAME "+U"; | ||||
disconnectItem->moduleWidget = this; | disconnectItem->moduleWidget = this; | ||||
menu->addChild(disconnectItem); | menu->addChild(disconnectItem); | ||||
ModuleCloneItem *cloneItem = new ModuleCloneItem(); | |||||
ModuleCloneItem *cloneItem = new ModuleCloneItem; | |||||
cloneItem->text = "Duplicate"; | cloneItem->text = "Duplicate"; | ||||
cloneItem->rightText = WINDOW_MOD_KEY_NAME "+D"; | cloneItem->rightText = WINDOW_MOD_KEY_NAME "+D"; | ||||
cloneItem->moduleWidget = this; | cloneItem->moduleWidget = this; | ||||
menu->addChild(cloneItem); | menu->addChild(cloneItem); | ||||
ModuleCopyItem *copyItem = new ModuleCopyItem(); | |||||
ModuleCopyItem *copyItem = new ModuleCopyItem; | |||||
copyItem->text = "Copy preset"; | copyItem->text = "Copy preset"; | ||||
copyItem->rightText = WINDOW_MOD_KEY_NAME "+C"; | copyItem->rightText = WINDOW_MOD_KEY_NAME "+C"; | ||||
copyItem->moduleWidget = this; | copyItem->moduleWidget = this; | ||||
menu->addChild(copyItem); | menu->addChild(copyItem); | ||||
ModulePasteItem *pasteItem = new ModulePasteItem(); | |||||
ModulePasteItem *pasteItem = new ModulePasteItem; | |||||
pasteItem->text = "Paste preset"; | pasteItem->text = "Paste preset"; | ||||
pasteItem->rightText = WINDOW_MOD_KEY_NAME "+V"; | pasteItem->rightText = WINDOW_MOD_KEY_NAME "+V"; | ||||
pasteItem->moduleWidget = this; | pasteItem->moduleWidget = this; | ||||
menu->addChild(pasteItem); | menu->addChild(pasteItem); | ||||
ModuleLoadItem *loadItem = new ModuleLoadItem(); | |||||
ModuleLoadItem *loadItem = new ModuleLoadItem; | |||||
loadItem->text = "Load preset"; | loadItem->text = "Load preset"; | ||||
loadItem->moduleWidget = this; | loadItem->moduleWidget = this; | ||||
menu->addChild(loadItem); | menu->addChild(loadItem); | ||||
ModuleSaveItem *saveItem = new ModuleSaveItem(); | |||||
ModuleSaveItem *saveItem = new ModuleSaveItem; | |||||
saveItem->text = "Save preset"; | saveItem->text = "Save preset"; | ||||
saveItem->moduleWidget = this; | saveItem->moduleWidget = this; | ||||
menu->addChild(saveItem); | menu->addChild(saveItem); | ||||
ModuleDeleteItem *deleteItem = new ModuleDeleteItem(); | |||||
ModuleDeleteItem *deleteItem = new ModuleDeleteItem; | |||||
deleteItem->text = "Delete"; | deleteItem->text = "Delete"; | ||||
deleteItem->rightText = "Backspace/Delete"; | deleteItem->rightText = "Backspace/Delete"; | ||||
deleteItem->moduleWidget = this; | deleteItem->moduleWidget = this; | ||||
@@ -129,29 +129,29 @@ PluginManagerWidget::PluginManagerWidget() { | |||||
layout->spacing = 5; | layout->spacing = 5; | ||||
loginWidget = layout; | loginWidget = layout; | ||||
Button *registerButton = new RegisterButton(); | |||||
Button *registerButton = new RegisterButton; | |||||
registerButton->box.size.x = 75; | registerButton->box.size.x = 75; | ||||
registerButton->text = "Register"; | registerButton->text = "Register"; | ||||
loginWidget->addChild(registerButton); | loginWidget->addChild(registerButton); | ||||
TextField *emailField = new TextField(); | |||||
TextField *emailField = new TextField; | |||||
emailField->box.size.x = 175; | emailField->box.size.x = 175; | ||||
emailField->placeholder = "Email"; | emailField->placeholder = "Email"; | ||||
loginWidget->addChild(emailField); | loginWidget->addChild(emailField); | ||||
PasswordField *passwordField = new PasswordField(); | |||||
PasswordField *passwordField = new PasswordField; | |||||
passwordField->box.size.x = 175; | passwordField->box.size.x = 175; | ||||
passwordField->placeholder = "Password"; | passwordField->placeholder = "Password"; | ||||
loginWidget->addChild(passwordField); | loginWidget->addChild(passwordField); | ||||
LogInButton *logInButton = new LogInButton(); | |||||
LogInButton *logInButton = new LogInButton; | |||||
logInButton->box.size.x = 100; | logInButton->box.size.x = 100; | ||||
logInButton->text = "Log in"; | logInButton->text = "Log in"; | ||||
logInButton->emailField = emailField; | logInButton->emailField = emailField; | ||||
logInButton->passwordField = passwordField; | logInButton->passwordField = passwordField; | ||||
loginWidget->addChild(logInButton); | loginWidget->addChild(logInButton); | ||||
Label *label = new StatusLabel(); | |||||
Label *label = new StatusLabel; | |||||
loginWidget->addChild(label); | loginWidget->addChild(label); | ||||
addChild(loginWidget); | addChild(loginWidget); | ||||
@@ -162,17 +162,17 @@ PluginManagerWidget::PluginManagerWidget() { | |||||
layout->spacing = 5; | layout->spacing = 5; | ||||
manageWidget = layout; | manageWidget = layout; | ||||
Button *manageButton = new ManageButton(); | |||||
Button *manageButton = new ManageButton; | |||||
manageButton->box.size.x = 125; | manageButton->box.size.x = 125; | ||||
manageButton->text = "Manage plugins"; | manageButton->text = "Manage plugins"; | ||||
manageWidget->addChild(manageButton); | manageWidget->addChild(manageButton); | ||||
Button *syncButton = new SyncButton(); | |||||
Button *syncButton = new SyncButton; | |||||
syncButton->box.size.x = 125; | syncButton->box.size.x = 125; | ||||
syncButton->text = "Update plugins"; | syncButton->text = "Update plugins"; | ||||
manageWidget->addChild(syncButton); | manageWidget->addChild(syncButton); | ||||
Button *logOutButton = new LogOutButton(); | |||||
Button *logOutButton = new LogOutButton; | |||||
logOutButton->box.size.x = 100; | logOutButton->box.size.x = 100; | ||||
logOutButton->text = "Log out"; | logOutButton->text = "Log out"; | ||||
manageWidget->addChild(logOutButton); | manageWidget->addChild(logOutButton); | ||||
@@ -185,13 +185,13 @@ PluginManagerWidget::PluginManagerWidget() { | |||||
layout->spacing = 5; | layout->spacing = 5; | ||||
downloadWidget = layout; | downloadWidget = layout; | ||||
ProgressBar *downloadProgress = new DownloadProgressBar(); | |||||
ProgressBar *downloadProgress = new DownloadProgressBar; | |||||
downloadProgress->box.size.x = 300; | downloadProgress->box.size.x = 300; | ||||
downloadProgress->setLimits(0, 100); | downloadProgress->setLimits(0, 100); | ||||
downloadProgress->unit = "%"; | downloadProgress->unit = "%"; | ||||
downloadWidget->addChild(downloadProgress); | downloadWidget->addChild(downloadProgress); | ||||
// Button *cancelButton = new CancelButton(); | |||||
// Button *cancelButton = new CancelButton; | |||||
// cancelButton->box.size.x = 100; | // cancelButton->box.size.x = 100; | ||||
// cancelButton->text = "Cancel"; | // cancelButton->text = "Cancel"; | ||||
// downloadWidget->addChild(cancelButton); | // downloadWidget->addChild(cancelButton); | ||||
@@ -18,7 +18,7 @@ struct PlugLight : MultiLightWidget { | |||||
Port::Port() { | Port::Port() { | ||||
plugLight = new PlugLight(); | |||||
plugLight = new PlugLight; | |||||
} | } | ||||
Port::~Port() { | Port::~Port() { | ||||
@@ -78,7 +78,7 @@ void Port::on(event::DragStart &e) { | |||||
} | } | ||||
else { | else { | ||||
// Create a new wire | // Create a new wire | ||||
wire = new WireWidget(); | |||||
wire = new WireWidget; | |||||
if (type == INPUT) | if (type == INPUT) | ||||
wire->inputPort = this; | wire->inputPort = this; | ||||
else | else | ||||
@@ -7,19 +7,19 @@ namespace rack { | |||||
RackScene::RackScene() { | RackScene::RackScene() { | ||||
scrollWidget = new RackScrollWidget(); | |||||
scrollWidget = new RackScrollWidget; | |||||
{ | { | ||||
zoomWidget = new ZoomWidget(); | |||||
zoomWidget = new ZoomWidget; | |||||
{ | { | ||||
assert(!gRackWidget); | assert(!gRackWidget); | ||||
gRackWidget = new RackWidget(); | |||||
gRackWidget = new RackWidget; | |||||
zoomWidget->addChild(gRackWidget); | zoomWidget->addChild(gRackWidget); | ||||
} | } | ||||
scrollWidget->container->addChild(zoomWidget); | scrollWidget->container->addChild(zoomWidget); | ||||
} | } | ||||
addChild(scrollWidget); | addChild(scrollWidget); | ||||
gToolbar = new Toolbar(); | |||||
gToolbar = new Toolbar; | |||||
addChild(gToolbar); | addChild(gToolbar); | ||||
scrollWidget->box.pos.y = gToolbar->box.size.y; | scrollWidget->box.pos.y = gToolbar->box.size.y; | ||||
} | } | ||||
@@ -27,20 +27,20 @@ struct ModuleContainer : Widget { | |||||
RackWidget::RackWidget() { | RackWidget::RackWidget() { | ||||
rails = new FramebufferWidget(); | |||||
rails = new FramebufferWidget; | |||||
rails->box.size = math::Vec(); | rails->box.size = math::Vec(); | ||||
rails->oversample = 1.0; | rails->oversample = 1.0; | ||||
{ | { | ||||
RackRail *rail = new RackRail(); | |||||
RackRail *rail = new RackRail; | |||||
rail->box.size = math::Vec(); | rail->box.size = math::Vec(); | ||||
rails->addChild(rail); | rails->addChild(rail); | ||||
} | } | ||||
addChild(rails); | addChild(rails); | ||||
moduleContainer = new ModuleContainer(); | |||||
moduleContainer = new ModuleContainer; | |||||
addChild(moduleContainer); | addChild(moduleContainer); | ||||
wireContainer = new WireContainer(); | |||||
wireContainer = new WireContainer; | |||||
addChild(wireContainer); | addChild(wireContainer); | ||||
} | } | ||||
@@ -344,7 +344,7 @@ void RackWidget::fromJson(json_t *rootJ) { | |||||
continue; | continue; | ||||
// Create WireWidget | // Create WireWidget | ||||
WireWidget *wireWidget = new WireWidget(); | |||||
WireWidget *wireWidget = new WireWidget; | |||||
wireWidget->fromJson(wireJ); | wireWidget->fromJson(wireJ); | ||||
wireWidget->outputPort = outputPort; | wireWidget->outputPort = outputPort; | ||||
wireWidget->inputPort = inputPort; | wireWidget->inputPort = inputPort; | ||||
@@ -5,7 +5,7 @@ namespace rack { | |||||
SVGButton::SVGButton() { | SVGButton::SVGButton() { | ||||
sw = new SVGWidget(); | |||||
sw = new SVGWidget; | |||||
addChild(sw); | addChild(sw); | ||||
} | } | ||||
@@ -5,14 +5,14 @@ namespace rack { | |||||
SVGKnob::SVGKnob() { | SVGKnob::SVGKnob() { | ||||
shadow = new CircularShadow(); | |||||
shadow = new CircularShadow; | |||||
addChild(shadow); | addChild(shadow); | ||||
shadow->box.size = math::Vec(); | shadow->box.size = math::Vec(); | ||||
tw = new TransformWidget(); | |||||
tw = new TransformWidget; | |||||
addChild(tw); | addChild(tw); | ||||
sw = new SVGWidget(); | |||||
sw = new SVGWidget; | |||||
tw->addChild(sw); | tw->addChild(sw); | ||||
} | } | ||||
@@ -5,13 +5,13 @@ namespace rack { | |||||
SVGPort::SVGPort() { | SVGPort::SVGPort() { | ||||
shadow = new CircularShadow(); | |||||
shadow = new CircularShadow; | |||||
addChild(shadow); | addChild(shadow); | ||||
// Avoid breakage if plugins fail to call setSVG() | // Avoid breakage if plugins fail to call setSVG() | ||||
// In that case, just disable the shadow. | // In that case, just disable the shadow. | ||||
shadow->box.size = math::Vec(); | shadow->box.size = math::Vec(); | ||||
background = new SVGWidget(); | |||||
background = new SVGWidget; | |||||
addChild(background); | addChild(background); | ||||
} | } | ||||
@@ -5,7 +5,7 @@ namespace rack { | |||||
SVGScrew::SVGScrew() { | SVGScrew::SVGScrew() { | ||||
sw = new SVGWidget(); | |||||
sw = new SVGWidget; | |||||
addChild(sw); | addChild(sw); | ||||
} | } | ||||
@@ -5,10 +5,10 @@ namespace rack { | |||||
SVGSlider::SVGSlider() { | SVGSlider::SVGSlider() { | ||||
background = new SVGWidget(); | |||||
background = new SVGWidget; | |||||
addChild(background); | addChild(background); | ||||
handle = new SVGWidget(); | |||||
handle = new SVGWidget; | |||||
addChild(handle); | addChild(handle); | ||||
speed = 2.0; | speed = 2.0; | ||||
@@ -5,7 +5,7 @@ namespace rack { | |||||
SVGSwitch::SVGSwitch() { | SVGSwitch::SVGSwitch() { | ||||
sw = new SVGWidget(); | |||||
sw = new SVGWidget; | |||||
addChild(sw); | addChild(sw); | ||||
} | } | ||||
@@ -13,7 +13,7 @@ struct TooltipIconButton : IconButton { | |||||
std::string tooltipText; | std::string tooltipText; | ||||
void on(event::Enter &e) override { | void on(event::Enter &e) override { | ||||
if (!tooltip) { | if (!tooltip) { | ||||
tooltip = new Tooltip(); | |||||
tooltip = new Tooltip; | |||||
tooltip->box.pos = getAbsoluteOffset(math::Vec(0, BND_WIDGET_HEIGHT)); | tooltip->box.pos = getAbsoluteOffset(math::Vec(0, BND_WIDGET_HEIGHT)); | ||||
tooltip->text = tooltipText; | tooltip->text = tooltipText; | ||||
gRackScene->addChild(tooltip); | gRackScene->addChild(tooltip); | ||||
@@ -126,13 +126,13 @@ struct SampleRateButton : TooltipIconButton { | |||||
menu->addChild(createMenuLabel("Engine sample rate")); | menu->addChild(createMenuLabel("Engine sample rate")); | ||||
EnginePauseItem *pauseItem = new EnginePauseItem(); | |||||
EnginePauseItem *pauseItem = new EnginePauseItem; | |||||
pauseItem->text = gPaused ? "Resume engine" : "Pause engine"; | pauseItem->text = gPaused ? "Resume engine" : "Pause engine"; | ||||
menu->addChild(pauseItem); | menu->addChild(pauseItem); | ||||
std::vector<float> sampleRates = {44100, 48000, 88200, 96000, 176400, 192000}; | std::vector<float> sampleRates = {44100, 48000, 88200, 96000, 176400, 192000}; | ||||
for (float sampleRate : sampleRates) { | for (float sampleRate : sampleRates) { | ||||
SampleRateItem *item = new SampleRateItem(); | |||||
SampleRateItem *item = new SampleRateItem; | |||||
item->text = string::stringf("%.0f Hz", sampleRate); | item->text = string::stringf("%.0f Hz", sampleRate); | ||||
item->rightText = CHECKMARK(engineGetSampleRate() == sampleRate); | item->rightText = CHECKMARK(engineGetSampleRate() == sampleRate); | ||||
item->sampleRate = sampleRate; | item->sampleRate = sampleRate; | ||||
@@ -162,23 +162,23 @@ struct ZoomSlider : Slider { | |||||
Toolbar::Toolbar() { | Toolbar::Toolbar() { | ||||
box.size.y = BND_WIDGET_HEIGHT + 2*5; | box.size.y = BND_WIDGET_HEIGHT + 2*5; | ||||
SequentialLayout *layout = new SequentialLayout(); | |||||
SequentialLayout *layout = new SequentialLayout; | |||||
layout->box.pos = math::Vec(5, 5); | layout->box.pos = math::Vec(5, 5); | ||||
layout->spacing = 5; | layout->spacing = 5; | ||||
addChild(layout); | addChild(layout); | ||||
layout->addChild(new NewButton()); | |||||
layout->addChild(new OpenButton()); | |||||
layout->addChild(new SaveButton()); | |||||
layout->addChild(new SaveAsButton()); | |||||
layout->addChild(new RevertButton()); | |||||
layout->addChild(new DisconnectCablesButton()); | |||||
layout->addChild(new NewButton); | |||||
layout->addChild(new OpenButton); | |||||
layout->addChild(new SaveButton); | |||||
layout->addChild(new SaveAsButton); | |||||
layout->addChild(new RevertButton); | |||||
layout->addChild(new DisconnectCablesButton); | |||||
layout->addChild(new SampleRateButton()); | |||||
layout->addChild(new PowerMeterButton()); | |||||
layout->addChild(new RackLockButton()); | |||||
layout->addChild(new SampleRateButton); | |||||
layout->addChild(new PowerMeterButton); | |||||
layout->addChild(new RackLockButton); | |||||
wireOpacitySlider = new Slider(); | |||||
wireOpacitySlider = new Slider; | |||||
wireOpacitySlider->box.size.x = 150; | wireOpacitySlider->box.size.x = 150; | ||||
wireOpacitySlider->label = "Cable opacity"; | wireOpacitySlider->label = "Cable opacity"; | ||||
wireOpacitySlider->precision = 0; | wireOpacitySlider->precision = 0; | ||||
@@ -187,7 +187,7 @@ Toolbar::Toolbar() { | |||||
wireOpacitySlider->setDefaultValue(50.0); | wireOpacitySlider->setDefaultValue(50.0); | ||||
layout->addChild(wireOpacitySlider); | layout->addChild(wireOpacitySlider); | ||||
wireTensionSlider = new Slider(); | |||||
wireTensionSlider = new Slider; | |||||
wireTensionSlider->box.size.x = 150; | wireTensionSlider->box.size.x = 150; | ||||
wireTensionSlider->label = "Cable tension"; | wireTensionSlider->label = "Cable tension"; | ||||
wireTensionSlider->unit = ""; | wireTensionSlider->unit = ""; | ||||
@@ -195,7 +195,7 @@ Toolbar::Toolbar() { | |||||
wireTensionSlider->setDefaultValue(0.5); | wireTensionSlider->setDefaultValue(0.5); | ||||
layout->addChild(wireTensionSlider); | layout->addChild(wireTensionSlider); | ||||
zoomSlider = new ZoomSlider(); | |||||
zoomSlider = new ZoomSlider; | |||||
zoomSlider->box.size.x = 150; | zoomSlider->box.size.x = 150; | ||||
zoomSlider->precision = 0; | zoomSlider->precision = 0; | ||||
zoomSlider->label = "Zoom"; | zoomSlider->label = "Zoom"; | ||||
@@ -206,7 +206,7 @@ Toolbar::Toolbar() { | |||||
// Kind of hacky, but display the PluginManagerWidget only if the local directory is not the development directory | // Kind of hacky, but display the PluginManagerWidget only if the local directory is not the development directory | ||||
if (asset::local("") != "./") { | if (asset::local("") != "./") { | ||||
Widget *pluginManager = new PluginManagerWidget(); | |||||
Widget *pluginManager = new PluginManagerWidget; | |||||
layout->addChild(pluginManager); | layout->addChild(pluginManager); | ||||
} | } | ||||
} | } | ||||
@@ -102,7 +102,7 @@ void WireWidget::updateWire() { | |||||
assert(outputPort->type == Port::OUTPUT); | assert(outputPort->type == Port::OUTPUT); | ||||
if (!wire) { | if (!wire) { | ||||
wire = new Wire(); | |||||
wire = new Wire; | |||||
wire->outputModule = outputPort->module; | wire->outputModule = outputPort->module; | ||||
wire->outputId = outputPort->portId; | wire->outputId = outputPort->portId; | ||||
wire->inputModule = inputPort->module; | wire->inputModule = inputPort->module; | ||||
@@ -36,9 +36,9 @@ static void checkVersion() { | |||||
void appInit(bool devMode) { | void appInit(bool devMode) { | ||||
gRackScene = new RackScene(); | |||||
gRackScene = new RackScene; | |||||
gWidgetState = new WidgetState(); | |||||
gWidgetState = new WidgetState; | |||||
gWidgetState->rootWidget = gRackScene; | gWidgetState->rootWidget = gRackScene; | ||||
// Request latest version from server | // Request latest version from server | ||||
@@ -406,7 +406,7 @@ void bridgeInit() { | |||||
serverRunning = true; | serverRunning = true; | ||||
serverThread = std::thread(serverRun); | serverThread = std::thread(serverRun); | ||||
driver = new BridgeMidiDriver(); | |||||
driver = new BridgeMidiDriver; | |||||
midiDriverAdd(BRIDGE_DRIVER, driver); | midiDriverAdd(BRIDGE_DRIVER, driver); | ||||
} | } | ||||
@@ -98,7 +98,7 @@ void Driver::unsubscribeInputDevice(int deviceId, MidiInput *midiInput) { | |||||
void init() { | void init() { | ||||
driver = new Driver(); | |||||
driver = new Driver; | |||||
midiDriverAdd(DRIVER, driver); | midiDriverAdd(DRIVER, driver); | ||||
} | } | ||||
@@ -120,7 +120,7 @@ void Driver::unsubscribeInputDevice(int deviceId, MidiInput *midiInput) { | |||||
void init() { | void init() { | ||||
driver = new Driver(); | |||||
driver = new Driver; | |||||
midiDriverAdd(DRIVER, driver); | midiDriverAdd(DRIVER, driver); | ||||
} | } | ||||
@@ -100,7 +100,7 @@ static bool loadPlugin(std::string path) { | |||||
} | } | ||||
// Construct and initialize Plugin instance | // Construct and initialize Plugin instance | ||||
Plugin *plugin = new Plugin(); | |||||
Plugin *plugin = new Plugin; | |||||
plugin->path = path; | plugin->path = path; | ||||
plugin->handle = handle; | plugin->handle = handle; | ||||
initCallback(plugin); | initCallback(plugin); | ||||
@@ -320,7 +320,7 @@ void pluginInit(bool devMode) { | |||||
// Load core | // Load core | ||||
// This function is defined in core.cpp | // This function is defined in core.cpp | ||||
Plugin *corePlugin = new Plugin(); | |||||
Plugin *corePlugin = new Plugin; | |||||
init(corePlugin); | init(corePlugin); | ||||
gPlugins.push_back(corePlugin); | gPlugins.push_back(corePlugin); | ||||
@@ -23,7 +23,7 @@ struct FramebufferWidget::Internal { | |||||
FramebufferWidget::FramebufferWidget() { | FramebufferWidget::FramebufferWidget() { | ||||
oversample = 1.0; | oversample = 1.0; | ||||
internal = new Internal(); | |||||
internal = new Internal; | |||||
} | } | ||||
FramebufferWidget::~FramebufferWidget() { | FramebufferWidget::~FramebufferWidget() { | ||||