Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
32e967a
Improve expression
kunitoki Dec 6, 2025
19c1737
Font tests
kunitoki Dec 7, 2025
668681c
More tests
kunitoki Dec 7, 2025
dc85bea
More tweaks
kunitoki Dec 7, 2025
026ab2d
Fix issues with tests
kunitoki Dec 7, 2025
2e3937b
Move to C++20 by default
kunitoki Dec 7, 2025
320590b
Get rid of Optional and switch to C++20
kunitoki Dec 7, 2025
39a7fb4
Improve python packaging
kunitoki Dec 7, 2025
4846f3d
Bump pybind11
kunitoki Dec 7, 2025
1331b82
More coverage
kunitoki Dec 7, 2025
ab2e435
More tests
kunitoki Dec 7, 2025
dc95c7f
Don't make cache fail
kunitoki Dec 7, 2025
9ea5813
More tests
kunitoki Dec 7, 2025
9cb2612
More string tests
kunitoki Dec 7, 2025
641c620
Removed useless methods and added more useful tests
kunitoki Dec 7, 2025
0d0ee9e
Fixing stuff
kunitoki Dec 7, 2025
322694c
Fix issues
kunitoki Dec 7, 2025
9718313
Fix tests
kunitoki Dec 8, 2025
c650ef6
More tests
kunitoki Dec 8, 2025
0c2a4c5
More tests
kunitoki Dec 8, 2025
85bd880
Fix wasm builds now that we are on C++20
kunitoki Dec 8, 2025
388ba11
Bump cmake and emsdk
kunitoki Dec 8, 2025
0ce9196
Forgot to switch to 20
kunitoki Dec 8, 2025
e27ad4a
I removed cache of emsdk
kunitoki Dec 8, 2025
01713e2
Disable scan for modules
kunitoki Dec 8, 2025
8076487
Fix tests on emscripten
kunitoki Dec 8, 2025
d2d0aab
Fixes for emscripten
kunitoki Dec 8, 2025
9aa7a2a
Fix wasm on emscripten 4
kunitoki Dec 8, 2025
18e1b4e
Add stackTrace to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
kunitoki Dec 8, 2025
9136ff8
Fix syntax for DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
kunitoki Dec 8, 2025
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
7 changes: 1 addition & 6 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ env:
libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev
libxrandr-dev libxrender-dev libglu1-mesa-dev mesa-common-dev
EM_VERSION: 3.1.45
EM_CACHE_FOLDER: "emsdk-cache"
EM_VERSION: 4.0.21

jobs:
build_tests:
Expand All @@ -46,7 +45,6 @@ jobs:
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
- name: Configure
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target yup_tests
Expand All @@ -68,7 +66,6 @@ jobs:
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
- name: Configure
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_console
Expand All @@ -86,7 +83,6 @@ jobs:
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
- name: Configure
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_app
Expand All @@ -104,7 +100,6 @@ jobs:
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
- name: Configure
run: emcmake cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --parallel 4 --target example_graphics
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
#
# ==============================================================================

cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

include (cmake/yup.cmake)
_yup_get_project_version_string (${CMAKE_CURRENT_LIST_DIR}/modules yup_version)
_yup_message (STATUS "Building project version ${yup_version}")

set (CMAKE_CXX_SCAN_FOR_MODULES 0)

if (YUP_PLATFORM_MAC)
set (CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
set (CMAKE_XCODE_GENERATE_SCHEME OFF)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ YUP brings a suite of powerful features, including:

## Prerequisites
Before building, ensure you have a:
- C++17-compliant compiler
- C++20-compliant compiler
- CMake 3.28 or later


Expand Down Expand Up @@ -293,7 +293,7 @@ START_YUP_APPLICATION (MyApplication)
And add this as `CMakeLists.txt`:

```cmake
cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

set (target_name my_app)
set (target_version "0.0.1")
Expand Down
2 changes: 1 addition & 1 deletion cmake/toolchains/ios.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
# command.
#

cmake_minimum_required(VERSION 3.16.0)
cmake_minimum_required(VERSION 3.31)

# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds.
if(DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN})
Expand Down
2 changes: 1 addition & 1 deletion cmake/yup_audio_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function (yup_audio_plugin)

cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

_yup_set_default (YUP_ARG_TARGET_CXX_STANDARD 17)
_yup_set_default (YUP_ARG_TARGET_CXX_STANDARD 20)

set (target_name "${YUP_ARG_TARGET_NAME}")
set (target_version "${YUP_ARG_TARGET_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion cmake/yup_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function (_yup_fetch_perfetto)
FetchContent_MakeAvailable (Perfetto)

add_library (perfetto STATIC)
target_compile_features (perfetto PUBLIC cxx_std_17)
target_compile_features (perfetto PUBLIC cxx_std_20)

target_sources (perfetto
PRIVATE "$<BUILD_INTERFACE:${perfetto_SOURCE_DIR}/sdk/perfetto.cc>"
Expand Down
4 changes: 2 additions & 2 deletions cmake/yup_modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function (_yup_module_setup_target module_name
if (module_cpp_standard)
target_compile_features (${module_name} INTERFACE cxx_std_${module_cpp_standard})
else()
target_compile_features (${module_name} INTERFACE cxx_std_17)
target_compile_features (${module_name} INTERFACE cxx_std_20)
endif()

set_target_properties (${module_name} PROPERTIES
Expand Down Expand Up @@ -366,7 +366,7 @@ function (yup_add_module module_path modules_definitions module_group)
endif()
endforeach()

_yup_set_default (module_cpp_standard "17")
_yup_set_default (module_cpp_standard "20")
_yup_set_default (module_arc_enabled OFF)
_yup_set_default (module_needs_python OFF)
_yup_resolve_variable_paths ("${module_searchpaths}" module_searchpaths)
Expand Down
2 changes: 1 addition & 1 deletion cmake/yup_platforms.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function (_yup_prepare_gradle_android)
_yup_set_default (YUP_ANDROID_TOOLCHAIN "clang")
_yup_set_default (YUP_ANDROID_PLATFORM "android-${YUP_ANDROID_MIN_SDK_VERSION}")
_yup_set_default (YUP_ANDROID_STL "c++_shared")
_yup_set_default (YUP_ANDROID_CPP_VERSION "17")
_yup_set_default (YUP_ANDROID_CPP_VERSION "20")
_yup_set_default (YUP_ANDROID_APPLICATION_NAMESPACE "org.yup")
_yup_set_default (YUP_ANDROID_APPLICATION_ID "org.yup.default_app")
_yup_set_default (YUP_ANDROID_APPLICATION_VERSION "1.0")
Expand Down
4 changes: 2 additions & 2 deletions cmake/yup_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function (yup_prepare_python_stdlib target_name python_tools_path output_variabl

cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

set (default_ignored_library_patterns "lib2to3" "pydoc_data" "_xxtestfuzz*")
set (default_ignored_library_patterns "lib2to3")

set (ignored_library_patterns ${default_ignored_library_patterns})
list (APPEND ignored_library_patterns ${YUP_ARG_IGNORED_LIBRARY_PATTERNS})
Expand All @@ -45,7 +45,7 @@ function (yup_prepare_python_stdlib target_name python_tools_path output_variabl

get_filename_component (python_root_path "${python_embed_env_SOURCE_DIR}" REALPATH)
else()
get_filename_component (python_root_path "${Python_LIBRARY_DIRS}" REALPATH)
get_filename_component (python_root_path "${Python_LIBRARY_DIRS}/.." REALPATH)
endif()

_yup_message (STATUS "Executing python stdlib archive generator tool")
Expand Down
5 changes: 2 additions & 3 deletions cmake/yup_standalone.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function (yup_standalone_app)

cmake_parse_arguments (YUP_ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})

_yup_set_default (YUP_ARG_TARGET_CXX_STANDARD 17)
_yup_set_default (YUP_ARG_TARGET_CXX_STANDARD 20)
_yup_set_default (YUP_ARG_TARGET_ICON "${CMAKE_SOURCE_DIR}/cmake/resources/app-icon.png")

set (target_name "${YUP_ARG_TARGET_NAME}")
Expand Down Expand Up @@ -177,15 +177,14 @@ function (yup_standalone_app)
-sASSERTIONS=1
-sDISABLE_EXCEPTION_CATCHING=0
-sERROR_ON_UNDEFINED_SYMBOLS=1
-sDEMANGLE_SUPPORT=1
-sSTACK_OVERFLOW_CHECK=2
-sFORCE_FILESYSTEM=1
-sNODERAWFS=0
-sWASMFS=1
-sFETCH=1
#-sASYNCIFY=1
-sEXPORTED_RUNTIME_METHODS=ccall,cwrap
-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall'
-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$dynCall','$stackTrace'
--shell-file "${YUP_ARG_CUSTOM_SHELL}")

foreach (preload_file ${YUP_ARG_PRELOAD_FILES})
Expand Down
4 changes: 2 additions & 2 deletions docs/Building Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extern "C" yup::AudioProcessor* createPluginProcessor()
Create a `CMakeLists.txt` file for your plugin:

```cmake
cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

set (target_name my_plugin)
set (target_version "0.0.1")
Expand All @@ -124,7 +124,7 @@ yup_audio_plugin (
TARGET_IDE_GROUP "MyPlugin"
TARGET_APP_ID "com.mycompany.${target_name}"
TARGET_APP_NAMESPACE "com.mycompany"
TARGET_CXX_STANDARD 17
TARGET_CXX_STANDARD 20
PLUGIN_ID "com.mycompany.MyPlugin"
PLUGIN_NAME "MyPlugin"
PLUGIN_VENDOR "com.mycompany"
Expand Down
4 changes: 2 additions & 2 deletions docs/Building Standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ START_YUP_APPLICATION (MyApplication)
Create a `CMakeLists.txt` file for your application:

```cmake
cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

set (target_name my_app)
set (target_version "1.0.0")
Expand All @@ -110,7 +110,7 @@ yup_standalone_app (
TARGET_IDE_GROUP "MyApp"
TARGET_APP_ID "com.mycompany.${target_name}"
TARGET_APP_NAMESPACE "com.mycompany"
TARGET_CXX_STANDARD 17
TARGET_CXX_STANDARD 20
INITIAL_MEMORY 268435456 # 256MB initial memory
MODULES
yup_audio_devices
Expand Down
2 changes: 1 addition & 1 deletion examples/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# ==============================================================================

cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

# ==== Set target name and version
set (target_name example_app)
Expand Down
2 changes: 1 addition & 1 deletion examples/console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# ==============================================================================

cmake_minimum_required(VERSION 3.28)
cmake_minimum_required(VERSION 3.31)

# ==== Prepare target
set (target_name example_console)
Expand Down
2 changes: 1 addition & 1 deletion examples/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# ==============================================================================

cmake_minimum_required (VERSION 3.28)
cmake_minimum_required (VERSION 3.31)

# ==== Set target name and version
set (target_name example_graphics)
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# ==============================================================================

cmake_minimum_required(VERSION 3.28)
cmake_minimum_required(VERSION 3.31)

# ==== Prepare target
set (target_name example_plugin)
Expand All @@ -31,7 +31,7 @@ yup_audio_plugin (
TARGET_IDE_GROUP "Examples"
TARGET_APP_ID "org.yup.${target_name}"
TARGET_APP_NAMESPACE "org.yup"
TARGET_CXX_STANDARD 17
TARGET_CXX_STANDARD 20
PLUGIN_ID "org.yup.YupCLAP"
PLUGIN_NAME "YupCLAPPZ"
PLUGIN_VENDOR "org.yup"
Expand Down
60 changes: 30 additions & 30 deletions modules/yup_audio_basics/audio_play_head/yup_AudioPlayHead.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,43 +361,43 @@ class YUP_API AudioPlayHead
{
public:
/** Returns the number of samples that have elapsed. */
Optional<int64_t> getTimeInSamples() const { return getOptional (flagTimeSamples, timeInSamples); }
std::optional<int64_t> getTimeInSamples() const { return getOptional (flagTimeSamples, timeInSamples); }

/** @see getTimeInSamples() */
void setTimeInSamples (Optional<int64_t> timeInSamplesIn) { setOptional (flagTimeSamples, timeInSamples, timeInSamplesIn); }
void setTimeInSamples (std::optional<int64_t> timeInSamplesIn) { setOptional (flagTimeSamples, timeInSamples, timeInSamplesIn); }

/** Returns the number of seconds that have elapsed. */
Optional<double> getTimeInSeconds() const { return getOptional (flagTimeSeconds, timeInSeconds); }
std::optional<double> getTimeInSeconds() const { return getOptional (flagTimeSeconds, timeInSeconds); }

/** @see getTimeInSamples() */
void setTimeInSeconds (Optional<double> timeInSecondsIn) { setOptional (flagTimeSeconds, timeInSeconds, timeInSecondsIn); }
void setTimeInSeconds (std::optional<double> timeInSecondsIn) { setOptional (flagTimeSeconds, timeInSeconds, timeInSecondsIn); }

/** Returns the bpm, if available. */
Optional<double> getBpm() const { return getOptional (flagTempo, tempoBpm); }
std::optional<double> getBpm() const { return getOptional (flagTempo, tempoBpm); }

/** @see getBpm() */
void setBpm (Optional<double> bpmIn) { setOptional (flagTempo, tempoBpm, bpmIn); }
void setBpm (std::optional<double> bpmIn) { setOptional (flagTempo, tempoBpm, bpmIn); }

/** Returns the time signature, if available. */
Optional<TimeSignature> getTimeSignature() const { return getOptional (flagTimeSignature, timeSignature); }
std::optional<TimeSignature> getTimeSignature() const { return getOptional (flagTimeSignature, timeSignature); }

/** @see getTimeSignature() */
void setTimeSignature (Optional<TimeSignature> timeSignatureIn) { setOptional (flagTimeSignature, timeSignature, timeSignatureIn); }
void setTimeSignature (std::optional<TimeSignature> timeSignatureIn) { setOptional (flagTimeSignature, timeSignature, timeSignatureIn); }

/** Returns host loop points, if available. */
Optional<LoopPoints> getLoopPoints() const { return getOptional (flagLoopPoints, loopPoints); }
std::optional<LoopPoints> getLoopPoints() const { return getOptional (flagLoopPoints, loopPoints); }

/** @see getLoopPoints() */
void setLoopPoints (Optional<LoopPoints> loopPointsIn) { setOptional (flagLoopPoints, loopPoints, loopPointsIn); }
void setLoopPoints (std::optional<LoopPoints> loopPointsIn) { setOptional (flagLoopPoints, loopPoints, loopPointsIn); }

/** The number of bars since the beginning of the timeline.

This value isn't available in all hosts or in all plugin formats.
*/
Optional<int64_t> getBarCount() const { return getOptional (flagBarCount, barCount); }
std::optional<int64_t> getBarCount() const { return getOptional (flagBarCount, barCount); }

/** @see getBarCount() */
void setBarCount (Optional<int64_t> barCountIn) { setOptional (flagBarCount, barCount, barCountIn); }
void setBarCount (std::optional<int64_t> barCountIn) { setOptional (flagBarCount, barCount, barCountIn); }

/** The position of the start of the last bar, in units of quarter-notes.

Expand All @@ -406,40 +406,40 @@ class YUP_API AudioPlayHead

Note - this value may be unavailable on some hosts, e.g. Pro-Tools.
*/
Optional<double> getPpqPositionOfLastBarStart() const { return getOptional (flagLastBarStartPpq, lastBarStartPpq); }
std::optional<double> getPpqPositionOfLastBarStart() const { return getOptional (flagLastBarStartPpq, lastBarStartPpq); }

/** @see getPpqPositionOfLastBarStart() */
void setPpqPositionOfLastBarStart (Optional<double> positionIn) { setOptional (flagLastBarStartPpq, lastBarStartPpq, positionIn); }
void setPpqPositionOfLastBarStart (std::optional<double> positionIn) { setOptional (flagLastBarStartPpq, lastBarStartPpq, positionIn); }

/** The video frame rate, if available. */
Optional<FrameRate> getFrameRate() const { return getOptional (flagFrameRate, frame); }
std::optional<FrameRate> getFrameRate() const { return getOptional (flagFrameRate, frame); }

/** @see getFrameRate() */
void setFrameRate (Optional<FrameRate> frameRateIn) { setOptional (flagFrameRate, frame, frameRateIn); }
void setFrameRate (std::optional<FrameRate> frameRateIn) { setOptional (flagFrameRate, frame, frameRateIn); }

/** The current play position, in units of quarter-notes. */
Optional<double> getPpqPosition() const { return getOptional (flagPpqPosition, positionPpq); }
std::optional<double> getPpqPosition() const { return getOptional (flagPpqPosition, positionPpq); }

/** @see getPpqPosition() */
void setPpqPosition (Optional<double> ppqPositionIn) { setOptional (flagPpqPosition, positionPpq, ppqPositionIn); }
void setPpqPosition (std::optional<double> ppqPositionIn) { setOptional (flagPpqPosition, positionPpq, ppqPositionIn); }

/** For timecode, the position of the start of the timeline, in seconds from 00:00:00:00. */
Optional<double> getEditOriginTime() const { return getOptional (flagOriginTime, originTime); }
std::optional<double> getEditOriginTime() const { return getOptional (flagOriginTime, originTime); }

/** @see getEditOriginTime() */
void setEditOriginTime (Optional<double> editOriginTimeIn) { setOptional (flagOriginTime, originTime, editOriginTimeIn); }
void setEditOriginTime (std::optional<double> editOriginTimeIn) { setOptional (flagOriginTime, originTime, editOriginTimeIn); }

/** Get the host's callback time in nanoseconds, if available. */
Optional<uint64_t> getHostTimeNs() const { return getOptional (flagHostTimeNs, hostTimeNs); }
std::optional<uint64_t> getHostTimeNs() const { return getOptional (flagHostTimeNs, hostTimeNs); }

/** @see getHostTimeNs() */
void setHostTimeNs (Optional<uint64_t> hostTimeNsIn) { setOptional (flagHostTimeNs, hostTimeNs, hostTimeNsIn); }
void setHostTimeNs (std::optional<uint64_t> hostTimeNsIn) { setOptional (flagHostTimeNs, hostTimeNs, hostTimeNsIn); }

/** The current play position, in samples from the start of processing, without looping, if available. */
Optional<int64_t> getContinuousTimeInSamples() const { return getOptional (flagContinuousTime, continuousTimeInSamples); }
std::optional<int64_t> getContinuousTimeInSamples() const { return getOptional (flagContinuousTime, continuousTimeInSamples); }

/** @see getContinuousTimeInSamples() */
void setContinuousTimeInSamples (Optional<int64_t> cont) { setOptional (flagContinuousTime, continuousTimeInSamples, cont); }
void setContinuousTimeInSamples (std::optional<int64_t> cont) { setOptional (flagContinuousTime, continuousTimeInSamples, cont); }

/** True if the transport is currently playing. */
bool getIsPlaying() const { return getFlag (flagIsPlaying); }
Expand Down Expand Up @@ -502,18 +502,18 @@ class YUP_API AudioPlayHead
}

template <typename Value>
Optional<Value> getOptional (int64_t flagToCheck, Value value) const
std::optional<Value> getOptional (int64_t flagToCheck, Value value) const
{
return getFlag (flagToCheck) ? makeOptional (std::move (value)) : nullopt;
return getFlag (flagToCheck) ? std::make_optional (std::move (value)) : std::nullopt;
}

template <typename Value>
void setOptional (int64_t flagToCheck, Value& value, Optional<Value> opt)
void setOptional (int64_t flagToCheck, Value& value, std::optional<Value> opt)
{
if (opt.hasValue())
if (opt.has_value())
value = *opt;

setFlag (flagToCheck, opt.hasValue());
setFlag (flagToCheck, opt.has_value());
}

enum
Expand Down Expand Up @@ -564,7 +564,7 @@ class YUP_API AudioPlayHead
in which a time would make sense, and some hosts will almost certainly have
multithreading issues if it's not called on the audio thread.
*/
virtual Optional<PositionInfo> getPosition() const = 0;
virtual std::optional<PositionInfo> getPosition() const = 0;

/** Returns true if this object can control the transport. */
virtual bool canControlTransport();
Expand Down
Loading
Loading