Signed-off-by: falkTX <falktx@falktx.com>tags/v1.0
@@ -42,7 +42,7 @@ public: | |||
NativeHostDescriptor fCarlaHostDescriptor; | |||
CarlaHostHandle fCarlaHostHandle; | |||
NativeTimeInfo fCarlaTimeInfo; | |||
mutable NativeTimeInfo fCarlaTimeInfo; | |||
UI* fUI; | |||
@@ -100,7 +100,7 @@ public: | |||
fCarlaPluginDescriptor->cleanup(fCarlaPluginHandle); | |||
} | |||
const NativeTimeInfo* getTimeInfo() | |||
const NativeTimeInfo* hostGetTimeInfo() const noexcept | |||
{ | |||
const TimePosition& timePos(getTimePosition()); | |||
@@ -119,7 +119,25 @@ public: | |||
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,); | |||
@@ -262,29 +280,37 @@ static bool host_is_offline(NativeHostHandle) | |||
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) | |||
{ | |||
case NATIVE_HOST_OPCODE_UI_RESIZE: | |||
static_cast<IldaeilPlugin*>(handle)->resizeUI(index, value); | |||
static_cast<IldaeilPlugin*>(handle)->hostResizeUI(index, value); | |||
break; | |||
default: | |||
break; | |||
} | |||
return 0; | |||
// unused | |||
(void)ptr; | |||
(void)opt; | |||
} | |||
/* ------------------------------------------------------------------------------------------------------------ | |||
@@ -34,13 +34,13 @@ START_NAMESPACE_DGL | |||
#elif defined(DISTRHO_OS_MAC) | |||
#elif defined(DISTRHO_OS_WINDOWS) | |||
#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* childWindows = nullptr; | |||
uint numChildren = 0; | |||
XQueryTree(display, hostWindow, &rootWindow, &parentWindow, &childWindows, &numChildren); | |||
XQueryTree(display, ourWindow, &rootWindow, &parentWindow, &childWindows, &numChildren); | |||
if (numChildren > 0 && childWindows != nullptr) | |||
{ | |||
@@ -66,7 +66,7 @@ Size<uint> getChildWindowSize(const uintptr_t winId) | |||
#else | |||
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"); | |||
@@ -97,7 +97,12 @@ Size<uint> getChildWindowSize(const uintptr_t winId) | |||
d_stdout("child window bounds %u %u", width, height); | |||
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)); | |||
} | |||
} | |||
else | |||
d_stdout("child window without bounds"); | |||
@@ -10,14 +10,14 @@ | |||
NAME = Ildaeil-FX | |||
# -------------------------------------------------------------- | |||
# Files to build (DPF stuff) | |||
# Files to build | |||
FILES_DSP = \ | |||
IldaeilPlugin.cpp | |||
FILES_UI = \ | |||
IldaeilUI.cpp \ | |||
../common/SizeUtils.cpp \ | |||
../Common/SizeUtils.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)/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)/native-plugins.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)/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)/sfzero.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 | |||
BUILD_CXX_FLAGS += -pthread | |||
BUILD_CXX_FLAGS += -I../Common | |||
BUILD_CXX_FLAGS += -I../../dpf-widgets/generic | |||
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 | |||
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 Accelerate | |||
LINK_FLAGS += -framework AudioToolbox | |||
@@ -76,6 +77,11 @@ LINK_FLAGS += -framework CoreAudioKit | |||
LINK_FLAGS += -framework Carbon | |||
LINK_FLAGS += -framework QuartzCore | |||
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 | |||
# BUILD_CXX_FLAGS += $(shell pkg-config --cflags carla-host-plugin carla-native-plugin carla-utils) | |||