Browse Source

Rename App to Context and app.hpp to context.hpp. The APP macro is still valid.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
ca9231e1b3
46 changed files with 68 additions and 68 deletions
  1. +1
    -1
      include/app/Knob.hpp
  2. +1
    -1
      include/app/SvgPanel.hpp
  3. +8
    -8
      include/context.hpp
  4. +1
    -1
      include/helpers.hpp
  5. +1
    -1
      include/rack.hpp
  6. +1
    -1
      include/ui/MenuItem.hpp
  7. +1
    -1
      include/ui/RadioButton.hpp
  8. +1
    -1
      include/ui/Slider.hpp
  9. +1
    -1
      include/ui/TextField.hpp
  10. +1
    -1
      src/app/CableWidget.cpp
  11. +1
    -1
      src/app/Knob.cpp
  12. +1
    -1
      src/app/LedDisplay.cpp
  13. +1
    -1
      src/app/MenuBar.cpp
  14. +1
    -1
      src/app/ModuleBrowser.cpp
  15. +1
    -1
      src/app/ModuleWidget.cpp
  16. +1
    -1
      src/app/ParamWidget.cpp
  17. +1
    -1
      src/app/PortWidget.cpp
  18. +1
    -1
      src/app/RackRail.cpp
  19. +1
    -1
      src/app/RackScrollWidget.cpp
  20. +1
    -1
      src/app/RackWidget.cpp
  21. +1
    -1
      src/app/Scene.cpp
  22. +1
    -1
      src/app/Switch.cpp
  23. +14
    -14
      src/context.cpp
  24. +1
    -1
      src/core/AudioInterface.cpp
  25. +1
    -1
      src/core/Blank.cpp
  26. +1
    -1
      src/engine/Cable.cpp
  27. +1
    -1
      src/engine/Engine.cpp
  28. +1
    -1
      src/engine/ParamQuantity.cpp
  29. +1
    -1
      src/event.cpp
  30. +1
    -1
      src/history.cpp
  31. +3
    -3
      src/main.cpp
  32. +1
    -1
      src/patch.cpp
  33. +1
    -1
      src/plugin.cpp
  34. +1
    -1
      src/settings.cpp
  35. +1
    -1
      src/ui/Button.cpp
  36. +1
    -1
      src/ui/ChoiceButton.cpp
  37. +1
    -1
      src/ui/MenuLabel.cpp
  38. +1
    -1
      src/ui/ScrollBar.cpp
  39. +1
    -1
      src/ui/ScrollWidget.cpp
  40. +1
    -1
      src/ui/Tooltip.cpp
  41. +1
    -1
      src/updater.cpp
  42. +1
    -1
      src/widget/FramebufferWidget.cpp
  43. +1
    -1
      src/widget/OpenGlWidget.cpp
  44. +1
    -1
      src/widget/SvgWidget.cpp
  45. +1
    -1
      src/widget/Widget.cpp
  46. +1
    -1
      src/window.cpp

+ 1
- 1
include/app/Knob.hpp View File

@@ -1,7 +1,7 @@
#pragma once
#include <app/common.hpp>
#include <app/ParamWidget.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
include/app/SvgPanel.hpp View File

@@ -3,7 +3,7 @@
#include <widget/TransparentWidget.hpp>
#include <widget/FramebufferWidget.hpp>
#include <widget/SvgWidget.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


include/app.hpp → include/context.hpp View File

@@ -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

+ 1
- 1
include/helpers.hpp View File

@@ -11,7 +11,7 @@
#include <app/SvgPanel.hpp>
#include <engine/Module.hpp>
#include <engine/ParamQuantity.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
include/rack.hpp View File

@@ -11,7 +11,7 @@
#include <network.hpp>
#include <asset.hpp>
#include <window.hpp>
#include <app.hpp>
#include <context.hpp>
#include <midi.hpp>
#include <settings.hpp>
#include <helpers.hpp>


+ 1
- 1
include/ui/MenuItem.hpp View File

@@ -2,7 +2,7 @@
#include <ui/common.hpp>
#include <ui/Menu.hpp>
#include <ui/MenuEntry.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
include/ui/RadioButton.hpp View File

@@ -2,7 +2,7 @@
#include <ui/common.hpp>
#include <widget/OpaqueWidget.hpp>
#include <Quantity.hpp>
#include <app.hpp>
#include <context.hpp>
#include <event.hpp>




+ 1
- 1
include/ui/Slider.hpp View File

@@ -2,7 +2,7 @@
#include <widget/OpaqueWidget.hpp>
#include <Quantity.hpp>
#include <ui/common.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
include/ui/TextField.hpp View File

@@ -1,7 +1,7 @@
#pragma once
#include <widget/OpaqueWidget.hpp>
#include <ui/common.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/app/CableWidget.cpp View File

@@ -2,7 +2,7 @@
#include <app/Scene.hpp>
#include <app/RackWidget.hpp>
#include <window.hpp>
#include <app.hpp>
#include <context.hpp>
#include <patch.hpp>
#include <settings.hpp>
#include <engine/Engine.hpp>


+ 1
- 1
src/app/Knob.cpp View File

@@ -1,5 +1,5 @@
#include <app/Knob.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/Scene.hpp>
#include <random.hpp>
#include <history.hpp>


+ 1
- 1
src/app/LedDisplay.cpp View File

@@ -1,7 +1,7 @@
#include <app/LedDisplay.hpp>
#include <asset.hpp>
#include <window.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/app/MenuBar.cpp View File

@@ -10,7 +10,7 @@
#include <ui/TextField.hpp>
#include <ui/PasswordField.hpp>
#include <ui/ProgressBar.hpp>
#include <app.hpp>
#include <context.hpp>
#include <settings.hpp>
#include <helpers.hpp>
#include <system.hpp>


+ 1
- 1
src/app/ModuleBrowser.cpp View File

@@ -17,7 +17,7 @@
#include <app/ModuleWidget.hpp>
#include <app/Scene.hpp>
#include <plugin.hpp>
#include <app.hpp>
#include <context.hpp>
#include <engine/Engine.hpp>
#include <plugin/Model.hpp>
#include <string.hpp>


+ 1
- 1
src/app/ModuleWidget.cpp View File

@@ -7,7 +7,7 @@
#include <system.hpp>
#include <asset.hpp>
#include <helpers.hpp>
#include <app.hpp>
#include <context.hpp>
#include <settings.hpp>
#include <history.hpp>
#include <string.hpp>


+ 1
- 1
src/app/ParamWidget.cpp View File

@@ -2,7 +2,7 @@
#include <ui/MenuOverlay.hpp>
#include <ui/TextField.hpp>
#include <app/Scene.hpp>
#include <app.hpp>
#include <context.hpp>
#include <engine/Engine.hpp>
#include <settings.hpp>
#include <history.hpp>


+ 1
- 1
src/app/PortWidget.cpp View File

@@ -1,7 +1,7 @@
#include <app/PortWidget.hpp>
#include <app/Scene.hpp>
#include <window.hpp>
#include <app.hpp>
#include <context.hpp>
#include <history.hpp>
#include <engine/Engine.hpp>
#include <settings.hpp>


+ 1
- 1
src/app/RackRail.cpp View File

@@ -1,5 +1,5 @@
#include <app/RackRail.hpp>
#include <app.hpp>
#include <context.hpp>
#include <asset.hpp>
#include <svg.hpp>



+ 1
- 1
src/app/RackScrollWidget.cpp View File

@@ -1,7 +1,7 @@
#include <app/RackScrollWidget.hpp>
#include <app/Scene.hpp>
#include <window.hpp>
#include <app.hpp>
#include <context.hpp>
#include <settings.hpp>




+ 1
- 1
src/app/RackWidget.cpp View File

@@ -6,7 +6,7 @@
#include <settings.hpp>
#include <plugin.hpp>
#include <engine/Engine.hpp>
#include <app.hpp>
#include <context.hpp>
#include <asset.hpp>
#include <patch.hpp>
#include <osdialog.h>


+ 1
- 1
src/app/Scene.cpp View File

@@ -1,6 +1,6 @@
#include <app/Scene.hpp>
#include <app/ModuleBrowser.hpp>
#include <app.hpp>
#include <context.hpp>
#include <system.hpp>
#include <network.hpp>
#include <history.hpp>


+ 1
- 1
src/app/Switch.cpp View File

@@ -1,5 +1,5 @@
#include <app/Switch.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/Scene.hpp>
#include <random.hpp>
#include <history.hpp>


src/app.cpp → src/context.cpp View File

@@ -1,4 +1,4 @@
#include <app.hpp>
#include <context.hpp>
#include <window.hpp>
#include <patch.hpp>
#include <engine/Engine.hpp>
@@ -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;
}



+ 1
- 1
src/core/AudioInterface.cpp View File

@@ -1,6 +1,6 @@
#include "plugin.hpp"
#include <audio.hpp>
#include <app.hpp>
#include <context.hpp>
#include <mutex>
#include <chrono>
#include <thread>


+ 1
- 1
src/core/Blank.cpp View File

@@ -1,5 +1,5 @@
#include "plugin.hpp"
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/engine/Cable.cpp View File

@@ -1,6 +1,6 @@
#include <engine/Cable.hpp>
#include <engine/Engine.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/engine/Engine.cpp View File

@@ -2,7 +2,7 @@
#include <settings.hpp>
#include <system.hpp>
#include <random.hpp>
#include <app.hpp>
#include <context.hpp>
#include <patch.hpp>
#include <plugin.hpp>



+ 1
- 1
src/engine/ParamQuantity.cpp View File

@@ -1,5 +1,5 @@
#include <engine/ParamQuantity.hpp>
#include <app.hpp>
#include <context.hpp>
#include <engine/Engine.hpp>




+ 1
- 1
src/event.cpp View File

@@ -1,6 +1,6 @@
#include <event.hpp>
#include <widget/Widget.hpp>
#include <app.hpp>
#include <context.hpp>
#include <window.hpp>




+ 1
- 1
src/history.cpp View File

@@ -1,5 +1,5 @@
#include <history.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/Scene.hpp>
#include <engine/Cable.hpp>
#include <engine/Engine.hpp>


+ 3
- 3
src/main.cpp View File

@@ -12,7 +12,7 @@
#include <app/common.hpp>
#include <app/Scene.hpp>
#include <plugin.hpp>
#include <app.hpp>
#include <context.hpp>
#include <patch.hpp>
#include <ui.hpp>
#include <system.hpp>
@@ -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);
}


+ 1
- 1
src/patch.cpp View File

@@ -2,7 +2,7 @@
#include <asset.hpp>
#include <system.hpp>
#include <engine/Engine.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/common.hpp>
#include <app/Scene.hpp>
#include <app/RackWidget.hpp>


+ 1
- 1
src/plugin.cpp View File

@@ -3,7 +3,7 @@
#include <network.hpp>
#include <asset.hpp>
#include <string.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/common.hpp>
#include <plugin/callbacks.hpp>
#include <settings.hpp>


+ 1
- 1
src/settings.cpp View File

@@ -4,7 +4,7 @@
#include <app/Scene.hpp>
#include <app/ModuleBrowser.hpp>
#include <engine/Engine.hpp>
#include <app.hpp>
#include <context.hpp>
#include <patch.hpp>
#include <jansson.h>



+ 1
- 1
src/ui/Button.cpp View File

@@ -1,5 +1,5 @@
#include <ui/Button.hpp>
#include <app.hpp>
#include <context.hpp>
#include <event.hpp>




+ 1
- 1
src/ui/ChoiceButton.cpp View File

@@ -1,5 +1,5 @@
#include <ui/ChoiceButton.hpp>
#include <app.hpp>
#include <context.hpp>
#include <event.hpp>




+ 1
- 1
src/ui/MenuLabel.cpp View File

@@ -1,5 +1,5 @@
#include <ui/MenuLabel.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/ui/ScrollBar.cpp View File

@@ -1,6 +1,6 @@
#include <ui/ScrollBar.hpp>
#include <ui/ScrollWidget.hpp>
#include <app.hpp>
#include <context.hpp>
#include <window.hpp>




+ 1
- 1
src/ui/ScrollWidget.cpp View File

@@ -1,5 +1,5 @@
#include <ui/ScrollWidget.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/ui/Tooltip.cpp View File

@@ -1,5 +1,5 @@
#include <ui/Tooltip.hpp>
#include <app.hpp>
#include <context.hpp>
#include <app/Scene.hpp>




+ 1
- 1
src/updater.cpp View File

@@ -3,7 +3,7 @@
#include <app/common.hpp>
#include <network.hpp>
#include <system.hpp>
#include <app.hpp>
#include <context.hpp>
#include <window.hpp>
#include <asset.hpp>
#include <thread>


+ 1
- 1
src/widget/FramebufferWidget.cpp View File

@@ -1,5 +1,5 @@
#include <widget/FramebufferWidget.hpp>
#include <app.hpp>
#include <context.hpp>
#include <random.hpp>




+ 1
- 1
src/widget/OpenGlWidget.cpp View File

@@ -1,5 +1,5 @@
#include <widget/OpenGlWidget.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/widget/SvgWidget.cpp View File

@@ -1,5 +1,5 @@
#include <widget/SvgWidget.hpp>
#include <app.hpp>
#include <context.hpp>


namespace rack {


+ 1
- 1
src/widget/Widget.cpp View File

@@ -1,5 +1,5 @@
#include <widget/Widget.hpp>
#include <app.hpp>
#include <context.hpp>
#include <algorithm>




+ 1
- 1
src/window.cpp View File

@@ -4,7 +4,7 @@
#include <keyboard.hpp>
#include <gamepad.hpp>
#include <event.hpp>
#include <app.hpp>
#include <context.hpp>
#include <patch.hpp>
#include <settings.hpp>
#include <plugin.hpp> // used in Window::screenshot


Loading…
Cancel
Save