Skip to content
Merged
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
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ YUP brings a suite of powerful features, including:

## Supported Sound Formats

| | **Wav** | **Wav64** | **Mp3** | **OGG** | **Flac** | **Opus** | **AAC** | **WMF** |
|-------------------|:------------------:|:------------------:|:------------------:|:--------------:|:------------------:|:------------------:|:------------------:|:--------------:|
| **Windows** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | :construction: | :construction: |
| **Windows** (dec) | :white_check_mark: | :white_check_mark: | :construction: | :construction: | :white_check_mark: | :white_check_mark: | :construction: | :construction: |
| **macOS** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **macOS** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **Linux** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **Linux** (dec) | :white_check_mark: | :white_check_mark: | :construction: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **WASM** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **WASM** (dec) | :white_check_mark: | :white_check_mark: | :construction: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **Android** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **Android** (dec) | :white_check_mark: | :white_check_mark: | :construction: | :construction: | :white_check_mark: | :white_check_mark: | | |
| **iOS** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **iOS** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| | **Wav** | **Wav64** | **Mp3** | **OGG** | **Flac** | **Opus** | **AAC** | **WMF** |
|-------------------|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|
| **Windows** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Windows** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **macOS** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **macOS** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **Linux** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| **Linux** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| **WASM** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| **WASM** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| **Android** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | |
| **Android** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :construction: | |
| **iOS** (enc) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
| **iOS** (dec) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |

## Prerequisites
Before building, ensure you have a:
Expand Down
102 changes: 35 additions & 67 deletions cmake/yup_modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function (_yup_module_fetch_upstream module_name module_path module_upstream mod

_yup_message (STATUS "Fetching upstream sources for ${module_name}")

set (upstream_target_dir "${CMAKE_BINARY_DIR}/externals/${module_name}")

if (module_upstream)
set (download_dir "${CMAKE_BINARY_DIR}/_yup_upstream_downloads")
file (MAKE_DIRECTORY "${download_dir}")
Expand Down Expand Up @@ -139,28 +141,26 @@ function (_yup_module_fetch_upstream module_name module_path module_upstream mod
endif()
endif()

set (upstream_target_dir "${CMAKE_BINARY_DIR}/externals/${module_name}/upstream")
file (REMOVE_RECURSE "${upstream_target_dir}")
file (MAKE_DIRECTORY "${upstream_target_dir}")
file (GLOB extracted_items "${source_dir}/*")
if (extracted_items)
file (REMOVE_RECURSE "${upstream_target_dir}")
file (MAKE_DIRECTORY "${upstream_target_dir}")
file (COPY ${extracted_items} DESTINATION "${upstream_target_dir}")
endif()
else()
if (NOT module_branch)
set (module_branch "HEAD")
endif()

set (upstream_target_dir "${CMAKE_BINARY_DIR}/externals/${module_name}/upstream")
if (module_submodules)
set (module_submodules_recurse ON)
else()
set (module_submodules_recurse OFF)
endif()

file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/externals/${module_name}")

file (REMOVE_RECURSE "${upstream_target_dir}")
file (MAKE_DIRECTORY "${upstream_target_dir}")

set (module_branch_value "${module_branch}")
string (STRIP "${module_branch_value}" module_branch_value)
string (REGEX REPLACE "^\"(.*)\"$" "\\1" module_branch_value "${module_branch_value}")
Expand Down Expand Up @@ -208,7 +208,7 @@ function (_yup_module_fetch_upstream module_name module_path module_upstream mod
list (APPEND clone_args "${module_repository}" "${upstream_target_dir}")
execute_process (
COMMAND ${clone_args}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals/${module_name}"
WORKING_DIRECTORY "${upstream_target_dir}"
RESULT_VARIABLE clone_result)
endif()

Expand Down Expand Up @@ -707,26 +707,29 @@ function (yup_add_module module_path modules_definitions module_group)

# ==== Prepare include paths
get_filename_component (module_include_path ${module_path} DIRECTORY)
list (APPEND module_include_paths "${module_include_path}")
list (APPEND module_include_paths "${module_include_path}" "${module_path}")

if (module_upstream OR module_repository)
_yup_module_get_upstream_path ("${module_name}" "${module_path}" module_upstream_path)
if (module_upstream_path)
list (APPEND module_include_paths "${module_upstream_path}")
get_filename_component (module_upstream_include_path ${module_upstream_path} DIRECTORY)
list (APPEND module_include_paths "${module_upstream_path}" "${module_upstream_include_path}")
else()
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals/${module_name}/upstream")
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals")
endif()
endif()

foreach (searchpath IN LISTS module_searchpaths)
if (EXISTS "${searchpath}")
list (APPEND module_include_paths "${searchpath}")
elseif (EXISTS "${module_path}/${searchpath}")
list (APPEND module_include_paths "${module_path}/${searchpath}")
elseif (module_upstream_path AND EXISTS "${module_upstream_path}/${searchpath}")
if (module_upstream_path AND EXISTS "${module_upstream_path}/${searchpath}")
list (APPEND module_include_paths "${module_upstream_path}/${searchpath}")
elseif (module_upstream OR module_repository)
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals/${module_name}/upstream/${searchpath}")
if (EXISTS "${CMAKE_BINARY_DIR}/externals/${module_name}/${searchpath}")
list (APPEND module_include_paths "${CMAKE_BINARY_DIR}/externals/${module_name}/${searchpath}")
endif()
elseif (EXISTS "${module_path}/${searchpath}")
list (APPEND module_include_paths "${module_path}/${searchpath}")
elseif (EXISTS "${searchpath}")
list (APPEND module_include_paths "${searchpath}")
endif()
endforeach()

Expand Down Expand Up @@ -821,60 +824,25 @@ macro (yup_add_default_modules modules_path)

# ==== Thirdparty modules
set (thirdparty_group "Thirdparty")
yup_add_module (${modules_path}/thirdparty/zlib "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/glad "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/harfbuzz "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/libpng "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/libwebp "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/sheenbidi "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/yoga_library "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/rive "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/rive_decoders "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/rive_renderer "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/oboe_library "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/pffft_library "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/dr_libs "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/opus_library "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/flac_library "${modules_definitions}" ${thirdparty_group})
yup_add_module (${modules_path}/thirdparty/hmp3_library "${modules_definitions}" ${thirdparty_group})
file (GLOB thirdparty_module_dirs "${modules_path}/thirdparty/*")
foreach (thirdparty_module_dir IN LISTS thirdparty_module_dirs)
if (IS_DIRECTORY "${thirdparty_module_dir}")
get_filename_component (module_dir_name "${thirdparty_module_dir}" NAME)
yup_add_module (${modules_path}/thirdparty/${module_dir_name} "${modules_definitions}" ${thirdparty_group})
endif()
endforeach()

# ==== Yup modules
set (modules_group "Modules")
yup_add_module (${modules_path}/modules/yup_core "${modules_definitions}" ${modules_group})
add_library (yup::yup_core ALIAS yup_core)

yup_add_module (${modules_path}/modules/yup_events "${modules_definitions}" ${modules_group})
add_library (yup::yup_events ALIAS yup_events)

yup_add_module (${modules_path}/modules/yup_data_model "${modules_definitions}" ${modules_group})
add_library (yup::yup_data_model ALIAS yup_data_model)

yup_add_module (${modules_path}/modules/yup_dsp "${modules_definitions}" ${modules_group})
add_library (yup::yup_dsp ALIAS yup_dsp)

yup_add_module (${modules_path}/modules/yup_graphics "${modules_definitions}" ${modules_group})
add_library (yup::yup_graphics ALIAS yup_graphics)

yup_add_module (${modules_path}/modules/yup_gui "${modules_definitions}" ${modules_group})
add_library (yup::yup_gui ALIAS yup_gui)

yup_add_module (${modules_path}/modules/yup_audio_basics "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_basics ALIAS yup_audio_basics)

yup_add_module (${modules_path}/modules/yup_audio_devices "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_devices ALIAS yup_audio_devices)

yup_add_module (${modules_path}/modules/yup_audio_formats "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_formats ALIAS yup_audio_formats)

yup_add_module (${modules_path}/modules/yup_audio_processors "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_processors ALIAS yup_audio_processors)

yup_add_module (${modules_path}/modules/yup_audio_gui "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_gui ALIAS yup_audio_gui)

yup_add_module (${modules_path}/modules/yup_audio_plugin_client "${modules_definitions}" ${modules_group})
add_library (yup::yup_audio_plugin_client ALIAS yup_audio_plugin_client)
file (GLOB yup_module_dirs "${modules_path}/modules/*")
list (FILTER yup_module_dirs EXCLUDE REGEX ".*yup_python.*")
foreach (yup_module_dir IN LISTS yup_module_dirs)
if (IS_DIRECTORY "${yup_module_dir}")
get_filename_component (module_dir_name "${yup_module_dir}" NAME)
yup_add_module (${modules_path}/modules/${module_dir_name} "${modules_definitions}" ${modules_group})
add_library (yup::${module_dir_name} ALIAS ${module_dir_name})
endif()
endforeach()

if (YUP_ARG_ENABLE_PYTHON)
if (NOT YUP_BUILD_WHEEL)
Expand Down
31 changes: 11 additions & 20 deletions cmake/yup_utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,17 @@ endfunction()
#==============================================================================

function (_yup_collect_upstream_candidate_paths module_name module_path output_variable)
set (candidate_paths "${module_path}/upstream")
set (candidate_paths
"${module_path}/upstream"
"${CMAKE_SOURCE_DIR}/build/externals/${module_name}")

if (DEFINED YUP_UPSTREAM_ROOT AND NOT "${YUP_UPSTREAM_ROOT}" STREQUAL "")
list (APPEND candidate_paths "${YUP_UPSTREAM_ROOT}/${module_name}/upstream")
endif()

if (CMAKE_SOURCE_DIR)
list (APPEND candidate_paths "${CMAKE_SOURCE_DIR}/build/externals/${module_name}/upstream")
list (APPEND candidate_paths "${CMAKE_SOURCE_DIR}/../build/externals/${module_name}/upstream")
endif()
get_filename_component (parent_candidate_path "${CMAKE_SOURCE_DIR}/../build/externals/${module_name}" REALPATH)
list (APPEND candidate_paths "${parent_candidate_path}")

set (candidate_root "${CMAKE_BINARY_DIR}")
set (max_depth 10)
while (max_depth GREATER 0)
list (APPEND candidate_paths "${candidate_root}/externals/${module_name}/upstream")
list (APPEND candidate_paths "${candidate_root}/externals/${module_name}")

get_filename_component (candidate_parent "${candidate_root}" DIRECTORY)
if ("${candidate_parent}" STREQUAL "${candidate_root}")
Expand All @@ -234,6 +230,8 @@ function (_yup_collect_upstream_candidate_paths module_name module_path output_v
set (${output_variable} "${candidate_paths}" PARENT_SCOPE)
endfunction()

#==============================================================================

function (_yup_resolve_variable_paths input_list output_list)
set (resolved_list "")

Expand Down Expand Up @@ -293,16 +291,9 @@ function (_yup_convert_png_to_icns png_path icons_path output_variable)
file (REMOVE_RECURSE "${temp_iconset_path}")
file (MAKE_DIRECTORY "${temp_iconset_path}")

_yup_execute_process_or_fail (/usr/bin/sips -z 16 16 "${png_path}" --out "${temp_iconset_path}/icon_16x16.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 32 32 "${png_path}" --out "${temp_iconset_path}/icon_32x32.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 32 32 "${png_path}" --out "${temp_iconset_path}/icon_16x16@2x.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 64 64 "${png_path}" --out "${temp_iconset_path}/icon_32x32@2x.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 128 128 "${png_path}" --out "${temp_iconset_path}/icon_128x128.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 256 256 "${png_path}" --out "${temp_iconset_path}/icon_128x128@2x.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 256 256 "${png_path}" --out "${temp_iconset_path}/icon_256x256.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 512 512 "${png_path}" --out "${temp_iconset_path}/icon_256x256@2x.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 512 512 "${png_path}" --out "${temp_iconset_path}/icon_512x512.png")
_yup_execute_process_or_fail (/usr/bin/sips -z 1024 1024 "${png_path}" --out "${temp_iconset_path}/icon_512x512@2x.png")
foreach (size IN ITEMS 16 32 128 256 512)
_yup_execute_process_or_fail (/usr/bin/sips -z ${size} ${size} "${png_path}" --out "${temp_iconset_path}/icon_${size}x${size}.png")
endforeach()
_yup_execute_process_or_fail (/usr/bin/iconutil -c icns -o "${output_iconset_path}" "${temp_iconset_path}")

file (REMOVE_RECURSE "${temp_iconset_path}")
Expand Down
1 change: 1 addition & 0 deletions examples/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ yup_standalone_app (
flac_library
hmp3_library
dr_libs
libvorbis
libpng
libwebp
${additional_modules}
Expand Down
6 changes: 4 additions & 2 deletions examples/graphics/source/examples/AudioFileDemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ class AudioFileDemo : public yup::Component
, saveButton ("Save As")
, loopButton ("Loop")
{
formatManager.registerDefaultFormats();
formatManager.registerDefaultFormats (
yup::AudioFormatType::all & ~yup::AudioFormatType::coreAudio);

deviceManager.initialiseWithDefaultDevices (0, 2);
deviceManager.addAudioCallback (&sourcePlayer);
sourcePlayer.setSource (&transportSource);
Expand Down Expand Up @@ -608,7 +610,7 @@ class AudioFileDemo : public yup::Component

yup::String getAudioFileFilter() const
{
return "*.wav;*.aiff;*.aif;*.flac;*.mp3;*.opus;*.m4a;*.wma";
return "*.wav;*.aiff;*.aif;*.flac;*.mp3;*.opus;*.m4a;*.wma;*.ogg";
}

yup::AudioFormatManager formatManager;
Expand Down
Loading