@@ -20,22 +20,16 @@ | |||||
#include "plugin.hpp" | #include "plugin.hpp" | ||||
#include "DistrhoUtils.hpp" | #include "DistrhoUtils.hpp" | ||||
#ifndef HEADLESS | |||||
# include "../dgl/Base.hpp" | |||||
#else | |||||
# include "extra/LeakDetector.hpp" | |||||
#endif | |||||
#include "../dgl/Base.hpp" | |||||
// ----------------------------------------------------------------------------------------------------------- | // ----------------------------------------------------------------------------------------------------------- | ||||
// from PluginContext.hpp | // from PluginContext.hpp | ||||
#ifndef HEADLESS | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
class TopLevelWidget; | class TopLevelWidget; | ||||
template <class BaseWidget> class NanoBaseWidget; | template <class BaseWidget> class NanoBaseWidget; | ||||
typedef NanoBaseWidget<TopLevelWidget> NanoTopLevelWidget; | typedef NanoBaseWidget<TopLevelWidget> NanoTopLevelWidget; | ||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
#endif | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
@@ -76,10 +70,8 @@ struct CardinalPluginContext : rack::Context { | |||||
const MidiEvent* midiEvents; | const MidiEvent* midiEvents; | ||||
uint32_t midiEventCount; | uint32_t midiEventCount; | ||||
Plugin* const plugin; | Plugin* const plugin; | ||||
#ifndef HEADLESS | |||||
DGL_NAMESPACE::NanoTopLevelWidget* tlw; | DGL_NAMESPACE::NanoTopLevelWidget* tlw; | ||||
UI* ui; | UI* ui; | ||||
#endif | |||||
CardinalPluginContext(Plugin* const p); | CardinalPluginContext(Plugin* const p); | ||||
void writeMidiMessage(const rack::midi::Message& message, uint8_t channel); | void writeMidiMessage(const rack::midi::Message& message, uint8_t channel); | ||||
#ifndef HEADLESS | #ifndef HEADLESS | ||||
@@ -301,7 +301,7 @@ endif | |||||
ifeq ($(shell $(PKG_CONFIG) --exists fftw3f && echo true),true) | ifeq ($(shell $(PKG_CONFIG) --exists fftw3f && echo true),true) | ||||
PLUGIN_FILES += Cardinal/src/AudioToCVPitch.cpp | PLUGIN_FILES += Cardinal/src/AudioToCVPitch.cpp | ||||
MINIPLUGIN_FILES += Cardinal/src/AudioToCVPitch.cpp | |||||
# MINIPLUGIN_FILES += Cardinal/src/AudioToCVPitch.cpp | |||||
BASE_FLAGS += -DHAVE_FFTW3F | BASE_FLAGS += -DHAVE_FFTW3F | ||||
endif | endif | ||||
@@ -171,15 +171,18 @@ static void initStatic__Cardinal() | |||||
p->addModel(modelHostParametersMap); | p->addModel(modelHostParametersMap); | ||||
p->addModel(modelHostTime); | p->addModel(modelHostTime); | ||||
p->addModel(modelTextEditor); | p->addModel(modelTextEditor); | ||||
/* TODO | |||||
#ifdef HAVE_FFTW3F | #ifdef HAVE_FFTW3F | ||||
p->addModel(modelAudioToCVPitch); | p->addModel(modelAudioToCVPitch); | ||||
#else | #else | ||||
*/ | |||||
spl.removeModule("AudioToCVPitch"); | spl.removeModule("AudioToCVPitch"); | ||||
/* | |||||
#endif | #endif | ||||
*/ | |||||
spl.removeModule("AudioFile"); | spl.removeModule("AudioFile"); | ||||
spl.removeModule("Blank"); | spl.removeModule("Blank"); | ||||
spl.removeModule("Carla"); | spl.removeModule("Carla"); | ||||
spl.removeModule("ExpanderInputMIDI"); | |||||
spl.removeModule("ExpanderOutputMIDI"); | spl.removeModule("ExpanderOutputMIDI"); | ||||
spl.removeModule("HostAudio8"); | spl.removeModule("HostAudio8"); | ||||
spl.removeModule("Ildaeil"); | spl.removeModule("Ildaeil"); | ||||
@@ -26,6 +26,7 @@ | |||||
#include <app/Scene.hpp> | #include <app/Scene.hpp> | ||||
#include <engine/Engine.hpp> | #include <engine/Engine.hpp> | ||||
#include <ui/common.hpp> | #include <ui/common.hpp> | ||||
#include <widget/Widget.hpp> | |||||
#include <window/Window.hpp> | #include <window/Window.hpp> | ||||
#ifdef NDEBUG | #ifdef NDEBUG | ||||
@@ -64,6 +65,11 @@ static const constexpr uint kCardinalStateCount = kCardinalStateBaseCount; | |||||
extern const std::string CARDINAL_VERSION; | extern const std::string CARDINAL_VERSION; | ||||
namespace rack { | namespace rack { | ||||
#if DISTRHO_PLUGIN_HAS_UI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | |||||
namespace app { | |||||
rack::widget::Widget* createMenuBar() { return new rack::widget::Widget; } | |||||
} | |||||
#endif | |||||
namespace engine { | namespace engine { | ||||
void Engine_setAboutToClose(Engine*); | void Engine_setAboutToClose(Engine*); | ||||
} | } | ||||
@@ -80,6 +86,7 @@ bool d_isDiffHigherThanLimit(const T& v1, const T& v2, const T& limit) | |||||
#if DISTRHO_PLUGIN_HAS_UI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | #if DISTRHO_PLUGIN_HAS_UI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS | ||||
const char* UI::getBundlePath() const noexcept { return nullptr; } | const char* UI::getBundlePath() const noexcept { return nullptr; } | ||||
void UI::setState(const char*, const char*) {} | |||||
#endif | #endif | ||||
// ----------------------------------------------------------------------------------------------------------- | // ----------------------------------------------------------------------------------------------------------- | ||||
@@ -330,8 +330,10 @@ BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"' | |||||
FILES = main.cpp | FILES = main.cpp | ||||
FILES += RemoteUI.cpp | FILES += RemoteUI.cpp | ||||
FILES += CardinalCommon.cpp | FILES += CardinalCommon.cpp | ||||
FILES += CardinalRemote.cpp | |||||
FILES += common.cpp | FILES += common.cpp | ||||
FILES += glfw.cpp | FILES += glfw.cpp | ||||
FILES += MenuBar.cpp | |||||
FILES += Window.cpp | FILES += Window.cpp | ||||
ifeq ($(WINDOWS),true) | ifeq ($(WINDOWS),true) | ||||
@@ -41,15 +41,6 @@ CardinalRemoteUI::CardinalRemoteUI(Window& window, const std::string& templatePa | |||||
rack::window::WindowSetPluginRemote(context->window, this); | rack::window::WindowSetPluginRemote(context->window, this); | ||||
if (rack::widget::Widget* const menuBar = context->scene->menuBar) | |||||
{ | |||||
context->scene->removeChild(menuBar); | |||||
delete menuBar; | |||||
} | |||||
context->scene->menuBar = rack::app::createMenuBar(true); | |||||
context->scene->addChildBelow(context->scene->menuBar, context->scene->rackScroll); | |||||
// hide "Browse VCV Library" button | // hide "Browse VCV Library" button | ||||
rack::widget::Widget* const browser = context->scene->browser->children.back(); | rack::widget::Widget* const browser = context->scene->browser->children.back(); | ||||
rack::widget::Widget* const headerLayout = browser->children.front(); | rack::widget::Widget* const headerLayout = browser->children.front(); | ||||
@@ -93,15 +84,6 @@ CardinalRemoteUI::~CardinalRemoteUI() | |||||
context->nativeWindowId = 0; | context->nativeWindowId = 0; | ||||
if (rack::widget::Widget* const menuBar = context->scene->menuBar) | |||||
{ | |||||
context->scene->removeChild(menuBar); | |||||
delete menuBar; | |||||
} | |||||
context->scene->menuBar = rack::app::createMenuBar(true); | |||||
context->scene->addChildBelow(context->scene->menuBar, context->scene->rackScroll); | |||||
rack::window::WindowSetPluginRemote(context->window, nullptr); | rack::window::WindowSetPluginRemote(context->window, nullptr); | ||||
} | } | ||||
@@ -26,13 +26,10 @@ | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
namespace rack { | namespace rack { | ||||
namespace app { | |||||
widget::Widget* createMenuBar(bool isStandalone); | |||||
} | |||||
namespace window { | namespace window { | ||||
void WindowSetPluginRemote(Window* window, NanoTopLevelWidget* tlw); | |||||
void WindowSetMods(Window* window, int mods); | |||||
void WindowSetInternalSize(rack::window::Window* window, math::Vec size); | |||||
void WindowSetPluginRemote(Window* window, NanoTopLevelWidget* tlw); | |||||
void WindowSetMods(Window* window, int mods); | |||||
void WindowSetInternalSize(rack::window::Window* window, math::Vec size); | |||||
} | } | ||||
} | } | ||||
@@ -240,13 +240,13 @@ all: $(TARGETS) | |||||
ifeq ($(MOD_BUILD),true) | ifeq ($(MOD_BUILD),true) | ||||
$(MAKE) -C Cardinal lv2 | $(MAKE) -C Cardinal lv2 | ||||
$(MAKE) -C CardinalFX lv2 | $(MAKE) -C CardinalFX lv2 | ||||
#$(MAKE) -C CardinalMini lv2 | |||||
$(MAKE) -C CardinalMini lv2 | |||||
else ifeq ($(WASM),true) | else ifeq ($(WASM),true) | ||||
$(MAKE) -C CardinalNative | $(MAKE) -C CardinalNative | ||||
else | else | ||||
$(MAKE) -C Cardinal | $(MAKE) -C Cardinal | ||||
ifneq ($(NOPLUGINS),true) | ifneq ($(NOPLUGINS),true) | ||||
#$(MAKE) -C CardinalMini | |||||
$(MAKE) -C CardinalMini | |||||
endif | endif | ||||
$(MAKE) -C CardinalNative | $(MAKE) -C CardinalNative | ||||
$(MAKE) -C CardinalFX $(CARDINAL_FX_ARGS) | $(MAKE) -C CardinalFX $(CARDINAL_FX_ARGS) | ||||
@@ -30,6 +30,13 @@ | |||||
#ifndef HEADLESS | #ifndef HEADLESS | ||||
# include "DistrhoUI.hpp" | # include "DistrhoUI.hpp" | ||||
#else | |||||
# include "Base.hpp" | |||||
START_NAMESPACE_DGL | |||||
class TopLevelWidget; | |||||
template <class BaseWidget> class NanoBaseWidget; | |||||
typedef NanoBaseWidget<TopLevelWidget> NanoTopLevelWidget; | |||||
END_NAMESPACE_DGL | |||||
#endif | #endif | ||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
@@ -64,10 +71,8 @@ struct CardinalPluginContext : rack::Context { | |||||
const MidiEvent* midiEvents; | const MidiEvent* midiEvents; | ||||
uint32_t midiEventCount; | uint32_t midiEventCount; | ||||
Plugin* const plugin; | Plugin* const plugin; | ||||
#ifndef HEADLESS | |||||
NanoTopLevelWidget* tlw; | NanoTopLevelWidget* tlw; | ||||
UI* ui; | UI* ui; | ||||
#endif | |||||
CardinalPluginContext(Plugin* const p) | CardinalPluginContext(Plugin* const p) | ||||
: bufferSize(p != nullptr ? p->getBufferSize() : 0), | : bufferSize(p != nullptr ? p->getBufferSize() : 0), | ||||
@@ -107,21 +112,19 @@ struct CardinalPluginContext : rack::Context { | |||||
dataOuts(nullptr), | dataOuts(nullptr), | ||||
midiEvents(nullptr), | midiEvents(nullptr), | ||||
midiEventCount(0), | midiEventCount(0), | ||||
plugin(p) | |||||
#ifndef HEADLESS | |||||
, tlw(nullptr) | |||||
, ui(nullptr) | |||||
#endif | |||||
plugin(p), | |||||
tlw(nullptr), | |||||
ui(nullptr) | |||||
{ | { | ||||
std::memset(parameters, 0, sizeof(parameters)); | std::memset(parameters, 0, sizeof(parameters)); | ||||
} | } | ||||
void writeMidiMessage(const rack::midi::Message& message, uint8_t channel); | void writeMidiMessage(const rack::midi::Message& message, uint8_t channel); | ||||
#ifndef HEADLESS | |||||
#ifndef HEADLESS | |||||
bool addIdleCallback(IdleCallback* cb) const; | bool addIdleCallback(IdleCallback* cb) const; | ||||
void removeIdleCallback(IdleCallback* cb) const; | void removeIdleCallback(IdleCallback* cb) const; | ||||
#endif | |||||
#endif | |||||
}; | }; | ||||
// ----------------------------------------------------------------------------------------------------------- | // ----------------------------------------------------------------------------------------------------------- | ||||
@@ -137,9 +140,9 @@ public: | |||||
context(new CardinalPluginContext(this)) {} | context(new CardinalPluginContext(this)) {} | ||||
~CardinalBasePlugin() override {} | ~CardinalBasePlugin() override {} | ||||
#ifndef HEADLESS | |||||
#ifndef HEADLESS | |||||
friend class CardinalUI; | friend class CardinalUI; | ||||
#endif | |||||
#endif | |||||
}; | }; | ||||
#ifndef HEADLESS | #ifndef HEADLESS | ||||
@@ -844,11 +844,7 @@ struct MenuBar : widget::OpaqueWidget { | |||||
widget::Widget* createMenuBar() { | widget::Widget* createMenuBar() { | ||||
return new widget::Widget; | |||||
} | |||||
widget::Widget* createMenuBar(const bool isStandalone) { | |||||
menuBar::MenuBar* menuBar = new menuBar::MenuBar(isStandalone); | |||||
menuBar::MenuBar* menuBar = new menuBar::MenuBar(isStandalone()); | |||||
return menuBar; | return menuBar; | ||||
} | } | ||||
@@ -50,9 +50,6 @@ namespace rack { | |||||
namespace app { | namespace app { | ||||
widget::Widget* createMenuBar(bool isStandalone); | |||||
struct ResizeHandle : widget::OpaqueWidget { | struct ResizeHandle : widget::OpaqueWidget { | ||||
math::Vec size; | math::Vec size; | ||||
@@ -134,7 +131,7 @@ Scene::Scene() { | |||||
rack = rackScroll->rackWidget; | rack = rackScroll->rackWidget; | ||||
menuBar = createMenuBar(isStandalone()); | |||||
menuBar = createMenuBar(); | |||||
addChild(menuBar); | addChild(menuBar); | ||||
browser = browserCreate(); | browser = browserCreate(); | ||||