diff --git a/include/app/ParamWidget.hpp b/include/app/ParamWidget.hpp index 0e28d0c7..e5ce9063 100644 --- a/include/app/ParamWidget.hpp +++ b/include/app/ParamWidget.hpp @@ -2,7 +2,7 @@ #include "app/common.hpp" #include "widget/OpaqueWidget.hpp" #include "ui/Tooltip.hpp" -#include "app/ParamQuantity.hpp" +#include "engine/ParamQuantity.hpp" #include "history.hpp" @@ -12,11 +12,10 @@ namespace app { /** Manages an engine::Param on a ModuleWidget. */ struct ParamWidget : widget::OpaqueWidget { - ParamQuantity *paramQuantity = NULL; + engine::ParamQuantity *paramQuantity = NULL; float dirtyValue = NAN; ui::Tooltip *tooltip = NULL; - ~ParamWidget(); void step() override; void draw(const DrawArgs &args) override; void onButton(const widget::ButtonEvent &e) override; diff --git a/include/app/ParamQuantity.hpp b/include/engine/ParamQuantity.hpp similarity index 95% rename from include/app/ParamQuantity.hpp rename to include/engine/ParamQuantity.hpp index 4284a4b5..843a2823 100644 --- a/include/app/ParamQuantity.hpp +++ b/include/engine/ParamQuantity.hpp @@ -5,7 +5,7 @@ namespace rack { -namespace app { +namespace engine { /** A Quantity that wraps an engine::Param. */ @@ -33,5 +33,5 @@ struct ParamQuantity : Quantity { }; -} // namespace app +} // namespace engine } // namespace rack diff --git a/include/helpers.hpp b/include/helpers.hpp index 9a968159..1dfbb5b9 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -5,10 +5,10 @@ #include "ui/MenuLabel.hpp" #include "ui/Menu.hpp" #include "app/PortWidget.hpp" -#include "app/ParamQuantity.hpp" #include "app/ParamWidget.hpp" #include "app/Scene.hpp" #include "engine/Module.hpp" +#include "engine/ParamQuantity.hpp" #include "app.hpp" #include "window.hpp" @@ -66,7 +66,7 @@ TParamWidget *createParam(math::Vec pos, engine::Module *module, int paramId) { if (f) o->paramQuantity = f->create(); else - o->paramQuantity = new app::ParamQuantity; + o->paramQuantity = new engine::ParamQuantity; o->paramQuantity->module = module; o->paramQuantity->paramId = paramId; } diff --git a/src/ui/Quantity.cpp b/src/Quantity.cpp similarity index 100% rename from src/ui/Quantity.cpp rename to src/Quantity.cpp diff --git a/src/app/ParamWidget.cpp b/src/app/ParamWidget.cpp index 8f6b3bf5..c542971e 100644 --- a/src/app/ParamWidget.cpp +++ b/src/app/ParamWidget.cpp @@ -2,7 +2,6 @@ #include "ui/MenuOverlay.hpp" #include "ui/TextField.hpp" #include "app/Scene.hpp" -#include "app/ParamQuantity.hpp" #include "app.hpp" #include "engine/Engine.hpp" #include "settings.hpp" @@ -109,11 +108,6 @@ struct ParamUnmapItem : ui::MenuItem { }; -ParamWidget::~ParamWidget() { - if (paramQuantity) - delete paramQuantity; -} - void ParamWidget::step() { if (paramQuantity) { float value = paramQuantity->getValue(); diff --git a/src/app/ParamQuantity.cpp b/src/engine/ParamQuantity.cpp similarity index 96% rename from src/app/ParamQuantity.cpp rename to src/engine/ParamQuantity.cpp index b9243d4b..5c3542bf 100644 --- a/src/app/ParamQuantity.cpp +++ b/src/engine/ParamQuantity.cpp @@ -1,10 +1,10 @@ -#include "app/ParamQuantity.hpp" +#include "engine/ParamQuantity.hpp" #include "app.hpp" #include "engine/Engine.hpp" namespace rack { -namespace app { +namespace engine { engine::Param *ParamQuantity::getParam() { @@ -119,5 +119,5 @@ std::string ParamQuantity::getUnit() { } -} // namespace app +} // namespace engine } // namespace rack