diff --git a/include/rack.hpp b/include/rack.hpp index 60cf56f..eb80d43 100644 --- a/include/rack.hpp +++ b/include/rack.hpp @@ -28,5 +28,6 @@ # undef far # undef near # define ABC ABC_ +# define Chord Chord_ # define VOID VOID_ #endif diff --git a/plugins/Makefile b/plugins/Makefile index 1659b9b..343c85e 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -24,7 +24,7 @@ PLUGIN_FILES = plugins.cpp PLUGIN_FILES += $(filter-out AmalgamatedHarmonics/src/AH.cpp,$(wildcard AmalgamatedHarmonics/src/*.cpp)) # modules/types which are present in other plugins -AMALGAMATEDHARMONICS_CUSTOM = BasePinkNoiseGenerator LowFrequencyOscillator Pattern PinkNoiseGenerator RedNoiseGenerator +AMALGAMATEDHARMONICS_CUSTOM = BasePinkNoiseGenerator EvenVCO LowFrequencyOscillator Pattern PinkNoiseGenerator RedNoiseGenerator # -------------------------------------------------------------- # AnimatedCircuits @@ -38,7 +38,7 @@ PLUGIN_FILES += $(filter-out AS/src/AS.cpp,$(wildcard AS/src/*.cpp)) PLUGIN_FILES += AS/freeverb/revmodel.cpp # modules/types which are present in other plugins -AS_CUSTOM = ADSR LabelDisplayWidget LowFrequencyOscillator Param VCA allpass comb revmodel +AS_CUSTOM = ADSR LabelDisplayWidget LowFrequencyOscillator VCA allpass comb revmodel # -------------------------------------------------------------- # AudibleInstruments @@ -145,9 +145,6 @@ PLUGIN_FILES += AudibleInstruments/eurorack/streams/compressor.cc PLUGIN_FILES += $(filter-out Befaco/src/plugin.cpp,$(wildcard Befaco/src/*.cpp)) PLUGIN_BINARIES += Befaco/src/SpringReverbIR.pcm -# modules/types which are present in other plugins -BEFACO_CUSTOM = EvenVCO - # -------------------------------------------------------------- # Bidoo diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index 8c2d520..581aae3 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -34,7 +34,12 @@ GLFWAPI int glfwGetKeyScancode(int key) { return 0; } namespace rack { namespace window { - DISTRHO_NAMESPACE::UI* lastUI = nullptr; + struct Window::Internal { + int mods; + DISTRHO_NAMESPACE::UI* ui; + // more stuff below + }; + void WindowInit(Window* window, DISTRHO_NAMESPACE::UI* ui); } } @@ -77,11 +82,8 @@ public: fContext->scene = new rack::app::Scene; fContext->event->rootWidget = fContext->scene; - // Initialize context - d_stdout("UI context ptr %p", NanoVG::getContext()); - rack::window::lastUI = this; fContext->window = new rack::window::Window; - rack::window::lastUI = nullptr; + rack::window::WindowInit(fContext->window, this); // Hide non-wanted menu entries typedef rack::ui::Button rButton; diff --git a/src/Window.cpp b/src/Window.cpp index 31a2b4d..fe98d79 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -23,7 +23,6 @@ namespace rack { namespace window { -extern DISTRHO_NAMESPACE::UI* lastUI; static const math::Vec minWindowSize = math::Vec(640, 480); @@ -69,8 +68,9 @@ std::shared_ptr Image::load(const std::string& filename) { struct Window::Internal { - DISTRHO_NAMESPACE::UI* ui; - math::Vec size; + int mods = 0; + DISTRHO_NAMESPACE::UI* ui = nullptr; + math::Vec size = minWindowSize; std::string lastWindowTitle; @@ -88,24 +88,22 @@ struct Window::Internal { Window::Window() { internal = new Internal; - internal->ui = lastUI; - internal->size = minWindowSize; - - int err; +} +void WindowInit(Window* const window, DISTRHO_NAMESPACE::UI* const ui) +{ const GLubyte* vendor = glGetString(GL_VENDOR); const GLubyte* renderer = glGetString(GL_RENDERER); const GLubyte* version = glGetString(GL_VERSION); INFO("Renderer: %s %s", vendor, renderer); INFO("OpenGL: %s", version); - INFO("UI pointer: %p", lastUI); - vg = lastUI->getContext(); - fbVg = nvgCreateSharedGL2(vg, NVG_ANTIALIAS); + window->vg = ui->getContext(); + window->fbVg = nvgCreateSharedGL2(window->vg, NVG_ANTIALIAS); // Load default Blendish font - uiFont = loadFont(asset::system("res/fonts/DejaVuSans.ttf")); - bndSetFont(uiFont->handle); + window->uiFont = window->loadFont(asset::system("res/fonts/DejaVuSans.ttf")); + bndSetFont(window->uiFont->handle); if (APP->scene) { widget::Widget::ContextCreateEvent e; @@ -113,7 +111,6 @@ Window::Window() { } } - Window::~Window() { if (APP->scene) { widget::Widget::ContextDestroyEvent e; @@ -326,28 +323,5 @@ bool& Window::fbDirtyOnSubpixelChange() { } -void mouseButtonCallback(Context* ctx, int button, int action, int mods) { - -} - -void cursorPosCallback(Context* ctx, double xpos, double ypos) { -} - -void cursorEnterCallback(Context* ctx, int entered) { - if (!entered) { - ctx->event->handleLeave(); - } -} - -void scrollCallback(Context* ctx, double x, double y) { -} - -void charCallback(Context* ctx, unsigned int codepoint) { -} - -void keyCallback(Context* ctx, int key, int scancode, int action, int mods) { -} - - } // namespace window } // namespace rack