From 1e7b9023eeda4289c8d2a94b17eb5aa221e1eddf Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Tue, 23 Jun 2026 01:43:13 -0400 Subject: [PATCH 01/11] Add Syphon source support (macOS) Add a new Syphon source type so MapMap can receive live video shared by other macOS applications (Resolume, VDMX, MadMapper, openFrameworks, ...). - Syphon source (Texture subclass) backed by an Objective-C++ client wrapper (SyphonOpenGLClient + SyphonServerDirectory). Each frame is blitted on the GPU from Syphon's IOSurface-backed GL_TEXTURE_RECTANGLE into the source's own GL_TEXTURE_2D via an FBO: zero-copy, no glReadPixels and no per-frame re-upload. - UX: "Add Syphon Source" toolbar/menu action with a live server picker (SyphonServerDialog), plus an editable server dropdown in the property panel (SyphonGui) to re-point a source. Default name from the server, falling back to an auto-numbered "Syphon N" (generateUniqueSourceName). - Persisted server identity reconnects across launches and server restarts. - macOS-only, gated behind a HAVE_SYPHON qmake define; projects containing a Syphon source load gracefully on other platforms (skipped with a warning). - Vendored, prebuilt Syphon.framework (BSD 2-Clause) under third_party/macos, embedded in the app bundle via @rpath. See third_party/macos/README.md. --- src/app/main.cpp | 7 + src/core/MappingManager.cpp | 20 + src/core/MappingManager.h | 6 + src/core/ProjectReader.cpp | 4 +- src/core/Source.h | 2 +- src/core/Syphon.h | 133 ++++++ src/core/SyphonImpl.mm | 423 ++++++++++++++++++ src/core/core.pri | 6 + src/gui/MainWindow.cpp | 103 ++++- src/gui/MainWindow.h | 6 + src/gui/SourceGui.cpp | 136 ++++++ src/gui/SourceGui.h | 42 ++ src/gui/SyphonServerDialog.cpp | 116 +++++ src/gui/SyphonServerDialog.h | 68 +++ src/gui/gui.pri | 6 + src/src.pri | 17 + third_party/macos/README.md | 26 ++ third_party/macos/Syphon.LICENSE.txt | 29 ++ third_party/macos/Syphon.framework/Headers | 1 + third_party/macos/Syphon.framework/Modules | 1 + third_party/macos/Syphon.framework/Resources | 1 + third_party/macos/Syphon.framework/Syphon | 1 + .../Versions/A/Headers/Syphon.h | 42 ++ .../Versions/A/Headers/SyphonClient.h | 39 ++ .../Versions/A/Headers/SyphonClientBase.h | 67 +++ .../Versions/A/Headers/SyphonImage.h | 39 ++ .../Versions/A/Headers/SyphonImageBase.h | 43 ++ .../Versions/A/Headers/SyphonMetalClient.h | 65 +++ .../Versions/A/Headers/SyphonMetalServer.h | 106 +++++ .../Versions/A/Headers/SyphonOpenGLClient.h | 98 ++++ .../Versions/A/Headers/SyphonOpenGLImage.h | 53 +++ .../Versions/A/Headers/SyphonOpenGLServer.h | 155 +++++++ .../Versions/A/Headers/SyphonServer.h | 39 ++ .../Versions/A/Headers/SyphonServerBase.h | 74 +++ .../A/Headers/SyphonServerDirectory.h | 103 +++++ .../Versions/A/Headers/SyphonSubclassing.h | 79 ++++ .../Versions/A/Modules/module.modulemap | 20 + .../A/Resources/en.lproj/InfoPlist.strings | Bin 0 -> 92 bytes .../macos/Syphon.framework/Versions/A/Syphon | Bin 0 -> 407448 bytes .../macos/Syphon.framework/Versions/Current | 1 + 40 files changed, 2174 insertions(+), 3 deletions(-) create mode 100644 src/core/Syphon.h create mode 100644 src/core/SyphonImpl.mm create mode 100644 src/gui/SyphonServerDialog.cpp create mode 100644 src/gui/SyphonServerDialog.h create mode 100644 third_party/macos/README.md create mode 100644 third_party/macos/Syphon.LICENSE.txt create mode 120000 third_party/macos/Syphon.framework/Headers create mode 120000 third_party/macos/Syphon.framework/Modules create mode 120000 third_party/macos/Syphon.framework/Resources create mode 120000 third_party/macos/Syphon.framework/Syphon create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/Syphon.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonClient.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonClientBase.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonImage.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonImageBase.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonMetalClient.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonMetalServer.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonOpenGLClient.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonOpenGLImage.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonOpenGLServer.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonServer.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonServerBase.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonServerDirectory.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Headers/SyphonSubclassing.h create mode 100644 third_party/macos/Syphon.framework/Versions/A/Modules/module.modulemap create mode 100644 third_party/macos/Syphon.framework/Versions/A/Resources/en.lproj/InfoPlist.strings create mode 100755 third_party/macos/Syphon.framework/Versions/A/Syphon create mode 120000 third_party/macos/Syphon.framework/Versions/Current diff --git a/src/app/main.cpp b/src/app/main.cpp index 801afcb2..23bb4c6a 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -13,6 +13,10 @@ #include "MetaObjectRegistry.h" +#ifdef Q_OS_MAC +#include "Syphon.h" +#endif + #include MM_USE_NAMESPACE @@ -40,6 +44,9 @@ void initRegistry() registry.add