Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add audio plugin hosting via Carla #8919

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build-aux/com.obsproject.Studio.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"--talk-name=org.a11y.Bus",
"--own-name=org.kde.StatusNotifierItem-2-2",
"--system-talk-name=org.freedesktop.Avahi",
"--env=VST_PATH=/app/extensions/Plugins/vst"
"--env=CLAP_PATH=/app/extensions/Plugins/clap",
"--env=LADSPA_PATH=/app/extensions/Plugins/ladspa",
"--env=LV2_PATH=/app/extensions/Plugins/lv2:/app/lib/lv2",
"--env=VST_PATH=/app/extensions/Plugins/vst",
"--env=VST3_PATH=/app/extensions/Plugins/vst3"
],
"add-extensions": {
"com.obsproject.Studio.Plugin": {
Expand All @@ -34,7 +38,7 @@
"directory": "extensions/Plugins",
"version": "22.08",
"add-ld-path": "lib",
"merge-dirs": "vst",
"merge-dirs": "clap;ladspa;lv2;vst;vst3",
"subdirectories": true,
"no-autodownload": true
}
Expand Down Expand Up @@ -67,6 +71,7 @@
"modules/50-swig.json",
"modules/50-v4l-utils.json",
"modules/90-asio.json",
"modules/90-carla.json",
"modules/90-nlohmann-json.json",
"modules/90-websocketpp.json",
"modules/99-cef.json",
Expand Down
24 changes: 24 additions & 0 deletions build-aux/modules/90-carla.json
falkTX marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "carla",
"buildsystem": "cmake-ninja",
"builddir": true,
"subdir": "cmake",
"config-opts": [
"-DCMAKE_BUILD_TYPE=Release",
"-DCARLA_USE_JACK=OFF",
"-DCARLA_USE_OSC=OFF"
],
"cleanup": [
"/include",
"/lib/carla/libcarla_native-plugin.so",
"/lib/carla/libcarla_standalone2.so",
"/lib/pkgconfig"
],
"sources": [
{
"type": "git",
"url": "https://github.com/falkTX/Carla.git",
"commit": "070d734cbdc0c64dfea245470f313c81f5d1ca26"
}
]
}
22 changes: 11 additions & 11 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"dependencies": {
"prebuilt": {
"version": "2023-09-18",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"version": "2023-09-28",
"baseUrl": "https://github.com/falkTX/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-universal": "aa9728e04390b4e21f37dbc64d0e182f6b84a6208af0872c7ef386e02be9d54a",
"windows-x64": "c46ba0bb7d5713a8ce1e5456211e4c6b919075cc6c645195f42f8927e1dab29b",
"windows-x86": "c5703c3e71dc2d3c8f8266977bb02f6c7e370cd19633968b192c639599522807",
"linux-x86_64": "40a52e8fc47b6eb02dfa4ba0b24ba79a9f4e34f3c30b3223d55b949618477af5"
"macos-universal": "7c3c88cd943a97e205045dd6545b0bf960a5646d44d86ff08590370a63f1bd6c",
"windows-x64": "7d5d168988a476d064e187e54d3839af8451fbbc2b68774960b270a1dd5ca553",
"windows-x86": "d5da4649d14dbec75b2c3623a163a254d7e3e5e8cad1499271c54b24406a5a4b",
"linux-x86_64": "299fb21599fbe1025c8411b8e9480eb202256667d27e8c313be9e76e246564f9"
}
},
"qt6": {
"version": "2023-09-18",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"version": "2023-09-28",
"baseUrl": "https://github.com/falkTX/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos-universal": "223c112c085e0da3baf257ed3a0a7334b222b0fb411cd686d65eba9ebd3d74f4",
"windows-x64": "d57688e751dd6c3a839ee2ed962a6b78e3e162ecd1d2ab350c324a61964cc8ef"
"macos-universal": "a5762f7ee377858907b9106fa26be095a9bbd0a51c4eacb940827420ae1683a0",
"windows-x64": "5ea5c280229ffd99f4ef44f513e7c34dbd051a83e55cc3f88201b4eee7da5345"
},
"debugSymbols": {
"windows-x64": "08ada0228d53d5f90e5032fd37c4b7d518e9243158e71ebfb1df7bcab6eb30c3"
"windows-x64": "5011605a96411629f6e489d2f42d1a30099628d8a92775ef0cf4644f3b92a4b0"
}
},
"cef": {
Expand Down
14 changes: 14 additions & 0 deletions cmake/Modules/CopyMSVCBins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ file(GLOB QT_IMAGEFORMATS_BIN_FILES "${QtCore_PLUGIN_DIR}/imageformats/qsvg.dll"

file(GLOB QT_ICU_BIN_FILES "${QtCore_BIN_DIR}/icu*.dll")

file(
GLOB
CARLA_BIN_FILES
"${CARLAUTILS_INCLUDE_DIR}/../../bin/carla-*.exe"
"${CARLAUTILS_INCLUDE_DIR}/../../bin/libcarla_utils.dll"
"${CARLAUTILS_INCLUDE_DIR}/../../bin${_bin_suffix}/carla-*.exe"
"${CARLAUTILS_INCLUDE_DIR}/../../bin${_bin_suffix}/libcarla_utils.dll"
"${CARLAUTILS_INCLUDE_DIR}/../bin/carla-*.exe"
"${CARLAUTILS_INCLUDE_DIR}/../bin/libcarla_utils.dll"
"${CARLAUTILS_INCLUDE_DIR}/../bin${_bin_suffix}/carla-*.exe"
"${CARLAUTILS_INCLUDE_DIR}/../bin${_bin_suffix}/libcarla_utils.dll")

set(ALL_BASE_BIN_FILES
${FFMPEG_BIN_FILES}
${X264_BIN_FILES}
Expand All @@ -219,6 +231,7 @@ set(ALL_BASE_BIN_FILES
${LIBFDK_BIN_FILES}
${FREETYPE_BIN_FILES}
${RNNOISE_BIN_FILES}
${CARLA_BIN_FILES}
${QT_ICU_BIN_FILES})

set(ALL_REL_BIN_FILES ${QT_BIN_FILES})
Expand Down Expand Up @@ -272,6 +285,7 @@ obs_status(STATUS "curl files: ${CURL_BIN_FILES}")
obs_status(STATUS "lua files: ${LUA_BIN_FILES}")
obs_status(STATUS "ssl files: ${SSL_BIN_FILES}")
obs_status(STATUS "zlib files: ${ZLIB_BIN_FILES}")
obs_status(STATUS "carla files: ${CARLA_BIN_FILES}")
obs_status(STATUS "Qt Debug files: ${QT_DEBUG_BIN_FILES}")
obs_status(STATUS "Qt Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}")
obs_status(STATUS "Qt Debug Styles files: ${QT_DEBUG_STYLES_BIN_FILES}")
Expand Down
106 changes: 106 additions & 0 deletions cmake/Modules/FindCarlaUtils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Once done these will be defined:
#
# CarlaUtils_FOUND CarlaUtils_INCLUDE_DIRS CarlaUtils_LIBRARIES

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CarlaUtils QUIET carla-utils)
endif()

find_path(
CarlaUtils_INCLUDE_DIR
NAMES utils/CarlaBridgeUtils.hpp
HINTS ${PC_CarlaUtils_INCLUDE_DIRS}
PATHS /usr/include /usr/local/include /app/include
PATH_SUFFIXES carla)

find_library(
CarlaUtils_LIBRARY
NAMES carla_utils libcarla_utils
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_BRIDGE_LV2_GTK2
NAMES carla-bridge-lv2-gtk2
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_BRIDGE_LV2_GTK3
NAMES carla-bridge-lv2-gtk3
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_BRIDGE_NATIVE
NAMES carla-bridge-native
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_DISCOVERY_NATIVE
NAMES carla-discovery-native
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
CarlaUtils
FOUND_VAR CarlaUtils_FOUND
REQUIRED_VARS CarlaUtils_INCLUDE_DIR CarlaUtils_LIBRARY CarlaUtils_BRIDGE_NATIVE CarlaUtils_DISCOVERY_NATIVE)
mark_as_advanced(CarlaUtils_INCLUDE_DIR CarlaUtils_LIBRARY CarlaUtils_BRIDGE_NATIVE CarlaUtils_DISCOVERY_NATIVE)

if(CarlaUtils_FOUND)
set(CarlaUtils_INCLUDE_DIRS ${CarlaUtils_INCLUDE_DIR} ${CarlaUtils_INCLUDE_DIR}/includes
${CarlaUtils_INCLUDE_DIR}/utils)
set(CarlaUtils_LIBRARIES ${CarlaUtils_LIBRARY})

if(NOT TARGET carla::utils)
if(IS_ABSOLUTE "${CarlaUtils_LIBRARIES}")
add_library(carla::utils UNKNOWN IMPORTED GLOBAL)
set_target_properties(carla::utils PROPERTIES IMPORTED_LOCATION "${CarlaUtils_LIBRARIES}")
else()
add_library(carla::utils INTERFACE IMPORTED GLOBAL)
set_target_properties(carla::utils PROPERTIES IMPORTED_LIBNAME "${CarlaUtils_LIBRARIES}")
endif()

if(PC_CarlaUtils_FOUND)
message("DEBUG: using carla-utils pkg-config | ${PC_CarlaUtils_FOUND} | ${PC_CarlaUtils_LDFLAGS}")
set_target_properties(carla::utils PROPERTIES INTERFACE_LINK_OPTIONS ${PC_CarlaUtils_LDFLAGS})
else()
message("DEBUG: NOT using carla-utils pkg-config | ${PC_CarlaUtils_FOUND} | ${PC_CarlaUtils_LDFLAGS}")
endif()

set_target_properties(carla::utils PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CarlaUtils_INCLUDE_DIRS}")
endif()

if(NOT TARGET carla::bridge-lv2-gtk2)
add_executable(carla::bridge-lv2-gtk2 IMPORTED GLOBAL)
set_target_properties(carla::bridge-lv2-gtk2 PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_LV2_GTK2}")
add_dependencies(carla::utils carla::bridge-lv2-gtk2)
endif()

if(NOT TARGET carla::bridge-lv2-gtk3)
add_executable(carla::bridge-lv2-gtk3 IMPORTED GLOBAL)
set_target_properties(carla::bridge-lv2-gtk3 PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_LV2_GTK3}")
add_dependencies(carla::utils carla::bridge-lv2-gtk3)
endif()

if(NOT TARGET carla::bridge-native)
add_executable(carla::bridge-native IMPORTED GLOBAL)
set_target_properties(carla::bridge-native PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_NATIVE}")
add_dependencies(carla::utils carla::bridge-native)
endif()

if(NOT TARGET carla::discovery-native)
add_executable(carla::discovery-native IMPORTED GLOBAL)
set_target_properties(carla::discovery-native PROPERTIES IMPORTED_LOCATION "${CarlaUtils_DISCOVERY_NATIVE}")
add_dependencies(carla::utils carla::discovery-native)
endif()
endif()
156 changes: 156 additions & 0 deletions cmake/finders/FindCarlaUtils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
#[=======================================================================[.rst
FindCarlaUtils
--------------

FindModule for carla-utils and associated libraries

Result Variables
^^^^^^^^^^^^^^^^

This module sets the following variables:

``CarlaUtils_FOUND``
True, if all required components and the core library were found.

Cache variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``CarlaUtils_LIBRARIES``
Path to the library component of carla-utils
``CarlaUtils_INCLUDE_DIRS``
Directories used by carla-utils.

#]=======================================================================]

include(FindPackageHandleStandardArgs)

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CarlaUtils QUIET carla-utils)
endif()

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND NOT PC_CarlaUtils_FOUND)
message("DEBUG: using carla-utils macos framework | ${PC_CarlaUtils_FOUND} | ${PC_CarlaUtils_LDFLAGS}")
set(CarlaUtils_USE_MACOS_FRAMEWORK TRUE)
else()
message("DEBUG: NOT using carla-utils macos framework | ${PC_CarlaUtils_FOUND} | ${PC_CarlaUtils_LDFLAGS}")
set(CarlaUtils_USE_MACOS_FRAMEWORK FALSE)
endif()

find_library(
CarlaUtils_LIBRARY
NAMES carla-utils carla_utils libcarla_utils
HINTS ${PC_CarlaUtils_LIBRARY_DIRS}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_path(
CarlaUtils_INCLUDE_DIR
NAMES utils/CarlaBridgeUtils.hpp
HINTS ${PC_CarlaUtils_INCLUDE_DIRS} ${CarlaUtils_LIBRARY}
PATHS /usr/include /usr/local/include /app/include
PATH_SUFFIXES carla Headers)

find_program(
CarlaUtils_BRIDGE_LV2_GTK2
NAMES carla-bridge-lv2-gtk2
HINTS ${PC_CarlaUtils_LIBRARY_DIRS} ${CarlaUtils_LIBRARY}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_BRIDGE_LV2_GTK3
NAMES carla-bridge-lv2-gtk3
HINTS ${PC_CarlaUtils_LIBRARY_DIRS} ${CarlaUtils_LIBRARY}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_BRIDGE_NATIVE
NAMES carla-bridge-native
HINTS ${PC_CarlaUtils_LIBRARY_DIRS} ${CarlaUtils_LIBRARY}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

find_program(
CarlaUtils_DISCOVERY_NATIVE
NAMES carla-discovery-native
HINTS ${PC_CarlaUtils_LIBRARY_DIRS} ${CarlaUtils_LIBRARY}
PATHS /usr/lib /usr/local/lib /app/lib
PATH_SUFFIXES carla)

if(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin|Windows")
set(CarlaUtils_ERROR_REASON "Ensure that obs-deps is provided as part of CMAKE_PREFIX_PATH.")
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD")
set(CarlaUtils_ERROR_REASON "Ensure that carla is installed on the system.")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
CarlaUtils
FOUND_VAR CarlaUtils_FOUND
REQUIRED_VARS CarlaUtils_LIBRARY CarlaUtils_INCLUDE_DIR CarlaUtils_BRIDGE_NATIVE CarlaUtils_DISCOVERY_NATIVE
REASON_FAILURE_MESSAGE "${CarlaUtils_ERROR_REASON}")
mark_as_advanced(CarlaUtils_LIBRARY CarlaUtils_INCLUDE_DIR CarlaUtils_BRIDGE_NATIVE CarlaUtils_DISCOVERY_NATIVE)
unset(CarlaUtils_ERROR_REASON)

if(CarlaUtils_FOUND)
set(CarlaUtils_INCLUDE_DIRS ${CarlaUtils_INCLUDE_DIR} ${CarlaUtils_INCLUDE_DIR}/includes
${CarlaUtils_INCLUDE_DIR}/utils)
set(CarlaUtils_LIBRARIES ${CarlaUtils_LIBRARY})

if(NOT TARGET carla::utils)
if(CarlaUtils_USE_MACOS_FRAMEWORK)
add_library(carla::utils INTERFACE IMPORTED GLOBAL)
set_target_properties(carla::utils PROPERTIES IMPORTED_LOCATION "${CarlaUtils_LIBRARIES}")
set_target_properties(carla::utils PROPERTIES INTERFACE_LINK_LIBRARIES
$<LINK_LIBRARY:FRAMEWORK,${CarlaUtils_LIBRARIES}>)
elseif(IS_ABSOLUTE "${CarlaUtils_LIBRARIES}")
add_library(carla::utils UNKNOWN IMPORTED GLOBAL)
set_target_properties(carla::utils PROPERTIES IMPORTED_LOCATION "${CarlaUtils_LIBRARIES}")
else()
add_library(carla::utils INTERFACE IMPORTED GLOBAL)
set_target_properties(carla::utils PROPERTIES IMPORTED_LIBNAME "${CarlaUtils_LIBRARIES}")
endif()

if(PC_CarlaUtils_FOUND)
set_target_properties(carla::utils PROPERTIES INTERFACE_LINK_OPTIONS ${PC_CarlaUtils_LDFLAGS})
endif()

set_target_properties(carla::utils PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CarlaUtils_INCLUDE_DIRS}")
endif()

if(NOT TARGET carla::bridge-lv2-gtk2)
add_executable(carla::bridge-lv2-gtk2 IMPORTED GLOBAL)
set_target_properties(carla::bridge-lv2-gtk2 PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_LV2_GTK2}")
add_dependencies(carla::utils carla::bridge-lv2-gtk2)
endif()

if(NOT TARGET carla::bridge-lv2-gtk3)
add_executable(carla::bridge-lv2-gtk3 IMPORTED GLOBAL)
set_target_properties(carla::bridge-lv2-gtk3 PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_LV2_GTK3}")
add_dependencies(carla::utils carla::bridge-lv2-gtk3)
endif()

if(NOT TARGET carla::bridge-native)
add_executable(carla::bridge-native IMPORTED GLOBAL)
set_target_properties(carla::bridge-native PROPERTIES IMPORTED_LOCATION "${CarlaUtils_BRIDGE_NATIVE}")
add_dependencies(carla::utils carla::bridge-native)
endif()

if(NOT TARGET carla::discovery-native)
add_executable(carla::discovery-native IMPORTED GLOBAL)
set_target_properties(carla::discovery-native PROPERTIES IMPORTED_LOCATION "${CarlaUtils_DISCOVERY_NATIVE}")
add_dependencies(carla::utils carla::discovery-native)
endif()
endif()

unset(CarlaUtils_USE_MACOS_FRAMEWORK)

include(FeatureSummary)
set_package_properties(
CarlaUtils PROPERTIES
URL "https://kx.studio/Applications:Carla"
DESCRIPTION "Carla Plugin Host")
Loading
Loading