diff --git a/CMakeLists.txt b/CMakeLists.txt index ff50b768..10d95d66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,9 @@ if(DPF_EXAMPLES) add_subdirectory("examples/CairoUI") endif() endif() - add_subdirectory("examples/ExternalUI") + if((NOT WIN32) AND (NOT APPLE)) + add_subdirectory("examples/ExternalUI") + endif() add_subdirectory("examples/EmbedExternalUI") add_subdirectory("examples/FileHandling") add_subdirectory("examples/Info") diff --git a/examples/EmbedExternalUI/CMakeLists.txt b/examples/EmbedExternalUI/CMakeLists.txt index 71e96579..75dfbae0 100644 --- a/examples/EmbedExternalUI/CMakeLists.txt +++ b/examples/EmbedExternalUI/CMakeLists.txt @@ -9,9 +9,10 @@ dpf_add_plugin(d_embed_external_ui FILES_UI EmbedExternalExampleUI.cpp) +target_include_directories(d_embed_external_ui PUBLIC ".") + if (APPLE) +find_library(APPLE_COCOA_FRAMEWORK "Cocoa") target_compile_options(d_embed_external_ui PUBLIC "-ObjC++") +target_link_libraries(d_embed_external_ui PUBLIC "${APPLE_COCOA_FRAMEWORK}") endif () - -target_include_directories( - d_embed_external_ui PUBLIC ".") diff --git a/examples/ExternalUI/ExternalExampleUI.cpp b/examples/ExternalUI/ExternalExampleUI.cpp index 8899a6e2..eaa38892 100644 --- a/examples/ExternalUI/ExternalExampleUI.cpp +++ b/examples/ExternalUI/ExternalExampleUI.cpp @@ -73,13 +73,13 @@ class ExternalExampleUI : public UI public: ExternalExampleUI() : UI(405, 256), -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST fFifo(-1), fExternalScript(getNextBundlePath()), -#endif + #endif fValue(0.0f) { -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST if (fExternalScript.isEmpty()) { fExternalScript = getCurrentPluginFilename(); @@ -88,7 +88,8 @@ public: fExternalScript += "/ExternalLauncher.sh"; d_stdout("External script = %s", fExternalScript.buffer()); -#endif + #endif + if (isVisible() || isEmbed()) visibilityChanged(true); } @@ -114,7 +115,7 @@ protected: fValue = value; -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST if (fFifo == -1) return; @@ -124,7 +125,7 @@ protected: std::snprintf(valueStr, 23, "%i\n", static_cast(value + 0.5f)); DISTRHO_SAFE_ASSERT(writeRetry(fFifo, valueStr, 24) == sizeof(valueStr)); -#endif + #endif } /* -------------------------------------------------------------------------------------------------------- @@ -135,12 +136,12 @@ protected: */ void uiIdle() override { -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST if (fFifo == -1) return; writeRetry(fFifo, "idle\n", 5); -#endif + #endif } /** @@ -148,7 +149,7 @@ protected: */ void visibilityChanged(const bool visible) override { -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST if (visible) { DISTRHO_SAFE_ASSERT_RETURN(fileExists(fExternalScript),); @@ -191,8 +192,8 @@ protected: unlink(kFifoFilename); terminateAndWaitForExternalProcess(); } -#endif -#ifdef MPV_TEST + #endif + #ifdef MPV_TEST if (visible) { const char* const file = "/home/falktx/Videos/HD/"; // TODO make this a state file? @@ -226,19 +227,19 @@ protected: { terminateAndWaitForExternalProcess(); } -#endif + #endif } // ------------------------------------------------------------------------------------------------------- private: -#ifdef KDE_FIFO_TEST + #ifdef KDE_FIFO_TEST // IPC Stuff int fFifo; // Path to external ui script String fExternalScript; -#endif + #endif // Current value, cached for when UI becomes visible float fValue; diff --git a/examples/ExternalUI/Makefile b/examples/ExternalUI/Makefile index 523e3257..ec2362c7 100644 --- a/examples/ExternalUI/Makefile +++ b/examples/ExternalUI/Makefile @@ -24,7 +24,7 @@ FILES_UI = \ UI_TYPE = external include ../../Makefile.plugins.mk -ifneq ($(HAIKU),true) +ifneq ($(MACOS)$(HAIKU),true) LINK_FLAGS += -ldl endif