Signed-off-by: falkTX <falktx@falktx.com>tags/v1.0
@@ -42,7 +42,7 @@ public: | |||||
NativeHostDescriptor fCarlaHostDescriptor; | NativeHostDescriptor fCarlaHostDescriptor; | ||||
CarlaHostHandle fCarlaHostHandle; | CarlaHostHandle fCarlaHostHandle; | ||||
NativeTimeInfo fCarlaTimeInfo; | |||||
mutable NativeTimeInfo fCarlaTimeInfo; | |||||
UI* fUI; | UI* fUI; | ||||
@@ -100,7 +100,7 @@ public: | |||||
fCarlaPluginDescriptor->cleanup(fCarlaPluginHandle); | fCarlaPluginDescriptor->cleanup(fCarlaPluginHandle); | ||||
} | } | ||||
const NativeTimeInfo* getTimeInfo() | |||||
const NativeTimeInfo* hostGetTimeInfo() const noexcept | |||||
{ | { | ||||
const TimePosition& timePos(getTimePosition()); | const TimePosition& timePos(getTimePosition()); | ||||
@@ -119,7 +119,25 @@ public: | |||||
return &fCarlaTimeInfo; | return &fCarlaTimeInfo; | ||||
} | } | ||||
void resizeUI(const uint width, const uint height) | |||||
#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||||
bool hostWriteMidiEvent(const NativeMidiEvent* const event) | |||||
{ | |||||
MidiEvent midiEvent; | |||||
midiEvent.frame = event->time; | |||||
midiEvent.size = event->size; | |||||
midiEvent.dataExt = nullptr; | |||||
uint32_t i = 0; | |||||
for (; i < event->size; ++i) | |||||
midiEvent.data[i] = event->data[i]; | |||||
for (; i < MidiEvent::kDataSize; ++i) | |||||
midiEvent.data[i] = 0; | |||||
return writeMidiEvent(midiEvent); | |||||
} | |||||
#endif | |||||
void hostResizeUI(const uint width, const uint height) | |||||
{ | { | ||||
DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,); | DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,); | ||||
@@ -262,29 +280,37 @@ static bool host_is_offline(NativeHostHandle) | |||||
return false; | return false; | ||||
} | } | ||||
static const NativeTimeInfo* host_get_time_info(NativeHostHandle handle) | |||||
static const NativeTimeInfo* host_get_time_info(const NativeHostHandle handle) | |||||
{ | { | ||||
return static_cast<IldaeilPlugin*>(handle)->getTimeInfo(); | |||||
return static_cast<IldaeilPlugin*>(handle)->hostGetTimeInfo(); | |||||
} | } | ||||
static bool host_write_midi_event(NativeHostHandle handle, const NativeMidiEvent* event) | |||||
static bool host_write_midi_event(const NativeHostHandle handle, const NativeMidiEvent* const event) | |||||
{ | { | ||||
return false; | |||||
#if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||||
return static_cast<IldaeilPlugin*>(handle)->hostWriteMidiEvent(event); | |||||
#else | |||||
return handle != nullptr && event != nullptr && false; | |||||
#endif | |||||
} | } | ||||
static intptr_t host_dispatcher(NativeHostHandle handle, NativeHostDispatcherOpcode opcode, | |||||
int32_t index, intptr_t value, void* ptr, float opt) | |||||
static intptr_t host_dispatcher(const NativeHostHandle handle, const NativeHostDispatcherOpcode opcode, | |||||
const int32_t index, const intptr_t value, void* const ptr, const float opt) | |||||
{ | { | ||||
switch (opcode) | switch (opcode) | ||||
{ | { | ||||
case NATIVE_HOST_OPCODE_UI_RESIZE: | case NATIVE_HOST_OPCODE_UI_RESIZE: | ||||
static_cast<IldaeilPlugin*>(handle)->resizeUI(index, value); | |||||
static_cast<IldaeilPlugin*>(handle)->hostResizeUI(index, value); | |||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return 0; | return 0; | ||||
// unused | |||||
(void)ptr; | |||||
(void)opt; | |||||
} | } | ||||
/* ------------------------------------------------------------------------------------------------------------ | /* ------------------------------------------------------------------------------------------------------------ | ||||
@@ -34,13 +34,13 @@ START_NAMESPACE_DGL | |||||
#elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
#elif defined(DISTRHO_OS_WINDOWS) | #elif defined(DISTRHO_OS_WINDOWS) | ||||
#else | #else | ||||
::Window getChildWindow(::Display* const display, const ::Window hostWindow) const | |||||
static ::Window getChildWindow(::Display* const display, const ::Window ourWindow) | |||||
{ | { | ||||
::Window rootWindow, parentWindow, ret = 0; | ::Window rootWindow, parentWindow, ret = 0; | ||||
::Window* childWindows = nullptr; | ::Window* childWindows = nullptr; | ||||
uint numChildren = 0; | uint numChildren = 0; | ||||
XQueryTree(display, hostWindow, &rootWindow, &parentWindow, &childWindows, &numChildren); | |||||
XQueryTree(display, ourWindow, &rootWindow, &parentWindow, &childWindows, &numChildren); | |||||
if (numChildren > 0 && childWindows != nullptr) | if (numChildren > 0 && childWindows != nullptr) | ||||
{ | { | ||||
@@ -66,7 +66,7 @@ Size<uint> getChildWindowSize(const uintptr_t winId) | |||||
#else | #else | ||||
if (::Display* const display = XOpenDisplay(nullptr)) | if (::Display* const display = XOpenDisplay(nullptr)) | ||||
{ | { | ||||
if (const ::Window childWindow = getChildWindow(display, fOurWindowLookingToResize)) | |||||
if (const ::Window childWindow = getChildWindow(display, (::Window)winId)) | |||||
{ | { | ||||
d_stdout("found child window"); | d_stdout("found child window"); | ||||
@@ -97,7 +97,12 @@ Size<uint> getChildWindowSize(const uintptr_t winId) | |||||
d_stdout("child window bounds %u %u", width, height); | d_stdout("child window bounds %u %u", width, height); | ||||
if (width > 1 && height > 1) | if (width > 1 && height > 1) | ||||
{ | |||||
// XMoveWindow(display, (::Window)winId, 0, 40); | |||||
// XResizeWindow(display, (::Window)winId, width, height); | |||||
// XMoveWindow(display, childWindow, 0, 40); | |||||
return Size<uint>(static_cast<uint>(width), static_cast<uint>(height)); | return Size<uint>(static_cast<uint>(width), static_cast<uint>(height)); | ||||
} | |||||
} | } | ||||
else | else | ||||
d_stdout("child window without bounds"); | d_stdout("child window without bounds"); | ||||
@@ -10,14 +10,14 @@ | |||||
NAME = Ildaeil-FX | NAME = Ildaeil-FX | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Files to build (DPF stuff) | |||||
# Files to build | |||||
FILES_DSP = \ | FILES_DSP = \ | ||||
IldaeilPlugin.cpp | IldaeilPlugin.cpp | ||||
FILES_UI = \ | FILES_UI = \ | ||||
IldaeilUI.cpp \ | IldaeilUI.cpp \ | ||||
../common/SizeUtils.cpp \ | |||||
../Common/SizeUtils.cpp \ | |||||
../../dpf-widgets/opengl/DearImGui.cpp | ../../dpf-widgets/opengl/DearImGui.cpp | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
@@ -33,10 +33,10 @@ endif | |||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/plugin/$(CARLA_BUILD_TYPE)/carla-host-plugin.cpp.o | EXTRA_LIBS += $(CARLA_BUILD_DIR)/plugin/$(CARLA_BUILD_TYPE)/carla-host-plugin.cpp.o | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_engine_plugin.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_engine_plugin.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_plugin.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/carla_plugin.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/native-plugins.a | |||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/audio_decoder.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/audio_decoder.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/jackbridge.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/jackbridge.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/lilv.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/lilv.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/native-plugins.a | |||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/rtmempool.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/rtmempool.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/sfzero.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/sfzero.a | ||||
EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/water.a | EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/water.a | ||||
@@ -55,6 +55,7 @@ EXTRA_LIBS += $(CARLA_BUILD_DIR)/modules/$(CARLA_BUILD_TYPE)/juce_gui_extra.a | |||||
include ../../dpf/Makefile.plugins.mk | include ../../dpf/Makefile.plugins.mk | ||||
BUILD_CXX_FLAGS += -pthread | |||||
BUILD_CXX_FLAGS += -I../Common | BUILD_CXX_FLAGS += -I../Common | ||||
BUILD_CXX_FLAGS += -I../../dpf-widgets/generic | BUILD_CXX_FLAGS += -I../../dpf-widgets/generic | ||||
BUILD_CXX_FLAGS += -I../../dpf-widgets/opengl | BUILD_CXX_FLAGS += -I../../dpf-widgets/opengl | ||||
@@ -64,7 +65,7 @@ BUILD_CXX_FLAGS += -I../../carla/source/backend | |||||
BUILD_CXX_FLAGS += -I../../carla/source/includes | BUILD_CXX_FLAGS += -I../../carla/source/includes | ||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
$(BUILD_DIR)/../common/SizeUtils.cpp.o: BUILD_CXX_FLAGS += -ObjC++ | |||||
$(BUILD_DIR)/../Common/SizeUtils.cpp.o: BUILD_CXX_FLAGS += -ObjC++ | |||||
LINK_FLAGS += -framework AppKit | LINK_FLAGS += -framework AppKit | ||||
LINK_FLAGS += -framework Accelerate | LINK_FLAGS += -framework Accelerate | ||||
LINK_FLAGS += -framework AudioToolbox | LINK_FLAGS += -framework AudioToolbox | ||||
@@ -76,6 +77,11 @@ LINK_FLAGS += -framework CoreAudioKit | |||||
LINK_FLAGS += -framework Carbon | LINK_FLAGS += -framework Carbon | ||||
LINK_FLAGS += -framework QuartzCore | LINK_FLAGS += -framework QuartzCore | ||||
LINK_FLAGS += -framework IOKit | LINK_FLAGS += -framework IOKit | ||||
else ifeq ($(WIN32),true) | |||||
else ifeq ($(LINUX),true) | |||||
LINK_FLAGS += $(shell pkg-config --libs fluidsynth freetype2) | |||||
LINK_FLAGS += -ldl -lrt | |||||
LINK_FLAGS += -lmagic | |||||
endif | endif | ||||
# BUILD_CXX_FLAGS += $(shell pkg-config --cflags carla-host-plugin carla-native-plugin carla-utils) | # BUILD_CXX_FLAGS += $(shell pkg-config --cflags carla-host-plugin carla-native-plugin carla-utils) | ||||