git subrepo clone --branch=sono6good https://github.com/essej/JUCE.git deps/juce

subrepo:
  subdir:   "deps/juce"
  merged:   "b13f9084e"
upstream:
  origin:   "https://github.com/essej/JUCE.git"
  branch:   "sono6good"
  commit:   "b13f9084e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
essej
2022-04-18 17:51:22 -04:00
parent 63e175fee6
commit 25bd5d8adb
3210 changed files with 1045392 additions and 0 deletions

View File

@ -0,0 +1,86 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2020 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# By using JUCE, you agree to the terms of both the JUCE 6 End-User License
# Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
#
# End User License Agreement: www.juce.com/juce-6-licence
# Privacy Policy: www.juce.com/juce-privacy-policy
#
# Or: You may also use this code under the terms of the GPL v3 (see
# www.gnu.org/licenses).
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
function(_juce_create_atomic_target target_name)
add_library("${target_name}" INTERFACE)
add_library("juce::${target_name}" ALIAS "${target_name}")
if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD")))
return()
endif()
set(test_file_contents
[[
#include <atomic>
int main (int argc, char** argv)
{
std::atomic<long long> ll { static_cast<long long> (argc) };
ll ^= 1;
return static_cast<int> (ll);
}
]])
string(RANDOM LENGTH 16 random_file_string)
set(test_file_name "${CMAKE_CURRENT_BINARY_DIR}/check_atomic_${random_file_string}.cpp")
string(RANDOM LENGTH 16 random_dir_string)
set(test_bindir "${CMAKE_CURRENT_BINARY_DIR}/check_atomic_dir_${random_dir_string}")
file(WRITE "${test_file_name}" "${test_file_contents}")
try_compile(compile_result "${test_bindir}" "${test_file_name}"
OUTPUT_VARIABLE test_build_output_0
CXX_STANDARD 14
CXX_STANDARD_REQUIRED TRUE
CXX_EXTENSIONS FALSE)
if(NOT compile_result)
try_compile(compile_result "${test_bindir}" "${test_file_name}"
OUTPUT_VARIABLE test_build_output_1
LINK_LIBRARIES atomic
CXX_STANDARD 14
CXX_STANDARD_REQUIRED TRUE
CXX_EXTENSIONS FALSE)
if (NOT compile_result)
message(FATAL_ERROR
"First build output:\n"
"${test_build_output_0}"
"\n\nSecond build output:\n"
"${test_build_output_1}"
"\n\nJUCE requires support for std::atomic, but this system cannot "
"successfully compile a program which uses std::atomic. "
"You may need to install a dedicated libatomic package using your "
"system's package manager.")
endif()
target_link_libraries("${target_name}" INTERFACE atomic)
endif()
file(REMOVE "${test_file_name}")
file(REMOVE_RECURSE "${test_bindir}")
endfunction()
_juce_create_atomic_target(juce_atomic_wrapper)

View File

@ -0,0 +1,90 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2020 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# The code included in this file is provided under the terms of the ISC license
# http://www.isc.org/downloads/software-support-policy/isc-license. Permission
# To use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted provided that the above copyright notice and
# this permission notice appear in all copies.
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
@PACKAGE_INIT@
if(NOT TARGET juce::juceaide)
add_executable(juce::juceaide IMPORTED)
set_target_properties(juce::juceaide PROPERTIES
IMPORTED_LOCATION "@PACKAGE_JUCEAIDE_PATH@")
endif()
check_required_components("@PROJECT_NAME@")
set(JUCE_MODULES_DIR "@PACKAGE_JUCE_MODULE_PATH@" CACHE INTERNAL
"The path to JUCE modules")
include("@PACKAGE_UTILS_INSTALL_DIR@/JUCEModuleSupport.cmake")
include("@PACKAGE_UTILS_INSTALL_DIR@/JUCEUtils.cmake")
set(_juce_modules
juce_analytics
juce_audio_basics
juce_audio_devices
juce_audio_formats
juce_audio_plugin_client
juce_audio_processors
juce_audio_utils
juce_box2d
juce_core
juce_cryptography
juce_data_structures
juce_dsp
juce_events
juce_graphics
juce_gui_basics
juce_gui_extra
juce_opengl
juce_osc
juce_product_unlocking
juce_video)
set(_targets_defined)
set(_targets_expected)
foreach(_juce_module IN LISTS _juce_modules)
list(APPEND _targets_expected ${_juce_module} juce::${_juce_modules})
if(TARGET ${_juce_module})
list(APPEND _targets_defined ${_juce_module})
endif()
if(TARGET juce::${_juce_module})
list(APPEND _targets_defined juce::${_juce_module})
endif()
endforeach()
if("${_targets_defined}" STREQUAL "${_targets_expected}")
unset(_targets_defined)
unset(_targets_expected)
return()
endif()
if(NOT "${_targets_defined}" STREQUAL "")
message(FATAL_ERROR "Some targets in this export set were already defined.")
endif()
unset(_targets_defined)
unset(_targets_expected)
foreach(_juce_module IN LISTS _juce_modules)
juce_add_module("@PACKAGE_JUCE_MODULE_PATH@/${_juce_module}" ALIAS_NAMESPACE juce)
endforeach()
unset(_juce_modules)

View File

@ -0,0 +1,61 @@
add_library(juce_recommended_warning_flags INTERFACE)
add_library(juce::juce_recommended_warning_flags ALIAS juce_recommended_warning_flags)
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(juce_recommended_warning_flags INTERFACE "/W4")
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(juce_recommended_warning_flags INTERFACE
-Wall -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing
-Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare
-Wint-conversion -Wconditional-uninitialized -Wconstant-conversion
-Wsign-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code
-Wcast-align -Wshift-sign-overflow -Wno-missing-field-initializers
-Wnullable-to-nonnull-conversion -Wno-ignored-qualifiers -Wswitch-enum
-Wpedantic
$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>:
-Wzero-as-null-pointer-constant -Wunused-private-field
-Woverloaded-virtual -Wreorder
-Winconsistent-missing-destructor-override>)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(juce_recommended_warning_flags INTERFACE
-Wall -Wextra -Wpedantic -Wstrict-aliasing -Wuninitialized
-Wunused-parameter -Wsign-compare -Wsign-conversion -Wunreachable-code
-Wcast-align -Wno-implicit-fallthrough -Wno-maybe-uninitialized
-Wno-missing-field-initializers -Wno-ignored-qualifiers -Wswitch-enum
-Wredundant-decls -Wno-strict-overflow -Wshadow
$<$<COMPILE_LANGUAGE:CXX>:
-Woverloaded-virtual -Wreorder -Wzero-as-null-pointer-constant>)
endif()
# ==================================================================================================
add_library(juce_recommended_config_flags INTERFACE)
add_library(juce::juce_recommended_config_flags ALIAS juce_recommended_config_flags)
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(juce_recommended_config_flags INTERFACE
$<IF:$<CONFIG:Debug>,/Od /Zi,/Ox> $<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:/MP> /EHsc)
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
target_compile_options(juce_recommended_config_flags INTERFACE
$<$<CONFIG:Debug>:-g -O0>
$<$<CONFIG:Release>:-O3>)
endif()
# ==================================================================================================
add_library(juce_recommended_lto_flags INTERFACE)
add_library(juce::juce_recommended_lto_flags ALIAS juce_recommended_lto_flags)
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(juce_recommended_lto_flags INTERFACE
$<$<CONFIG:Release>:$<IF:$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">,-GL,-flto>>)
target_link_libraries(juce_recommended_lto_flags INTERFACE
$<$<CONFIG:Release>:$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:-LTCG>>)
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
target_compile_options(juce_recommended_lto_flags INTERFACE $<$<CONFIG:Release>:-flto>)
target_link_libraries(juce_recommended_lto_flags INTERFACE $<$<CONFIG:Release>:-flto>)
endif()

View File

@ -0,0 +1,592 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2020 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# By using JUCE, you agree to the terms of both the JUCE 6 End-User License
# Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
#
# End User License Agreement: www.juce.com/juce-6-licence
# Privacy Policy: www.juce.com/juce-privacy-policy
#
# Or: You may also use this code under the terms of the GPL v3 (see
# www.gnu.org/licenses).
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
# ==================================================================================================
# JUCE Modules Support Helper Functions
#
# In this file, functions intended for use by end-users have the prefix `juce_`.
# Functions beginning with an underscore should be considered private and susceptible to
# change, so don't call them directly.
#
# See the readme at `docs/CMake API.md` for more information about CMake usage,
# including documentation of the public functions in this file.
# ==================================================================================================
include_guard(GLOBAL)
cmake_minimum_required(VERSION 3.15)
# ==================================================================================================
set(JUCE_CMAKE_UTILS_DIR ${CMAKE_CURRENT_LIST_DIR}
CACHE INTERNAL "The path to the folder holding this file and other resources")
include("${JUCE_CMAKE_UTILS_DIR}/JUCEHelperTargets.cmake")
include("${JUCE_CMAKE_UTILS_DIR}/JUCECheckAtomic.cmake")
# Tries to discover the target platform architecture, which is necessary for
# naming VST3 bundle folders and including bundled libraries from modules
function(_juce_find_target_architecture result)
set(test_file "${JUCE_CMAKE_UTILS_DIR}/juce_runtime_arch_detection.cpp")
try_compile(compile_result "${CMAKE_CURRENT_BINARY_DIR}" "${test_file}"
OUTPUT_VARIABLE compile_output)
string(REGEX REPLACE ".*JUCE_ARCH ([a-zA-Z0-9_-]*).*" "\\1" match_result "${compile_output}")
set("${result}" "${match_result}" PARENT_SCOPE)
endfunction()
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD") OR MSYS OR MINGW)
# If you really need to override the detected arch for some reason,
# you can configure the build with -DJUCE_TARGET_ARCHITECTURE=<custom arch>
if(NOT DEFINED JUCE_TARGET_ARCHITECTURE)
_juce_find_target_architecture(target_arch)
set(JUCE_TARGET_ARCHITECTURE "${target_arch}"
CACHE INTERNAL "The target architecture, used to name internal folders in VST3 bundles, and to locate bundled libraries in modules")
endif()
endif()
# ==================================================================================================
function(_juce_add_interface_library target)
add_library(${target} INTERFACE)
target_sources(${target} INTERFACE ${ARGN})
endfunction()
# ==================================================================================================
function(_juce_add_standard_defs juce_target)
target_compile_definitions(${juce_target} INTERFACE
JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1
$<IF:$<CONFIG:DEBUG>,DEBUG=1 _DEBUG=1,NDEBUG=1 _NDEBUG=1>
$<$<PLATFORM_ID:Android>:JUCE_ANDROID=1>)
endfunction()
# ==================================================================================================
macro(_juce_make_absolute path)
if(NOT IS_ABSOLUTE "${${path}}")
get_filename_component("${path}" "${${path}}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
endif()
endmacro()
macro(_juce_make_absolute_and_check path)
_juce_make_absolute("${path}")
if(NOT EXISTS "${${path}}")
message(FATAL_ERROR "No file at path ${${path}}")
endif()
endmacro()
# ==================================================================================================
# This creates an imported interface library with a random name, and then adds
# the fields from a JUCE module header to the target as INTERFACE_ properties.
# We can extract properties later using `_juce_get_metadata`.
# This way, the interface library ends up behaving a bit like a dictionary,
# and we don't have to parse the module header from scratch every time we
# want to find a specific key.
function(_juce_extract_metadata_block delim_str file_with_block out_dict)
string(RANDOM LENGTH 16 random_string)
set(target_name "${random_string}_dict")
set(${out_dict} "${target_name}" PARENT_SCOPE)
add_library(${target_name} INTERFACE IMPORTED)
if(NOT EXISTS ${file_with_block})
message(FATAL_ERROR "Unable to find file ${file_with_block}")
endif()
file(STRINGS ${file_with_block} module_header_contents)
set(last_written_key)
set(append NO)
foreach(line IN LISTS module_header_contents)
if(NOT append)
if(line MATCHES " *BEGIN_${delim_str} *")
set(append YES)
endif()
continue()
endif()
if(append AND (line MATCHES " *END_${delim_str} *"))
break()
endif()
if(line MATCHES "^ *([a-zA-Z]+):")
set(last_written_key "${CMAKE_MATCH_1}")
endif()
string(REGEX REPLACE "^ *${last_written_key}: *" "" line "${line}")
string(REGEX REPLACE "[ ,]+" ";" line "${line}")
set_property(TARGET ${target_name} APPEND PROPERTY
"INTERFACE_JUCE_${last_written_key}" "${line}")
endforeach()
endfunction()
# Fetches properties attached to a metadata target.
function(_juce_get_metadata target key out_var)
get_target_property(content "${target}" "INTERFACE_JUCE_${key}")
if(NOT "${content}" STREQUAL "content-NOTFOUND")
set(${out_var} "${content}" PARENT_SCOPE)
endif()
endfunction()
# ==================================================================================================
function(_juce_should_build_module_source filename output_var)
get_filename_component(trimmed_name "${filename}" NAME_WE)
set(result TRUE)
set(pairs
"OSX\;Darwin"
"Windows\;Windows"
"Linux\;Linux"
"Android\;Android"
"iOS\;iOS")
foreach(pair IN LISTS pairs)
list(GET pair 0 suffix)
list(GET pair 1 system_name)
if((trimmed_name MATCHES "_${suffix}$") AND NOT (CMAKE_SYSTEM_NAME STREQUAL "${system_name}"))
set(result FALSE)
endif()
endforeach()
set("${output_var}" "${result}" PARENT_SCOPE)
endfunction()
function(_juce_module_sources module_path output_path built_sources other_sources)
get_filename_component(module_parent_path ${module_path} DIRECTORY)
get_filename_component(module_glob ${module_path} NAME)
file(GLOB_RECURSE all_module_files
CONFIGURE_DEPENDS LIST_DIRECTORIES FALSE
RELATIVE "${module_parent_path}"
"${module_path}/*")
set(base_path "${module_glob}/${module_glob}")
set(module_cpp ${all_module_files})
list(FILTER module_cpp INCLUDE REGEX "^${base_path}[^/]*\\.(c|cc|cpp|cxx|s|asm)$")
if(APPLE)
set(module_mm ${all_module_files})
list(FILTER module_mm INCLUDE REGEX "^${base_path}[^/]*\\.mm$")
if(module_mm)
set(module_mm_replaced ${module_mm})
list(TRANSFORM module_mm_replaced REPLACE "\\.mm$" ".cpp")
list(REMOVE_ITEM module_cpp ${module_mm_replaced})
endif()
set(module_apple_files ${all_module_files})
list(FILTER module_apple_files INCLUDE REGEX "${base_path}[^/]*\\.(m|mm|metal|r|swift)$")
list(APPEND module_cpp ${module_apple_files})
endif()
set(headers ${all_module_files})
set(module_files_to_build)
foreach(filename IN LISTS module_cpp)
_juce_should_build_module_source("${filename}" should_build_file)
if(should_build_file)
list(APPEND module_files_to_build "${filename}")
endif()
endforeach()
if(NOT "${module_files_to_build}" STREQUAL "")
list(REMOVE_ITEM headers ${module_files_to_build})
endif()
foreach(source_list IN ITEMS module_files_to_build headers)
list(TRANSFORM ${source_list} PREPEND "${output_path}/")
endforeach()
set(${built_sources} ${module_files_to_build} PARENT_SCOPE)
set(${other_sources} ${headers} PARENT_SCOPE)
endfunction()
# ==================================================================================================
function(_juce_get_all_plugin_kinds out)
set(${out} AU AUv3 AAX Standalone Unity VST VST3 PARENT_SCOPE)
endfunction()
function(_juce_get_platform_plugin_kinds out)
set(result Standalone)
if(APPLE AND (CMAKE_GENERATOR STREQUAL "Xcode"))
list(APPEND result AUv3)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND result AU)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND result AAX Unity VST VST3)
endif()
set(${out} ${result} PARENT_SCOPE)
endfunction()
function(_juce_add_plugin_definitions target visibility)
_juce_get_all_plugin_kinds(options)
cmake_parse_arguments(JUCE_ARG "${options}" "" "" ${ARGN})
foreach(opt IN LISTS options)
set(flag_value 0)
if(JUCE_ARG_${opt})
set(flag_value 1)
endif()
target_compile_definitions(${target} ${visibility} "JucePlugin_Build_${opt}=${flag_value}")
endforeach()
endfunction()
# ==================================================================================================
# Takes a target, a link visibility, and a variable-length list of framework
# names. On macOS, finds the requested frameworks using `find_library` and
# links them. On iOS, links directly with `-framework Name`.
function(_juce_link_frameworks target visibility)
foreach(framework IN LISTS ARGN)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library("juce_found_${framework}" "${framework}" REQUIRED)
target_link_libraries("${target}" "${visibility}" "${juce_found_${framework}}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# CoreServices is only available on iOS 12+, we must link it weakly on earlier platforms
if((framework STREQUAL "CoreServices") AND (CMAKE_OSX_DEPLOYMENT_TARGET LESS 12.0))
set(framework_flags "-weak_framework ${framework}")
else()
set(framework_flags "-framework ${framework}")
endif()
target_link_libraries("${target}" "${visibility}" "${framework_flags}")
endif()
endforeach()
endfunction()
# ==================================================================================================
function(_juce_add_plugin_wrapper_target format path out_path)
_juce_module_sources("${path}" "${out_path}" out_var headers)
list(FILTER out_var EXCLUDE REGEX "/juce_audio_plugin_client_utils.cpp$")
set(target_name juce_audio_plugin_client_${format})
_juce_add_interface_library("${target_name}" ${out_var})
_juce_add_plugin_definitions("${target_name}" INTERFACE ${format})
_juce_add_standard_defs("${target_name}")
target_compile_features("${target_name}" INTERFACE cxx_std_14)
add_library("juce::${target_name}" ALIAS "${target_name}")
if(format STREQUAL "AUv3")
_juce_link_frameworks("${target_name}" INTERFACE AVFoundation)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_link_frameworks("${target_name}" INTERFACE AudioUnit)
endif()
elseif(format STREQUAL "AU")
_juce_link_frameworks("${target_name}" INTERFACE AudioUnit CoreAudioKit)
endif()
endfunction()
# ==================================================================================================
function(_juce_link_libs_from_metadata module_name dict key)
_juce_get_metadata("${dict}" "${key}" libs)
if(libs)
target_link_libraries(${module_name} INTERFACE ${libs})
endif()
endfunction()
# ==================================================================================================
function(_juce_create_pkgconfig_target name)
if(TARGET juce::pkgconfig_${name})
return()
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(${name} ${ARGN})
add_library(pkgconfig_${name} INTERFACE)
add_library(juce::pkgconfig_${name} ALIAS pkgconfig_${name})
install(TARGETS pkgconfig_${name} EXPORT JUCE)
set(pairs
"INCLUDE_DIRECTORIES\;INCLUDE_DIRS"
"LINK_LIBRARIES\;LINK_LIBRARIES"
"LINK_OPTIONS\;LDFLAGS_OTHER"
"COMPILE_OPTIONS\;CFLAGS_OTHER")
foreach(pair IN LISTS pairs)
list(GET pair 0 key)
list(GET pair 1 value)
if(${name}_${value})
set_target_properties(pkgconfig_${name} PROPERTIES INTERFACE_${key} "${${name}_${value}}")
endif()
endforeach()
endfunction()
# ==================================================================================================
function(_juce_add_library_path target path)
if(EXISTS "${path}")
target_link_directories(${target} INTERFACE ${path})
endif()
endfunction()
function(_juce_add_module_staticlib_paths module_target module_path)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_add_library_path(${module_target} "${module_path}/libs/MacOSX")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
_juce_add_library_path(${module_target} "${module_path}/libs/iOS")
elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
_juce_add_library_path(${module_target} "${module_path}/libs/Linux/${JUCE_TARGET_ARCHITECTURE}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_GENERATOR MATCHES "Visual Studio [0-9]+ (20[0-9]+)")
set(arch "$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,Win32>")
if(NOT CMAKE_GENERATOR_PLATFORM STREQUAL "")
set(arch ${CMAKE_GENERATOR_PLATFORM})
endif()
set(runtime_lib "$<GENEX_EVAL:$<TARGET_PROPERTY:MSVC_RUNTIME_LIBRARY>>")
set(subfolder "MDd")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreadedDebug>,MTd,${subfolder}>")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreadedDLL>,MD,${subfolder}>")
set(subfolder "$<IF:$<STREQUAL:${runtime_lib},MultiThreaded>,MT,${subfolder}>")
target_link_directories(${module_target} INTERFACE
"${module_path}/libs/VisualStudio${CMAKE_MATCH_1}/${arch}/${subfolder}")
elseif(MSYS OR MINGW)
_juce_add_library_path(${module_target} "${module_path}/libs/MinGW/${JUCE_TARGET_ARCHITECTURE}")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
_juce_add_library_path(${module_target} "${module_path}/libs/Android/${CMAKE_ANDROID_ARCH_ABI}")
endif()
endfunction()
# ==================================================================================================
function(juce_add_module module_path)
set(one_value_args INSTALL_PATH ALIAS_NAMESPACE)
cmake_parse_arguments(JUCE_ARG "" "${one_value_args}" "" ${ARGN})
_juce_make_absolute(module_path)
get_filename_component(module_name ${module_path} NAME)
get_filename_component(module_parent_path ${module_path} DIRECTORY)
set(module_header_name "${module_name}.h")
if(NOT EXISTS "${module_path}/${module_header_name}")
set(module_header_name "${module_header_name}pp")
endif()
if(NOT EXISTS "${module_path}/${module_header_name}")
message(FATAL_ERROR "Could not locate module header for module '${module_path}'")
endif()
set(base_path "${module_parent_path}")
_juce_module_sources("${module_path}" "${base_path}" globbed_sources headers)
if(${module_name} STREQUAL "juce_audio_plugin_client")
_juce_get_platform_plugin_kinds(plugin_kinds)
foreach(kind IN LISTS plugin_kinds)
_juce_add_plugin_wrapper_target(${kind} "${module_path}" "${base_path}")
endforeach()
set(utils_source
"${base_path}/${module_name}/juce_audio_plugin_client_utils.cpp")
add_library(juce_audio_plugin_client_utils INTERFACE)
target_sources(juce_audio_plugin_client_utils INTERFACE "${utils_source}")
if(JUCE_ARG_ALIAS_NAMESPACE)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::juce_audio_plugin_client_utils
ALIAS juce_audio_plugin_client_utils)
endif()
file(GLOB_RECURSE all_module_files
CONFIGURE_DEPENDS LIST_DIRECTORIES FALSE
RELATIVE "${module_parent_path}"
"${module_path}/*")
else()
list(APPEND all_module_sources ${globbed_sources})
endif()
_juce_add_interface_library(${module_name} ${all_module_sources})
set_property(GLOBAL APPEND PROPERTY _juce_module_names ${module_name})
set_target_properties(${module_name} PROPERTIES
INTERFACE_JUCE_MODULE_SOURCES "${globbed_sources}"
INTERFACE_JUCE_MODULE_HEADERS "${headers}"
INTERFACE_JUCE_MODULE_PATH "${base_path}")
if(JUCE_ENABLE_MODULE_SOURCE_GROUPS)
target_sources(${module_name} INTERFACE ${headers})
endif()
if(${module_name} STREQUAL "juce_core")
_juce_add_standard_defs(${module_name})
target_link_libraries(juce_core INTERFACE juce::juce_atomic_wrapper)
if(CMAKE_SYSTEM_NAME MATCHES ".*BSD")
target_link_libraries(juce_core INTERFACE execinfo)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
target_sources(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c")
target_include_directories(juce_core INTERFACE "${ANDROID_NDK}/sources/android/cpufeatures")
target_link_libraries(juce_core INTERFACE android log)
endif()
endif()
if(${module_name} STREQUAL "juce_audio_processors")
add_library(juce_vst3_headers INTERFACE)
target_compile_definitions(juce_vst3_headers INTERFACE "$<$<TARGET_EXISTS:juce_vst3_sdk>:JUCE_CUSTOM_VST3_SDK=1>")
target_include_directories(juce_vst3_headers INTERFACE
"$<$<TARGET_EXISTS:juce_vst3_sdk>:$<TARGET_PROPERTY:juce_vst3_sdk,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<$<NOT:$<TARGET_EXISTS:juce_vst3_sdk>>:${base_path}/juce_audio_processors/format_types/VST3_SDK>")
target_link_libraries(juce_audio_processors INTERFACE juce_vst3_headers)
if(JUCE_ARG_ALIAS_NAMESPACE)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::juce_vst3_headers ALIAS juce_vst3_headers)
endif()
endif()
target_include_directories(${module_name} INTERFACE ${base_path})
target_compile_definitions(${module_name} INTERFACE JUCE_MODULE_AVAILABLE_${module_name}=1)
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
target_compile_definitions(${module_name} INTERFACE LINUX=1)
endif()
_juce_extract_metadata_block(JUCE_MODULE_DECLARATION "${module_path}/${module_header_name}" metadata_dict)
_juce_get_metadata("${metadata_dict}" minimumCppStandard module_cpp_standard)
if(module_cpp_standard)
target_compile_features(${module_name} INTERFACE cxx_std_${module_cpp_standard})
else()
target_compile_features(${module_name} INTERFACE cxx_std_11)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
_juce_get_metadata("${metadata_dict}" OSXFrameworks module_osxframeworks)
foreach(module_framework IN LISTS module_osxframeworks)
if(module_framework STREQUAL "")
continue()
endif()
_juce_link_frameworks("${module_name}" INTERFACE "${module_framework}")
endforeach()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" OSXLibs)
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
_juce_get_metadata("${metadata_dict}" iOSFrameworks module_iosframeworks)
foreach(module_framework IN LISTS module_iosframeworks)
if(module_framework STREQUAL "")
continue()
endif()
_juce_link_frameworks("${module_name}" INTERFACE "${module_framework}")
endforeach()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" iOSLibs)
elseif((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
_juce_get_metadata("${metadata_dict}" linuxPackages module_linuxpackages)
if(module_linuxpackages)
_juce_create_pkgconfig_target(${module_name}_LINUX_DEPS ${module_linuxpackages})
target_link_libraries(${module_name} INTERFACE juce::pkgconfig_${module_name}_LINUX_DEPS)
endif()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" linuxLibs)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
if(module_name STREQUAL "juce_gui_basics")
target_compile_options(${module_name} INTERFACE /bigobj)
endif()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" windowsLibs)
elseif(MSYS OR MINGW)
if(module_name STREQUAL "juce_gui_basics")
target_compile_options(${module_name} INTERFACE "-Wa,-mbig-obj")
endif()
_juce_link_libs_from_metadata("${module_name}" "${metadata_dict}" mingwLibs)
endif()
endif()
_juce_get_metadata("${metadata_dict}" dependencies module_dependencies)
target_link_libraries(${module_name} INTERFACE ${module_dependencies})
_juce_get_metadata("${metadata_dict}" searchpaths module_searchpaths)
if(NOT module_searchpaths STREQUAL "")
foreach(module_searchpath IN LISTS module_searchpaths)
target_include_directories(${module_name}
INTERFACE "${module_path}/${module_searchpath}")
endforeach()
endif()
_juce_add_module_staticlib_paths("${module_name}" "${module_path}")
if(JUCE_ARG_INSTALL_PATH)
install(DIRECTORY "${module_path}" DESTINATION "${JUCE_ARG_INSTALL_PATH}")
endif()
if(JUCE_ARG_ALIAS_NAMESPACE)
add_library(${JUCE_ARG_ALIAS_NAMESPACE}::${module_name} ALIAS ${module_name})
endif()
endfunction()
function(juce_add_modules)
set(one_value_args INSTALL_PATH ALIAS_NAMESPACE)
cmake_parse_arguments(JUCE_ARG "" "${one_value_args}" "" ${ARGN})
foreach(path IN LISTS JUCE_ARG_UNPARSED_ARGUMENTS)
juce_add_module(${path}
INSTALL_PATH "${JUCE_ARG_INSTALL_PATH}"
ALIAS_NAMESPACE "${JUCE_ARG_ALIAS_NAMESPACE}")
endforeach()
endfunction()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<scenes>
<scene sceneID="EHf-IW-A2E">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="" sceneMemberID="firstResponder"/>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" red="0" green="0" blue="0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
</objects>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,16 @@
/*
==============================================================================
This file was auto-generated and contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
//==============================================================================
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
return new ${JUCE_PIP_MAIN_CLASS}();
}

View File

@ -0,0 +1,68 @@
/*
==============================================================================
This file contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"
class Application : public juce::JUCEApplication
{
public:
//==============================================================================
Application() = default;
const juce::String getApplicationName() override { return "${JUCE_PIP_NAME}"; }
const juce::String getApplicationVersion() override { return "${PROJECT_VERSION}"; }
void initialise (const juce::String&) override
{
mainWindow.reset (new MainWindow ("${JUCE_PIP_NAME}", new ${JUCE_PIP_MAIN_CLASS}, *this));
}
void shutdown() override { mainWindow = nullptr; }
private:
class MainWindow : public juce::DocumentWindow
{
public:
MainWindow (const juce::String& name, juce::Component* c, JUCEApplication& a)
: DocumentWindow (name, juce::Desktop::getInstance().getDefaultLookAndFeel()
.findColour (ResizableWindow::backgroundColourId),
juce::DocumentWindow::allButtons),
app (a)
{
setUsingNativeTitleBar (true);
setContentOwned (c, true);
#if JUCE_ANDROID || JUCE_IOS
setFullScreen (true);
#else
setResizable (true, false);
setResizeLimits (300, 250, 10000, 10000);
centreWithSize (getWidth(), getHeight());
#endif
setVisible (true);
}
void closeButtonPressed() override
{
app.systemRequestedQuit();
}
private:
JUCEApplication& app;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow)
};
std::unique_ptr<MainWindow> mainWindow;
};
//==============================================================================
START_JUCE_APPLICATION (Application)

View File

@ -0,0 +1,10 @@
/*
==============================================================================
This file was auto-generated and contains the startup code for a PIP.
==============================================================================
*/
#include <JuceHeader.h>
#include "${JUCE_PIP_HEADER}"

Binary file not shown.

View File

@ -0,0 +1,181 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.Runtime.InteropServices;
public class ${plugin_class_name}GUI : IAudioEffectPluginGUI
{
public override string Name { get { return "${plugin_name}"; } }
public override string Description { get { return "${plugin_description}"; } }
public override string Vendor { get { return "${plugin_vendor}"; } }
//==============================================================================
[DllImport("${plugin_name}")] static extern System.IntPtr getRenderCallback();
[DllImport("${plugin_name}")] static extern void unityInitialiseTexture (int id, System.IntPtr texture, int width, int height);
[DllImport("${plugin_name}")] static extern void unityMouseDown (int id, float x, float y, EventModifiers mods, int button);
[DllImport("${plugin_name}")] static extern void unityMouseDrag (int id, float x, float y, EventModifiers mods, int button);
[DllImport("${plugin_name}")] static extern void unityMouseUp (int id, float x, float y, EventModifiers mods);
[DllImport("${plugin_name}")] static extern void unityKeyEvent (int id, KeyCode code, EventModifiers mods, string name);
[DllImport("${plugin_name}")] static extern void unitySetScreenBounds (int id, float x, float y, float w, float h);
//==============================================================================
private class PluginGUIInstance
{
public PluginGUIInstance (ref IAudioEffectPlugin plugin, int id)
{
instanceID = id;
float[] arr;
plugin.GetFloatBuffer ("Editor", out arr, 1);
hasEditor = (arr[0] > 0.0f);
}
public void repaint (Rect r)
{
Vector2 newScreenPosition = GUIUtility.GUIToScreenPoint (r.position);
if (bounds != r
|| screenPosition != newScreenPosition)
{
screenPosition = newScreenPosition;
bounds = r;
unitySetScreenBounds (instanceID, screenPosition.x, screenPosition.y, bounds.width, bounds.height);
setupTexture();
}
GL.IssuePluginEvent (getRenderCallback(), instanceID);
texture.SetPixels32 (pixels);
texture.Apply();
EditorGUI.DrawPreviewTexture (bounds, texture);
}
public bool handleMouseEvent (EventType eventType)
{
Vector2 mousePos = Event.current.mousePosition;
EventModifiers mods = Event.current.modifiers;
if (! bounds.Contains (mousePos))
return false;
Vector2 relativePos = new Vector2 (mousePos.x - bounds.x, mousePos.y - bounds.y);
if (eventType == EventType.MouseDown)
{
unityMouseDown (instanceID, relativePos.x, relativePos.y, mods, Event.current.button);
GUIUtility.hotControl = GUIUtility.GetControlID (FocusType.Passive);
}
else if (eventType == EventType.MouseUp)
{
unityMouseUp (instanceID, relativePos.x, relativePos.y, mods);
GUIUtility.hotControl = 0;
}
else if (eventType == EventType.MouseDrag)
{
unityMouseDrag (instanceID, relativePos.x, relativePos.y, mods, Event.current.button);
}
Event.current.Use();
return true;
}
public void handleKeyEvent (EventType eventType)
{
if (eventType == EventType.KeyDown)
{
KeyCode code = Event.current.keyCode;
if (code == KeyCode.None)
return;
EventModifiers mods = Event.current.modifiers;
unityKeyEvent (instanceID, code, mods, code.ToString());
}
}
private void setupTexture()
{
if (pixelHandle.IsAllocated)
pixelHandle.Free();
texture = new Texture2D ((int) bounds.width, (int) bounds.height, TextureFormat.ARGB32, false);
pixels = texture.GetPixels32();
pixelHandle = GCHandle.Alloc (pixels, GCHandleType.Pinned);
unityInitialiseTexture (instanceID, pixelHandle.AddrOfPinnedObject(), texture.width, texture.height);
}
public int instanceID = -1;
public bool hasEditor;
private Vector2 screenPosition;
private Rect bounds;
private Texture2D texture;
private Color32[] pixels;
private GCHandle pixelHandle;
}
List<PluginGUIInstance> guis = new List<PluginGUIInstance>();
private PluginGUIInstance getGUIInstanceForPlugin (ref IAudioEffectPlugin plugin)
{
float[] idArray;
plugin.GetFloatBuffer ("ID", out idArray, 1);
int id = (int) idArray[0];
for (int i = 0; i < guis.Count; ++i)
{
if (guis[i].instanceID == id)
return guis[i];
}
PluginGUIInstance newInstance = new PluginGUIInstance (ref plugin, id);
guis.Add (newInstance);
return guis[guis.Count - 1];
}
//==============================================================================
public override bool OnGUI (IAudioEffectPlugin plugin)
{
PluginGUIInstance guiInstance = getGUIInstanceForPlugin (ref plugin);
if (! guiInstance.hasEditor)
return true;
float[] arr;
plugin.GetFloatBuffer ("Size", out arr, 6);
Rect r = GUILayoutUtility.GetRect (arr[0], arr[1],
new GUILayoutOption[] { GUILayout.MinWidth (arr[2]), GUILayout.MinHeight (arr[3]),
GUILayout.MaxWidth (arr[4]), GUILayout.MaxHeight (arr[5]) });
int controlID = GUIUtility.GetControlID (FocusType.Passive);
Event currentEvent = Event.current;
EventType currentEventType = currentEvent.GetTypeForControl (controlID);
if (currentEventType == EventType.Repaint)
guiInstance.repaint (r);
else if (currentEvent.isMouse)
guiInstance.handleMouseEvent (currentEventType);
else if (currentEvent.isKey)
guiInstance.handleKeyEvent (currentEventType);
return false;
}
}
#endif

View File

@ -0,0 +1,24 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2020 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# By using JUCE, you agree to the terms of both the JUCE 6 End-User License
# Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
#
# End User License Agreement: www.juce.com/juce-6-licence
# Privacy Policy: www.juce.com/juce-privacy-policy
#
# Or: You may also use this code under the terms of the GPL v3 (see
# www.gnu.org/licenses).
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
file(INSTALL ${src} DESTINATION ${dest} USE_SOURCE_PERMISSIONS)

View File

@ -0,0 +1,57 @@
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(_M_ARM64) || defined(__aarch64__) || defined(__ARM64__)
#if defined(_M_ARM64) || defined(__aarch64__) || defined(__ARM64__)
#error JUCE_ARCH aarch64
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 8) || defined(__ARMv8__) || defined(__ARMv8_A__)
#error JUCE_ARCH armv8l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 7) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(_ARM_ARCH_7) || defined(__CORE_CORTEXA__)
#error JUCE_ARCH armv7l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 6) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6M__)
#error JUCE_ARCH armv6l
#elif (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM == 5) || defined(__ARM_ARCH_5TEJ__)
#error JUCE_ARCH armv5l
#else
#error JUCE_ARCH arm
#endif
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error JUCE_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error JUCE_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error JUCE_ARCH ia64
#elif defined(__mips) || defined(__mips__) || defined(_M_MRX000)
#if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
#error JUCE_ARCH mips64
#else
#error JUCE_ARCH mips
#endif
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error JUCE_ARCH ppc64
#else
#error JUCE_ARCH ppc
#endif
#elif defined(__riscv)
#if __riscv_xlen == 64
#error JUCE_ARCH riscv64
#else
#error JUCE_ARCH riscv
#endif
#else
#error JUCE_ARCH unknown
#endif