diff --git a/include/app/Knob.hpp b/include/app/Knob.hpp index 0982807f..55d420a9 100644 --- a/include/app/Knob.hpp +++ b/include/app/Knob.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include namespace rack { diff --git a/include/app/SvgPanel.hpp b/include/app/SvgPanel.hpp index 0436ac61..1c6a2c50 100644 --- a/include/app/SvgPanel.hpp +++ b/include/app/SvgPanel.hpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include namespace rack { diff --git a/include/app.hpp b/include/context.hpp similarity index 72% rename from include/app.hpp rename to include/context.hpp index 84fd5760..985c9f4d 100644 --- a/include/app.hpp +++ b/include/context.hpp @@ -30,7 +30,7 @@ struct Scene; /** Contains the application state */ -struct App { +struct Context { event::State* event = NULL; app::Scene* scene = NULL; engine::Engine* engine = NULL; @@ -39,17 +39,17 @@ struct App { PatchManager* patch = NULL; void init(); - ~App(); + ~Context(); }; -void appInit(); -void appDestroy(); -/** Returns the global App pointer */ -App* appGet(); +void contextInit(); +void contextDestroy(); +/** Returns the global Context pointer */ +Context* contextGet(); -/** Accesses the global App pointer */ -#define APP rack::appGet() +/** Accesses the global Context pointer */ +#define APP rack::contextGet() } // namespace rack diff --git a/include/helpers.hpp b/include/helpers.hpp index b82f0c12..9ad43050 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace rack { diff --git a/include/rack.hpp b/include/rack.hpp index 2b2b34d4..2cc5965f 100644 --- a/include/rack.hpp +++ b/include/rack.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/ui/MenuItem.hpp b/include/ui/MenuItem.hpp index 574f98db..e6c7a5e0 100644 --- a/include/ui/MenuItem.hpp +++ b/include/ui/MenuItem.hpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include namespace rack { diff --git a/include/ui/RadioButton.hpp b/include/ui/RadioButton.hpp index 01bd26f5..53e16440 100644 --- a/include/ui/RadioButton.hpp +++ b/include/ui/RadioButton.hpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include diff --git a/include/ui/Slider.hpp b/include/ui/Slider.hpp index a781eef6..a1eae6b0 100644 --- a/include/ui/Slider.hpp +++ b/include/ui/Slider.hpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include namespace rack { diff --git a/include/ui/TextField.hpp b/include/ui/TextField.hpp index 6bf63d94..ebf9e69e 100644 --- a/include/ui/TextField.hpp +++ b/include/ui/TextField.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include namespace rack { diff --git a/src/app/CableWidget.cpp b/src/app/CableWidget.cpp index c86c4992..3f506166 100644 --- a/src/app/CableWidget.cpp +++ b/src/app/CableWidget.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/Knob.cpp b/src/app/Knob.cpp index 808a3767..6afca915 100644 --- a/src/app/Knob.cpp +++ b/src/app/Knob.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/app/LedDisplay.cpp b/src/app/LedDisplay.cpp index 252c694d..38736846 100644 --- a/src/app/LedDisplay.cpp +++ b/src/app/LedDisplay.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include namespace rack { diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index c4d323b4..c9c48938 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index b6470702..6291b8e9 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index fc6ac291..eb5b0526 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/ParamWidget.cpp b/src/app/ParamWidget.cpp index df812680..817110b6 100644 --- a/src/app/ParamWidget.cpp +++ b/src/app/ParamWidget.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/PortWidget.cpp b/src/app/PortWidget.cpp index 7146ed25..3a8d1fb9 100644 --- a/src/app/PortWidget.cpp +++ b/src/app/PortWidget.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/RackRail.cpp b/src/app/RackRail.cpp index 0d5ad62b..3b741caa 100644 --- a/src/app/RackRail.cpp +++ b/src/app/RackRail.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/src/app/RackScrollWidget.cpp b/src/app/RackScrollWidget.cpp index 78f198e4..532fd5f4 100644 --- a/src/app/RackScrollWidget.cpp +++ b/src/app/RackScrollWidget.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index 77dbcc28..e74a6ba8 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index cc583c61..8c986170 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/app/Switch.cpp b/src/app/Switch.cpp index d3f4ca3a..961b1439 100644 --- a/src/app/Switch.cpp +++ b/src/app/Switch.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/app.cpp b/src/context.cpp similarity index 72% rename from src/app.cpp rename to src/context.cpp index 1e8a622a..5c70e271 100644 --- a/src/app.cpp +++ b/src/context.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -10,7 +10,7 @@ namespace rack { -void App::init() { +void Context::init() { engine = new engine::Engine; patch = new PatchManager; if (!settings::headless) { @@ -22,7 +22,7 @@ void App::init() { } } -App::~App() { +Context::~Context() { // Set pointers to NULL so other objects will segfault when attempting to access them if (scene) delete scene; @@ -45,22 +45,22 @@ App::~App() { } -static App* appInstance = NULL; +static Context* context = NULL; -void appInit() { - assert(!appInstance); - appInstance = new App; - appInstance->init(); +void contextInit() { + assert(!context); + context = new Context; + context->init(); } -void appDestroy() { - assert(appInstance); - delete appInstance; - appInstance = NULL; +void contextDestroy() { + assert(context); + delete context; + context = NULL; } -App* appGet() { - return appInstance; +Context* contextGet() { + return context; } diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index ba51c6d5..1f65e69a 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -1,6 +1,6 @@ #include "plugin.hpp" #include -#include +#include #include #include #include diff --git a/src/core/Blank.cpp b/src/core/Blank.cpp index 2aa740e1..17c30732 100644 --- a/src/core/Blank.cpp +++ b/src/core/Blank.cpp @@ -1,5 +1,5 @@ #include "plugin.hpp" -#include +#include namespace rack { diff --git a/src/engine/Cable.cpp b/src/engine/Cable.cpp index 421940d6..4f8b4f46 100644 --- a/src/engine/Cable.cpp +++ b/src/engine/Cable.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace rack { diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 559d1200..2805a646 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/engine/ParamQuantity.cpp b/src/engine/ParamQuantity.cpp index 4368cdc1..19d4ad46 100644 --- a/src/engine/ParamQuantity.cpp +++ b/src/engine/ParamQuantity.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/event.cpp b/src/event.cpp index 84b0da0e..1c93a491 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include diff --git a/src/history.cpp b/src/history.cpp index 5c44746c..17926888 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/main.cpp b/src/main.cpp index c31b6349..c9fd22fb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -172,7 +172,7 @@ int main(int argc, char* argv[]) { // Initialize app INFO("Initializing app"); - appInit(); + contextInit(); // On Mac, use a hacked-in GLFW addition to get the launched path. #if defined ARCH_MAC @@ -206,7 +206,7 @@ int main(int argc, char* argv[]) { APP->patch->save(asset::autosavePath); } INFO("Destroying app"); - appDestroy(); + contextDestroy(); if (!settings::headless) { settings::save(asset::settingsPath); } diff --git a/src/patch.cpp b/src/patch.cpp index 43fa5a62..cfb25431 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/plugin.cpp b/src/plugin.cpp index 088128fc..0ed8931b 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/settings.cpp b/src/settings.cpp index 55345494..4b0e492d 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/ui/Button.cpp b/src/ui/Button.cpp index b7325161..75590797 100644 --- a/src/ui/Button.cpp +++ b/src/ui/Button.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/ui/ChoiceButton.cpp b/src/ui/ChoiceButton.cpp index 19face2d..3ab4dc3b 100644 --- a/src/ui/ChoiceButton.cpp +++ b/src/ui/ChoiceButton.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/ui/MenuLabel.cpp b/src/ui/MenuLabel.cpp index 2659c908..c4c44d42 100644 --- a/src/ui/MenuLabel.cpp +++ b/src/ui/MenuLabel.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace rack { diff --git a/src/ui/ScrollBar.cpp b/src/ui/ScrollBar.cpp index 75ccd560..fa342132 100644 --- a/src/ui/ScrollBar.cpp +++ b/src/ui/ScrollBar.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include diff --git a/src/ui/ScrollWidget.cpp b/src/ui/ScrollWidget.cpp index df0e135e..4550a15d 100644 --- a/src/ui/ScrollWidget.cpp +++ b/src/ui/ScrollWidget.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace rack { diff --git a/src/ui/Tooltip.cpp b/src/ui/Tooltip.cpp index 38f13b84..1c1c7500 100644 --- a/src/ui/Tooltip.cpp +++ b/src/ui/Tooltip.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/updater.cpp b/src/updater.cpp index ed2fbf90..43608beb 100644 --- a/src/updater.cpp +++ b/src/updater.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/widget/FramebufferWidget.cpp b/src/widget/FramebufferWidget.cpp index 0505d73b..c9a34de7 100644 --- a/src/widget/FramebufferWidget.cpp +++ b/src/widget/FramebufferWidget.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/widget/OpenGlWidget.cpp b/src/widget/OpenGlWidget.cpp index 9663c6e3..7598cad9 100644 --- a/src/widget/OpenGlWidget.cpp +++ b/src/widget/OpenGlWidget.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace rack { diff --git a/src/widget/SvgWidget.cpp b/src/widget/SvgWidget.cpp index 9db7a614..ee42c25d 100644 --- a/src/widget/SvgWidget.cpp +++ b/src/widget/SvgWidget.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace rack { diff --git a/src/widget/Widget.cpp b/src/widget/Widget.cpp index 0030c32c..5e7f80e1 100644 --- a/src/widget/Widget.cpp +++ b/src/widget/Widget.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/src/window.cpp b/src/window.cpp index 979c1f09..ce6b264d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include // used in Window::screenshot