Skip to content

Commit

Permalink
Merge branch 'main' into dev/cache_cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Dec 16, 2024
2 parents e11a552 + 0e19ca5 commit e0468b0
Show file tree
Hide file tree
Showing 125 changed files with 7,023 additions and 3,239 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SpacesInSquareBrackets: false
Standard: "c++17"
TabWidth: 4
UseTab: Never
WhitespaceSensitiveMacros: ['EM_ASM', 'EM_JS', 'EM_ASM_INT', 'EM_ASM_DOUBLE', 'EM_ASM_PTR', 'MAIN_THREAD_EM_ASM', 'MAIN_THREAD_EM_ASM_INT', 'MAIN_THREAD_EM_ASM_DOUBLE', 'MAIN_THREAD_EM_ASM_DOUBLE', 'MAIN_THREAD_ASYNC_EM_ASM']
WhitespaceSensitiveMacros: ['JUCE_NTH_ARG_', 'EM_ASM', 'EM_JS', 'EM_ASM_INT', 'EM_ASM_DOUBLE', 'EM_ASM_PTR', 'MAIN_THREAD_EM_ASM', 'MAIN_THREAD_EM_ASM_INT', 'MAIN_THREAD_EM_ASM_DOUBLE', 'MAIN_THREAD_EM_ASM_DOUBLE', 'MAIN_THREAD_ASYNC_EM_ASM']
---
Language: ObjC
BasedOnStyle: Chromium
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- "**/modules/**"
- "**/tests/**"
- "**/thirdparty/**"
- "!**/native/*_apple.*"
- "!**/native/*_emscripten.*"
- "!**/native/*_ios.*"
- "!**/native/*_linux.*"
Expand Down Expand Up @@ -55,13 +56,13 @@ jobs:
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -G "Ninja Multi-Config" -DYUP_TARGET_ANDROID=ON -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON

- name: Build Debug
- name: Build Examples Debug
run: |
pushd ${{runner.workspace}}/build/examples/app && ./gradlew assembleDebug && popd
pushd ${{runner.workspace}}/build/examples/graphics && ./gradlew assembleDebug && popd
pushd ${{runner.workspace}}/build/examples/render && ./gradlew assembleDebug && popd
- name: Build Release
- name: Build Examples Release
run: |
pushd ${{runner.workspace}}/build/examples/app && ./gradlew assemble && popd
pushd ${{runner.workspace}}/build/examples/graphics && ./gradlew assemble && popd
Expand Down
69 changes: 0 additions & 69 deletions .github/workflows/build_mingw.yml_

This file was deleted.

32 changes: 19 additions & 13 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "**/tests/**"
- "**/thirdparty/**"
- "!**/native/*_android.*"
- "!**/native/*_apple.*"
- "!**/native/*_linux.*"
- "!**/native/*_ios.*"
- "!**/native/*_mac.*"
Expand Down Expand Up @@ -51,29 +52,34 @@ jobs:
working-directory: ${{runner.workspace}}/build
run: emcmake cmake $GITHUB_WORKSPACE -G "Ninja Multi-Config" -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON

- name: Build Debug
- name: Build Tests Debug
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Debug --parallel 4 --target yup_tests

- name: Execute Tests Debug
working-directory: ${{runner.workspace}}/build/tests/Debug
run: node yup_tests.js

- name: Build Tests Release
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Release --parallel 4 --target yup_tests

- name: Test Release
working-directory: ${{runner.workspace}}/build/tests/Release
run: node yup_tests.js

- name: Build Examples Debug
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . --config Debug --parallel 4 --target yup_tests
cmake --build . --config Debug --parallel 4 --target example_console
cmake --build . --config Debug --parallel 4 --target example_app
cmake --build . --config Debug --parallel 4 --target example_graphics
cmake --build . --config Debug --parallel 4 --target example_render
- name: Test Debug
working-directory: ${{runner.workspace}}/build/tests/Debug
run: node yup_tests.js

- name: Build Release
- name: Build Examples Release
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . --config Release --parallel 4 --target yup_tests
cmake --build . --config Release --parallel 4 --target example_console
cmake --build . --config Release --parallel 4 --target example_app
cmake --build . --config Release --parallel 4 --target example_graphics
cmake --build . --config Release --parallel 4 --target example_render
- name: Test Release
working-directory: ${{runner.workspace}}/build/tests/Release
run: node yup_tests.js

31 changes: 19 additions & 12 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "**/tests/**"
- "**/thirdparty/**"
- "!**/native/*_android.*"
- "!**/native/*_apple.*"
- "!**/native/*_emscripten.*"
- "!**/native/*_linux.*"
- "!**/native/*_ios.*"
Expand Down Expand Up @@ -40,30 +41,36 @@ jobs:
working-directory: ${{runner.workspace}}/build
run: cmake ${{ github.workspace }} -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON

- name: Build Debug
- name: Build Tests Debug
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Debug --parallel 4 --target yup_tests

- name: Execute Tests Debug
working-directory: ${{runner.workspace}}/build/tests/Debug
run: ./yup_tests.exe

- name: Build Tests Release
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Release --parallel 4 --target yup_tests

- name: Execute Tests Release
working-directory: ${{runner.workspace}}/build/tests/Release
run: ./yup_tests.exe

- name: Build Examples Debug
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . --config Debug --parallel 4 --target yup_tests
cmake --build . --config Debug --parallel 4 --target example_console
cmake --build . --config Debug --parallel 4 --target example_app
cmake --build . --config Debug --parallel 4 --target example_graphics
cmake --build . --config Debug --parallel 4 --target example_render
cmake --build . --config Debug --parallel 4 --target example_plugin
- name: Test Debug
working-directory: ${{runner.workspace}}/build/tests/Debug
run: ./yup_tests.exe

- name: Build Release
- name: Build Examples Release
working-directory: ${{runner.workspace}}/build
run: |
cmake --build . --config Release --parallel 4 --target yup_tests
cmake --build . --config Release --parallel 4 --target example_console
cmake --build . --config Release --parallel 4 --target example_app
cmake --build . --config Release --parallel 4 --target example_graphics
cmake --build . --config Release --parallel 4 --target example_render
cmake --build . --config Release --parallel 4 --target example_plugin
- name: Test Release
working-directory: ${{runner.workspace}}/build/tests/Release
run: ./yup_tests.exe
6 changes: 6 additions & 0 deletions cmake/yup_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function (_yup_fetch_sdl2)
set (SDL_SHARED OFF CACHE BOOL "" FORCE)
set (SDL_STATIC ON CACHE BOOL "" FORCE)
set (SDL_STATIC_PIC ON CACHE BOOL "" FORCE)
set (SDL_TESTS OFF CACHE BOOL "" FORCE)
set (SDL_AUDIO_ENABLED_BY_DEFAULT OFF CACHE BOOL "" FORCE)

FetchContent_MakeAvailable (SDL2)
Expand All @@ -43,6 +44,11 @@ function (_yup_fetch_sdl2)
POSITION_INDEPENDENT_CODE ON
FOLDER "Thirdparty")

set_target_properties (SDL2main PROPERTIES FOLDER "Thirdparty")
set_target_properties (SDL2_test PROPERTIES FOLDER "Thirdparty")
set_target_properties (sdl_headers_copy PROPERTIES FOLDER "Thirdparty")
set_target_properties (uninstall PROPERTIES FOLDER "Thirdparty")

add_library (sdl2::sdl2 ALIAS SDL2-static)
endfunction()

Expand Down
3 changes: 3 additions & 0 deletions cmake/yup_embed_binary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ function (yup_add_embedded_binary_resources library_name)
add_custom_target ("${library_name}_content" DEPENDS "${resources_hex_files}")
add_dependencies (${library_name} "${library_name}_content")

set_target_properties ("${library_name}_content" PROPERTIES FOLDER "EmbeddedResources")
set_target_properties (${library_name} PROPERTIES FOLDER "EmbeddedResources")

endfunction()
71 changes: 9 additions & 62 deletions modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ class JUCE_API AudioPlayHead
/** @see getHostTimeNs() */
void setHostTimeNs (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); }

/** @see getContinuousTimeInSamples() */
void setContinuousTimeInSamples (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 @@ -525,7 +531,8 @@ class JUCE_API AudioPlayHead
flagHostTimeNs = 1 << 10,
flagIsPlaying = 1 << 11,
flagIsRecording = 1 << 12,
flagIsLooping = 1 << 13
flagIsLooping = 1 << 13,
flagContinuousTime = 1 << 14
};

TimeSignature timeSignature;
Expand All @@ -536,74 +543,14 @@ class JUCE_API AudioPlayHead
double positionPpq = 0.0;
double originTime = 0.0;
double tempoBpm = 0.0;
int64_t continuousTimeInSamples = 0;
int64_t timeInSamples = 0;
int64_t barCount = 0;
uint64_t hostTimeNs = 0;
int64_t flags = 0;
};

//==============================================================================
/** Deprecated, use getPosition() instead.
Fills-in the given structure with details about the transport's
position at the start of the current processing block. If this method returns
false then the current play head position is not available and the given
structure will be undefined.
You can ONLY call this from your processBlock() method! Calling it at other
times will produce undefined behaviour, as the host may not have any context
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.
*/
[[deprecated ("Use getPosition instead. Not all hosts are able to provide all time position information; getPosition differentiates clearly between set and unset fields.")]] bool getCurrentPosition (CurrentPositionInfo& result)
{
if (const auto pos = getPosition())
{
result.resetToDefault();

if (const auto sig = pos->getTimeSignature())
{
result.timeSigNumerator = sig->numerator;
result.timeSigDenominator = sig->denominator;
}

if (const auto loop = pos->getLoopPoints())
{
result.ppqLoopStart = loop->ppqStart;
result.ppqLoopEnd = loop->ppqEnd;
}

if (const auto frame = pos->getFrameRate())
result.frameRate = *frame;

if (const auto timeInSeconds = pos->getTimeInSeconds())
result.timeInSeconds = *timeInSeconds;

if (const auto lastBarStartPpq = pos->getPpqPositionOfLastBarStart())
result.ppqPositionOfLastBarStart = *lastBarStartPpq;

if (const auto ppqPosition = pos->getPpqPosition())
result.ppqPosition = *ppqPosition;

if (const auto originTime = pos->getEditOriginTime())
result.editOriginTime = *originTime;

if (const auto bpm = pos->getBpm())
result.bpm = *bpm;

if (const auto timeInSamples = pos->getTimeInSamples())
result.timeInSamples = *timeInSamples;

result.isPlaying = pos->getIsPlaying();
result.isRecording = pos->getIsRecording();
result.isLooping = pos->getIsLooping();

return true;
}

return false;
}

/** Fetches details about the transport's position at the start of the current
processing block. If this method returns nullopt then the current play head
position is not available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
namespace juce
{

JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
JUCE_BEGIN_IGNORE_DEPRECATION_WARNINGS

void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample)
{
Expand Down Expand Up @@ -684,7 +683,6 @@ static AudioConversionTests audioConversionUnitTests;

#endif

JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_DEPRECATION_WARNINGS

} // namespace juce
Loading

0 comments on commit e0468b0

Please sign in to comment.