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