├── .gitattributes ├── .bzrignore ├── .gitignore ├── AUTHORS ├── version.sh ├── JuceLibraryCode ├── modules │ ├── juce_audio_formats │ │ ├── codecs │ │ │ ├── oggvorbis │ │ │ │ ├── libvorbis-1.3.7 │ │ │ │ │ ├── AUTHORS │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── window.h │ │ │ │ │ │ ├── lpc.h │ │ │ │ │ │ ├── lsp.h │ │ │ │ │ │ ├── smallft.h │ │ │ │ │ │ ├── lookup.h │ │ │ │ │ │ ├── registry.h │ │ │ │ │ │ ├── registry.c │ │ │ │ │ │ └── highlevel.h │ │ │ │ │ └── COPYING │ │ │ │ └── config_types.h │ │ │ └── flac │ │ │ │ └── libFLAC │ │ │ │ ├── deduplication │ │ │ │ └── lpc_compute_autocorrelation_intrin.c │ │ │ │ └── include │ │ │ │ └── private │ │ │ │ └── md5.h │ │ └── juce_audio_formats.mm │ ├── juce_audio_devices │ │ ├── native │ │ │ └── oboe │ │ │ │ ├── .clang-tidy │ │ │ │ ├── README.md │ │ │ │ ├── src │ │ │ │ ├── fifo │ │ │ │ │ ├── FifoController.cpp │ │ │ │ │ └── FifoControllerIndirect.cpp │ │ │ │ ├── common │ │ │ │ │ ├── Trace.h │ │ │ │ │ ├── Version.cpp │ │ │ │ │ ├── FixedBlockAdapter.cpp │ │ │ │ │ ├── SourceFloatCaller.cpp │ │ │ │ │ ├── OboeExtensions.cpp │ │ │ │ │ ├── README.md │ │ │ │ │ ├── SourceFloatCaller.h │ │ │ │ │ ├── OboeDebug.h │ │ │ │ │ ├── AudioSourceCaller.cpp │ │ │ │ │ ├── SourceI16Caller.h │ │ │ │ │ ├── SourceI32Caller.cpp │ │ │ │ │ ├── SourceI16Caller.cpp │ │ │ │ │ ├── SourceI32Caller.h │ │ │ │ │ ├── SourceI24Caller.h │ │ │ │ │ ├── FixedBlockWriter.h │ │ │ │ │ └── SourceI24Caller.cpp │ │ │ │ ├── flowgraph │ │ │ │ │ ├── resampler │ │ │ │ │ │ ├── ResamplerDefinitions.h │ │ │ │ │ │ ├── SincResamplerStereo.h │ │ │ │ │ │ ├── PolyphaseResamplerMono.h │ │ │ │ │ │ ├── PolyphaseResamplerStereo.h │ │ │ │ │ │ ├── LinearResampler.h │ │ │ │ │ │ ├── IntegerRatio.h │ │ │ │ │ │ ├── SincResampler.h │ │ │ │ │ │ ├── PolyphaseResampler.h │ │ │ │ │ │ ├── LinearResampler.cpp │ │ │ │ │ │ └── IntegerRatio.cpp │ │ │ │ │ ├── SinkI32.h │ │ │ │ │ ├── SinkI16.h │ │ │ │ │ ├── SourceI16.h │ │ │ │ │ ├── SourceI32.h │ │ │ │ │ ├── ClipToRange.cpp │ │ │ │ │ ├── SourceI24.h │ │ │ │ │ ├── SinkI24.h │ │ │ │ │ ├── SinkFloat.h │ │ │ │ │ ├── SourceFloat.h │ │ │ │ │ ├── MonoBlend.h │ │ │ │ │ ├── MonoToMultiConverter.cpp │ │ │ │ │ ├── MultiToMonoConverter.cpp │ │ │ │ │ ├── MonoBlend.cpp │ │ │ │ │ ├── SourceFloat.cpp │ │ │ │ │ ├── MonoToMultiConverter.h │ │ │ │ │ ├── MultiToMonoConverter.h │ │ │ │ │ ├── MultiToManyConverter.h │ │ │ │ │ ├── SinkFloat.cpp │ │ │ │ │ ├── MultiToManyConverter.cpp │ │ │ │ │ ├── ManyToMultiConverter.h │ │ │ │ │ ├── ManyToMultiConverter.cpp │ │ │ │ │ ├── ChannelCountConverter.h │ │ │ │ │ ├── SourceI16.cpp │ │ │ │ │ ├── SourceI32.cpp │ │ │ │ │ ├── FlowgraphUtilities.h │ │ │ │ │ ├── SinkI32.cpp │ │ │ │ │ ├── SinkI16.cpp │ │ │ │ │ ├── ClipToRange.h │ │ │ │ │ └── ChannelCountConverter.cpp │ │ │ │ └── opensles │ │ │ │ │ ├── OpenSLESUtilities.h │ │ │ │ │ ├── OutputMixerOpenSLES.h │ │ │ │ │ ├── AudioInputStreamOpenSLES.h │ │ │ │ │ └── EngineOpenSLES.h │ │ │ │ └── include │ │ │ │ └── oboe │ │ │ │ ├── Oboe.h │ │ │ │ └── OboeExtensions.h │ │ ├── juce_audio_devices.mm │ │ └── audio_io │ │ │ └── juce_SampleRateHelpers.cpp │ ├── juce_core │ │ ├── zip │ │ │ └── zlib │ │ │ │ └── inffast.h │ │ ├── juce_core.mm │ │ ├── native │ │ │ ├── juce_PlatformTimerListener.h │ │ │ ├── javacore │ │ │ │ ├── init │ │ │ │ │ └── com │ │ │ │ │ │ └── rmsl │ │ │ │ │ │ └── juce │ │ │ │ │ │ └── Java.java │ │ │ │ └── app │ │ │ │ │ └── com │ │ │ │ │ └── rmsl │ │ │ │ │ └── juce │ │ │ │ │ └── JuceApp.java │ │ │ ├── juce_Process_mac.mm │ │ │ └── juce_Misc_android.cpp │ │ ├── files │ │ │ ├── juce_FileFilter.cpp │ │ │ └── juce_common_MimeTypes.h │ │ ├── misc │ │ │ ├── juce_RuntimePermissions.cpp │ │ │ └── juce_ScopeGuard.cpp │ │ ├── streams │ │ │ ├── juce_FileInputSource.cpp │ │ │ └── juce_URLInputSource.cpp │ │ └── threads │ │ │ └── juce_WaitableEvent.cpp │ ├── juce_dsp │ │ ├── juce_dsp.mm │ │ └── maths │ │ │ └── juce_Phase.h │ ├── juce_data_structures │ │ ├── juce_data_structures.mm │ │ ├── undomanager │ │ │ └── juce_UndoableAction.cpp │ │ └── juce_data_structures.cpp │ ├── juce_events │ │ ├── juce_events.mm │ │ ├── native │ │ │ ├── juce_RunningInUnity.h │ │ │ ├── juce_ScopedLowPowerModeDisabler.h │ │ │ └── juce_ScopedLowPowerModeDisabler.cpp │ │ ├── interprocess │ │ │ └── juce_ChildProcessManager.cpp │ │ ├── messages │ │ │ ├── juce_NotificationType.h │ │ │ ├── juce_MessageListener.cpp │ │ │ └── juce_MountedVolumeListChangeDetector.h │ │ ├── broadcasters │ │ │ └── juce_ActionListener.h │ │ └── timers │ │ │ └── juce_TimedCallback.h │ └── juce_audio_basics │ │ ├── juce_audio_basics.mm │ │ ├── sources │ │ └── juce_PositionableAudioSource.cpp │ │ ├── midi │ │ └── ump │ │ │ ├── juce_UMPView.cpp │ │ │ ├── juce_UMPIterator.cpp │ │ │ ├── juce_UMPBytesOnGroup.h │ │ │ ├── juce_UMPProtocols.h │ │ │ ├── juce_UMPReceiver.h │ │ │ ├── juce_UMP.h │ │ │ ├── juce_UMPUtils.cpp │ │ │ └── juce_UMPSysEx7.cpp │ │ ├── native │ │ └── juce_AudioWorkgroup_mac.h │ │ ├── audio_play_head │ │ └── juce_AudioPlayHead.cpp │ │ └── mpe │ │ └── juce_MPESynthesiserVoice.cpp ├── include_juce_dsp.cpp ├── include_juce_dsp.mm ├── include_juce_core.cpp ├── include_juce_core.mm ├── include_juce_events.cpp ├── include_juce_events.mm ├── include_juce_audio_basics.mm ├── include_juce_audio_basics.cpp ├── include_juce_audio_devices.cpp ├── include_juce_audio_devices.mm ├── include_juce_audio_formats.cpp ├── include_juce_audio_formats.mm ├── include_juce_data_structures.mm ├── include_juce_data_structures.cpp ├── ReadMe.txt └── JuceHeader.h ├── .github ├── dependabot.yml ├── workflows │ ├── generate-docs.yml │ └── ci.yml └── stale.yml ├── include ├── JuceHeader.h.in └── OpenShotAudio.h.in ├── doc └── openshot-audio-demo.1 ├── src ├── CMakeLists.txt └── hex_version.cpp └── cmake └── Config.cmake.in /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | -------------------------------------------------------------------------------- /.bzrignore: -------------------------------------------------------------------------------- 1 | build/ 2 | build/* 3 | .DS_Store 4 | .settings 5 | .idea/* -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build* 2 | .DS_Store 3 | .settings 4 | .idea/* 5 | cmake-build-debug/* 6 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jonathan Thomas 2 | Julian Storer -------------------------------------------------------------------------------- /version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | grep 'set.*(.*PROJECT_VERSION_FULL' CMakeLists.txt\ 3 | |sed -e 's#set(PROJECT_VERSION_FULL.*"\(.*\)\")#\1#;q' 4 | 5 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/AUTHORS: -------------------------------------------------------------------------------- 1 | Monty 2 | 3 | and the rest of the Xiph.org Foundation. 4 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/.clang-tidy: -------------------------------------------------------------------------------- 1 | # We want to ignore this directory, but we need to enable at least a single 2 | # check to avoid an error 3 | Checks: -*,darwin-dispatch-once-nonstatic 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | 3 | version: 2 4 | updates: 5 | 6 | - package-ecosystem: "github-actions" 7 | directory: "/" 8 | schedule: 9 | interval: "weekly" 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_dsp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_dsp.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_devices.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_audio_formats.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /JuceLibraryCode/include_juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /include/JuceHeader.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | Legacy include file, provided for backwards-compatibility purposes 3 | only. You should update your code to include 4 | instead of this file. 5 | 6 | (This comment may become a build-time warning message at some 7 | future date.) 8 | */ 9 | 10 | #pragma once 11 | #include "./OpenShotAudio.h" 12 | 13 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | typedef int16_t ogg_int16_t; 5 | typedef unsigned short ogg_uint16_t; 6 | typedef int32_t ogg_int32_t; 7 | typedef unsigned int ogg_uint32_t; 8 | typedef int64_t ogg_int64_t; 9 | 10 | // JUCE CHANGE STARTS HERE 11 | typedef unsigned long long ogg_uint64_t; 12 | // JUCE CHANGE ENDS HERE 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/zip/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c: -------------------------------------------------------------------------------- 1 | int i, j; 2 | (void) lag; 3 | FLAC__ASSERT(lag <= MAX_LAG); 4 | 5 | for(i = 0; i < MAX_LAG; i++) 6 | autoc[i] = 0.0; 7 | 8 | for(i = 0; i < MAX_LAG; i++) 9 | for(j = 0; j <= i; j++) 10 | autoc[j] += (double)data[i] * (double)data[i-j]; 11 | 12 | for(i = MAX_LAG; i < (int)data_len; i++) 13 | for(j = 0; j < MAX_LAG; j++) 14 | autoc[j] += (double)data[i] * (double)data[i-j]; 15 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/README.md: -------------------------------------------------------------------------------- 1 | The files in this directory are reproduced from the official Oboe repository, which can be found at 2 | github.com/google/oboe. 3 | 4 | These files are from tag 1.8.0 (987538b). 5 | 6 | We've included only those parts of the original repository which are required to build the Oboe 7 | library. Documentation, samples, tests, and other non-library items have been omitted. 8 | 9 | Files in this directory and below are licensed under the terms of the license in the LICENSE file 10 | which you can find in the same directory as this readme. 11 | -------------------------------------------------------------------------------- /JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Important Note!! 3 | ================ 4 | 5 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 7 | the Projucer saves your project. 8 | 9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 10 | put any of your own files in here if you don't want to lose them. (Of course you may choose 11 | to add the folder's contents to your version-control system so that you can re-merge your own 12 | modifications after the Projucer has saved its changes). 13 | -------------------------------------------------------------------------------- /doc/openshot-audio-demo.1: -------------------------------------------------------------------------------- 1 | .TH LIBOPENSHOT-AUDIO 1 "August 8, 2012" Linux "User Manuals" 2 | .SH NAME 3 | openshot-audio-demo \- Display system info and play test sound 4 | 5 | .SH SYNOPSIS 6 | .B openshot-audio-demo 7 | 8 | .SH DESCRIPTION 9 | Display information about detected audio interfaces, then play a test sound. 10 | Uses the libopenshot-audio library. 11 | 12 | .TP 13 | .B More information 14 | Project Website: http://www.openshot.org/ 15 | 16 | .SH AUTHOR 17 | libopenshot was written by Jonathan Thomas . 18 | 19 | .PP 20 | This manual page was written by Jonathan Thomas , 21 | for the Debian project (and may be used by others). 22 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_dsp/juce_dsp.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #include "juce_dsp.cpp" 27 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/fifo/FifoController.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "FifoController.h" 20 | 21 | namespace oboe { 22 | 23 | FifoController::FifoController(uint32_t numFrames) 24 | : FifoControllerBase(numFrames) 25 | { 26 | setReadCounter(0); 27 | setWriteCounter(0); 28 | } 29 | 30 | } // namespace oboe 31 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/juce_audio_formats.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #include "juce_audio_formats.cpp" 27 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #include "juce_core.cpp" 24 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_data_structures/juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #include "juce_data_structures.cpp" 27 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #include "juce_events.cpp" 24 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/Trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_TRACE_H 18 | #define OBOE_TRACE_H 19 | 20 | class Trace { 21 | 22 | public: 23 | static void beginSection(const char *format, ...); 24 | static void endSection(); 25 | static void initialize(); 26 | 27 | private: 28 | static bool mIsTracingSupported; 29 | }; 30 | 31 | #endif //OBOE_TRACE_H 32 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #include "juce_audio_basics.cpp" 24 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #include "juce_audio_devices.cpp" 24 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/ResamplerDefinitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Set flag RESAMPLER_OUTER_NAMESPACE based on whether compiler flag 18 | // __ANDROID_NDK__ is defined. __ANDROID_NDK__ should be defined in oboe 19 | // but not in android. 20 | 21 | #ifndef RESAMPLER_OUTER_NAMESPACE 22 | #ifdef __ANDROID_NDK__ 23 | #define RESAMPLER_OUTER_NAMESPACE oboe 24 | #else 25 | #define RESAMPLER_OUTER_NAMESPACE aaudio 26 | #endif // __ANDROID_NDK__ 27 | #endif // RESAMPLER_OUTER_NAMESPACE 28 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/Version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include "oboe/Version.h" 17 | 18 | namespace oboe { 19 | 20 | // This variable enables the version information to be read from the resulting binary e.g. 21 | // by running `objdump -s --section=.data ` 22 | // Please do not optimize or change in any way. 23 | char kVersionText[] = "OboeVersion" OBOE_VERSION_TEXT; 24 | 25 | const char * getVersionText(){ 26 | return kVersionText; 27 | } 28 | } // namespace oboe 29 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/sources/juce_PositionableAudioSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | void PositionableAudioSource::setLooping ([[maybe_unused]] bool shouldLoop) {} 27 | 28 | } // namespace juce 29 | -------------------------------------------------------------------------------- /.github/workflows/generate-docs.yml: -------------------------------------------------------------------------------- 1 | name: libopenshot-audio documentation 2 | on: 3 | # Triggers the workflow on push or pull request events but only for the develop branch 4 | push: 5 | branches: [ develop ] 6 | pull_request: 7 | branches: [ develop ] 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | defaults: 14 | run: 15 | shell: bash 16 | steps: 17 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 18 | - uses: actions/checkout@v4 19 | 20 | - name: Install dependencies 21 | run: | 22 | sudo apt update 23 | sudo apt install cmake libasound2-dev doxygen graphviz python3 24 | 25 | - name: Build libopenshot-audio docs 26 | run: | 27 | mkdir build 28 | pushd build 29 | cmake -B . -S .. 30 | cmake --build . --target doc 31 | popd 32 | 33 | # Create an artifact out of the generated HTML 34 | - uses: actions/upload-artifact@v4 35 | with: 36 | name: "OpenShotAudio-docs" 37 | path: "build/doc/html/" 38 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_data_structures/undomanager/juce_UndoableAction.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | namespace juce 27 | { 28 | 29 | UndoableAction* UndoableAction::createCoalescedAction ([[maybe_unused]] UndoableAction* nextAction) { return nullptr; } 30 | 31 | } // namespace juce 32 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/native/juce_PlatformTimerListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | struct PlatformTimerListener 27 | { 28 | virtual ~PlatformTimerListener() = default; 29 | virtual void onTimerExpired() = 0; 30 | }; 31 | 32 | } // namespace juce 33 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/native/juce_RunningInUnity.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #pragma once 24 | 25 | namespace juce::detail 26 | { 27 | 28 | class RunningInUnity 29 | { 30 | public: 31 | /* @internal */ 32 | static inline bool state = false; 33 | }; 34 | 35 | } // namespace juce::detail 36 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/window.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: window functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_WINDOW_ 18 | #define _V_WINDOW_ 19 | 20 | extern const float *_vorbis_window_get(int n); 21 | extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes, 22 | int lW,int W,int nW); 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/FixedBlockAdapter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "FixedBlockAdapter.h" 20 | 21 | FixedBlockAdapter::~FixedBlockAdapter() { 22 | } 23 | 24 | int32_t FixedBlockAdapter::open(int32_t bytesPerFixedBlock) 25 | { 26 | mSize = bytesPerFixedBlock; 27 | mStorage = std::make_unique(bytesPerFixedBlock); 28 | mPosition = 0; 29 | return 0; 30 | } 31 | 32 | int32_t FixedBlockAdapter::close() 33 | { 34 | mStorage.reset(nullptr); 35 | mSize = 0; 36 | mPosition = 0; 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceFloatCaller.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "flowgraph/FlowGraphNode.h" 20 | #include "SourceFloatCaller.h" 21 | 22 | using namespace oboe; 23 | using namespace flowgraph; 24 | 25 | int32_t SourceFloatCaller::onProcess(int32_t numFrames) { 26 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames; 27 | int32_t bytesRead = mBlockReader.read((uint8_t *) output.getBuffer(), numBytes); 28 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame(); 29 | return framesRead; 30 | } 31 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::universal_midi_packets 24 | { 25 | 26 | uint32_t View::size() const noexcept 27 | { 28 | jassert (ptr != nullptr); 29 | return Utils::getNumWordsForMessageType (*ptr); 30 | } 31 | 32 | } // namespace juce::universal_midi_packets 33 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/fifo/FifoControllerIndirect.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "FifoControllerIndirect.h" 20 | 21 | namespace oboe { 22 | 23 | FifoControllerIndirect::FifoControllerIndirect(uint32_t numFrames, 24 | std::atomic *readCounterAddress, 25 | std::atomic *writeCounterAddress) 26 | : FifoControllerBase(numFrames) 27 | , mReadCounterAddress(readCounterAddress) 28 | , mWriteCounterAddress(writeCounterAddress) 29 | { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/native/javacore/init/com/rmsl/juce/Java.java: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | package com.rmsl.juce; 24 | 25 | import android.content.Context; 26 | 27 | public class Java 28 | { 29 | static 30 | { 31 | System.loadLibrary ("juce_jni"); 32 | } 33 | 34 | public native static void initialiseJUCE (Context appContext); 35 | } 36 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPIterator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::universal_midi_packets 24 | { 25 | 26 | Iterator::Iterator (const uint32_t* ptr, [[maybe_unused]] size_t bytes) noexcept 27 | : view (ptr) 28 | #if JUCE_DEBUG 29 | , bytesRemaining (bytes) 30 | #endif 31 | { 32 | } 33 | 34 | } // namespace juce::universal_midi_packets 35 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SINK_I32_H 18 | #define FLOWGRAPH_SINK_I32_H 19 | 20 | #include 21 | 22 | #include "FlowGraphNode.h" 23 | 24 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 25 | 26 | class SinkI32 : public FlowGraphSink { 27 | public: 28 | explicit SinkI32(int32_t channelCount); 29 | ~SinkI32() override = default; 30 | 31 | int32_t read(void *data, int32_t numFrames) override; 32 | 33 | const char *getName() override { 34 | return "SinkI32"; 35 | } 36 | }; 37 | 38 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 39 | 40 | #endif //FLOWGRAPH_SINK_I32_H 41 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/lpc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LPC low level routines 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LPC_H_ 18 | #define _V_LPC_H_ 19 | 20 | #include "../../codec.h" 21 | 22 | /* simple linear scale LPC code */ 23 | extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m); 24 | 25 | extern void vorbis_lpc_predict(float *coeff,float *prime,int m, 26 | float *data,long n); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/lsp.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LSP (also called LSF) conversion routines 14 | 15 | ********************************************************************/ 16 | 17 | 18 | #ifndef _V_LSP_H_ 19 | #define _V_LSP_H_ 20 | 21 | extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m); 22 | 23 | extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln, 24 | float *lsp,int m, 25 | float amp,float ampoffset); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/native/javacore/app/com/rmsl/juce/JuceApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | package com.rmsl.juce; 24 | 25 | import com.rmsl.juce.Java; 26 | 27 | import android.app.Application; 28 | 29 | public class JuceApp extends Application 30 | { 31 | @Override 32 | public void onCreate() 33 | { 34 | super.onCreate(); 35 | Java.initialiseJUCE (this); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/files/juce_FileFilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | FileFilter::FileFilter (const String& filterDescription) 27 | : description (filterDescription) 28 | { 29 | } 30 | 31 | FileFilter::~FileFilter() 32 | { 33 | } 34 | 35 | const String& FileFilter::getDescription() const noexcept 36 | { 37 | return description; 38 | } 39 | 40 | } // namespace juce 41 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/OboeExtensions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "oboe/OboeExtensions.h" 18 | #include "aaudio/AAudioExtensions.h" 19 | 20 | using namespace oboe; 21 | 22 | bool OboeExtensions::isMMapSupported(){ 23 | return AAudioExtensions::getInstance().isMMapSupported(); 24 | } 25 | 26 | bool OboeExtensions::isMMapEnabled(){ 27 | return AAudioExtensions::getInstance().isMMapEnabled(); 28 | } 29 | 30 | int32_t OboeExtensions::setMMapEnabled(bool enabled){ 31 | return AAudioExtensions::getInstance().setMMapEnabled(enabled); 32 | } 33 | 34 | bool OboeExtensions::isMMapUsed(oboe::AudioStream *oboeStream){ 35 | return AAudioExtensions::getInstance().isMMapUsed(oboeStream); 36 | } 37 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/native/juce_AudioWorkgroup_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | #if (defined (MAC_OS_VERSION_11_0) || defined (__IPHONE_14_0)) 26 | #define JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE 1 27 | #else 28 | #define JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE 0 29 | #endif 30 | 31 | #if JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE 32 | AudioWorkgroup makeRealAudioWorkgroup (os_workgroup_t handle); 33 | #endif 34 | 35 | } 36 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/smallft.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: fft transform 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_SMFT_H_ 18 | #define _V_SMFT_H_ 19 | 20 | #include "../../codec.h" 21 | 22 | typedef struct { 23 | int n; 24 | float *trigcache; 25 | int *splitcache; 26 | } drft_lookup; 27 | 28 | extern void drft_forward(drft_lookup *l,float *data); 29 | extern void drft_backward(drft_lookup *l,float *data); 30 | extern void drft_init(drft_lookup *l,int n); 31 | extern void drft_clear(drft_lookup *l); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/include/oboe/Oboe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_OBOE_H 18 | #define OBOE_OBOE_H 19 | 20 | /** 21 | * \mainpage API reference 22 | * 23 | * All documentation is found in the oboe namespace section 24 | * 25 | */ 26 | 27 | #include "oboe/Definitions.h" 28 | #include "oboe/ResultWithValue.h" 29 | #include "oboe/LatencyTuner.h" 30 | #include "oboe/AudioStream.h" 31 | #include "oboe/AudioStreamBase.h" 32 | #include "oboe/AudioStreamBuilder.h" 33 | #include "oboe/Utilities.h" 34 | #include "oboe/Version.h" 35 | #include "oboe/StabilizedCallback.h" 36 | #include "oboe/FifoBuffer.h" 37 | #include "oboe/OboeExtensions.h" 38 | #include "oboe/FullDuplexStream.h" 39 | 40 | #endif //OBOE_OBOE_H 41 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SINK_I16_H 18 | #define FLOWGRAPH_SINK_I16_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * AudioSink that lets you read data as 16-bit signed integers. 29 | */ 30 | class SinkI16 : public FlowGraphSink { 31 | public: 32 | explicit SinkI16(int32_t channelCount); 33 | 34 | int32_t read(void *data, int32_t numFrames) override; 35 | 36 | const char *getName() override { 37 | return "SinkI16"; 38 | } 39 | }; 40 | 41 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 42 | 43 | #endif //FLOWGRAPH_SINK_I16_H 44 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPBytesOnGroup.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::universal_midi_packets 24 | { 25 | 26 | /** 27 | Holds a UMP group, and a span of bytes that were received or are to be 28 | sent on that group. Helpful when working with sysex messages. 29 | 30 | @tags{Audio} 31 | */ 32 | struct BytesOnGroup 33 | { 34 | uint8_t group{}; 35 | Span bytes; 36 | }; 37 | 38 | } // namespace juce::universal_midi_packets 39 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI16.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SOURCE_I16_H 18 | #define FLOWGRAPH_SOURCE_I16_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | /** 27 | * AudioSource that reads a block of pre-defined 16-bit integer data. 28 | */ 29 | class SourceI16 : public FlowGraphSourceBuffered { 30 | public: 31 | explicit SourceI16(int32_t channelCount); 32 | 33 | int32_t onProcess(int32_t numFrames) override; 34 | 35 | const char *getName() override { 36 | return "SourceI16"; 37 | } 38 | }; 39 | 40 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 41 | 42 | #endif //FLOWGRAPH_SOURCE_I16_H 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SOURCE_I32_H 18 | #define FLOWGRAPH_SOURCE_I32_H 19 | 20 | #include 21 | 22 | #include "FlowGraphNode.h" 23 | 24 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 25 | 26 | class SourceI32 : public FlowGraphSourceBuffered { 27 | public: 28 | explicit SourceI32(int32_t channelCount); 29 | ~SourceI32() override = default; 30 | 31 | int32_t onProcess(int32_t numFrames) override; 32 | 33 | const char *getName() override { 34 | return "SourceI32"; 35 | } 36 | private: 37 | static constexpr float kScale = 1.0 / (1UL << 31); 38 | }; 39 | 40 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 41 | 42 | #endif //FLOWGRAPH_SOURCE_I32_H 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/lookup.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: lookup based functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LOOKUP_H_ 18 | 19 | #ifdef FLOAT_LOOKUP 20 | extern float vorbis_coslook(float a); 21 | extern float vorbis_invsqlook(float a); 22 | extern float vorbis_invsq2explook(int a); 23 | extern float vorbis_fromdBlook(float a); 24 | #endif 25 | #ifdef INT_LOOKUP 26 | extern long vorbis_invsqlook_i(long a,long e); 27 | extern long vorbis_coslook_i(long a); 28 | extern float vorbis_fromdBlook_i(long a); 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/registry.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_REG_H_ 18 | #define _V_REG_H_ 19 | 20 | #define VI_TRANSFORMB 1 21 | #define VI_WINDOWB 1 22 | #define VI_TIMEB 1 23 | #define VI_FLOORB 2 24 | #define VI_RESB 3 25 | #define VI_MAPB 1 26 | 27 | extern const vorbis_func_floor *const _floor_P[]; 28 | extern const vorbis_func_residue *const _residue_P[]; 29 | extern const vorbis_func_mapping *const _mapping_P[]; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ClipToRange.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "FlowGraphNode.h" 20 | #include "ClipToRange.h" 21 | 22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 23 | 24 | ClipToRange::ClipToRange(int32_t channelCount) 25 | : FlowGraphFilter(channelCount) { 26 | } 27 | 28 | int32_t ClipToRange::onProcess(int32_t numFrames) { 29 | const float *inputBuffer = input.getBuffer(); 30 | float *outputBuffer = output.getBuffer(); 31 | 32 | int32_t numSamples = numFrames * output.getSamplesPerFrame(); 33 | for (int32_t i = 0; i < numSamples; i++) { 34 | *outputBuffer++ = std::min(mMaximum, std::max(mMinimum, *inputBuffer++)); 35 | } 36 | 37 | return numFrames; 38 | } 39 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI24.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SOURCE_I24_H 18 | #define FLOWGRAPH_SOURCE_I24_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * AudioSource that reads a block of pre-defined 24-bit packed integer data. 29 | */ 30 | class SourceI24 : public FlowGraphSourceBuffered { 31 | public: 32 | explicit SourceI24(int32_t channelCount); 33 | 34 | int32_t onProcess(int32_t numFrames) override; 35 | 36 | const char *getName() override { 37 | return "SourceI24"; 38 | } 39 | }; 40 | 41 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 42 | 43 | #endif //FLOWGRAPH_SOURCE_I24_H 44 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI24.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SINK_I24_H 18 | #define FLOWGRAPH_SINK_I24_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * AudioSink that lets you read data as packed 24-bit signed integers. 29 | * The sample size is 3 bytes. 30 | */ 31 | class SinkI24 : public FlowGraphSink { 32 | public: 33 | explicit SinkI24(int32_t channelCount); 34 | 35 | int32_t read(void *data, int32_t numFrames) override; 36 | 37 | const char *getName() override { 38 | return "SinkI24"; 39 | } 40 | }; 41 | 42 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 43 | 44 | #endif //FLOWGRAPH_SINK_I24_H 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkFloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef FLOWGRAPH_SINK_FLOAT_H 19 | #define FLOWGRAPH_SINK_FLOAT_H 20 | 21 | #include 22 | #include 23 | 24 | #include "FlowGraphNode.h" 25 | 26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 27 | 28 | /** 29 | * AudioSink that lets you read data as 32-bit floats. 30 | */ 31 | class SinkFloat : public FlowGraphSink { 32 | public: 33 | explicit SinkFloat(int32_t channelCount); 34 | ~SinkFloat() override = default; 35 | 36 | int32_t read(void *data, int32_t numFrames) override; 37 | 38 | const char *getName() override { 39 | return "SinkFloat"; 40 | } 41 | }; 42 | 43 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 44 | 45 | #endif //FLOWGRAPH_SINK_FLOAT_H 46 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/files/juce_common_MimeTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2020 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 6 End-User License 11 | Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). 12 | 13 | End User License Agreement: www.juce.com/juce-6-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #pragma once 27 | 28 | namespace juce::detail 29 | { 30 | 31 | struct MimeTypeTable 32 | { 33 | static void registerCustomMimeTypeForFileExtension (const String& mimeType, const String& fileExtension); 34 | 35 | static StringArray getMimeTypesForFileExtension (const String& fileExtension); 36 | 37 | static StringArray getFileExtensionsForMimeType (const String& mimeType); 38 | }; 39 | 40 | } // namespace juce::detail 41 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | bool AudioPlayHead::canControlTransport() { return false; } 27 | void AudioPlayHead::transportPlay ([[maybe_unused]] bool shouldStartPlaying) {} 28 | void AudioPlayHead::transportRecord ([[maybe_unused]] bool shouldStartRecording) {} 29 | void AudioPlayHead::transportRewind() {} 30 | 31 | } // namespace juce 32 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceFloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_SOURCE_FLOAT_H 18 | #define FLOWGRAPH_SOURCE_FLOAT_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * AudioSource that reads a block of pre-defined float data. 29 | */ 30 | class SourceFloat : public FlowGraphSourceBuffered { 31 | public: 32 | explicit SourceFloat(int32_t channelCount); 33 | ~SourceFloat() override = default; 34 | 35 | int32_t onProcess(int32_t numFrames) override; 36 | 37 | const char *getName() override { 38 | return "SourceFloat"; 39 | } 40 | }; 41 | 42 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 43 | 44 | #endif //FLOWGRAPH_SOURCE_FLOAT_H 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/SincResamplerStereo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_SINC_RESAMPLER_STEREO_H 18 | #define RESAMPLER_SINC_RESAMPLER_STEREO_H 19 | 20 | #include 21 | #include 22 | 23 | #include "SincResampler.h" 24 | #include "ResamplerDefinitions.h" 25 | 26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 27 | 28 | class SincResamplerStereo : public SincResampler { 29 | public: 30 | explicit SincResamplerStereo(const MultiChannelResampler::Builder &builder); 31 | 32 | virtual ~SincResamplerStereo() = default; 33 | 34 | void writeFrame(const float *frame) override; 35 | 36 | void readFrame(float *frame) override; 37 | 38 | }; 39 | 40 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 41 | 42 | #endif //RESAMPLER_SINC_RESAMPLER_STEREO_H 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/native/juce_Process_mac.mm: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | namespace juce 23 | { 24 | 25 | #if JUCE_MAC 26 | void Process::setDockIconVisible (bool isVisible) 27 | { 28 | ProcessSerialNumber psn { 0, kCurrentProcess }; 29 | 30 | [[maybe_unused]] OSStatus err = TransformProcessType (&psn, isVisible ? kProcessTransformToForegroundApplication 31 | : kProcessTransformToUIElementApplication); 32 | jassert (err == 0); 33 | } 34 | #endif 35 | 36 | } // namespace juce 37 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResamplerMono.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_MONO_H 18 | #define RESAMPLER_POLYPHASE_RESAMPLER_MONO_H 19 | 20 | #include 21 | #include 22 | 23 | #include "PolyphaseResampler.h" 24 | #include "ResamplerDefinitions.h" 25 | 26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 27 | 28 | class PolyphaseResamplerMono : public PolyphaseResampler { 29 | public: 30 | explicit PolyphaseResamplerMono(const MultiChannelResampler::Builder &builder); 31 | 32 | virtual ~PolyphaseResamplerMono() = default; 33 | 34 | void writeFrame(const float *frame) override; 35 | 36 | void readFrame(float *frame) override; 37 | }; 38 | 39 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 40 | 41 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_MONO_H 42 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPProtocols.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #ifndef DOXYGEN 24 | 25 | namespace juce::universal_midi_packets 26 | { 27 | 28 | /** The kinds of MIDI protocol that can be formatted into Universal MIDI Packets. */ 29 | enum class PacketProtocol 30 | { 31 | MIDI_1_0, 32 | MIDI_2_0, 33 | }; 34 | 35 | /** All kinds of MIDI protocol understood by JUCE. */ 36 | enum class MidiProtocol 37 | { 38 | bytestream, 39 | UMP_MIDI_1_0, 40 | UMP_MIDI_2_0, 41 | }; 42 | 43 | } // namespace juce::universal_midi_packets 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResamplerStereo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H 18 | #define RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H 19 | 20 | #include 21 | #include 22 | 23 | #include "PolyphaseResampler.h" 24 | #include "ResamplerDefinitions.h" 25 | 26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 27 | 28 | class PolyphaseResamplerStereo : public PolyphaseResampler { 29 | public: 30 | explicit PolyphaseResamplerStereo(const MultiChannelResampler::Builder &builder); 31 | 32 | virtual ~PolyphaseResamplerStereo() = default; 33 | 34 | void writeFrame(const float *frame) override; 35 | 36 | void readFrame(float *frame) override; 37 | }; 38 | 39 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 40 | 41 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H 42 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/README.md: -------------------------------------------------------------------------------- 1 | # Notes on Implementation 2 | 3 | ## Latency from Resampling 4 | 5 | There are two components of the latency. The resampler itself, and a buffer that 6 | is used to adapt the block sizes. 7 | 8 | 1) The resampler is an FIR running at the target sample rate. So its latency is the number of taps. 9 | From MultiChannelResampler.cpp, numTaps is 10 | 11 | Fastest: 2 12 | Low: 4 13 | Medium: 8 14 | High: 16 15 | Best: 32 16 | 17 | For output, the device sampling rate is used, which is typically 48000.For input, the app sampling rate is used. 18 | 19 | 2) There is a block size adapter that collects odd sized blocks into larger blocks of the correct size. 20 | 21 | The adapter contains one burst of frames, from getFramesPerBurst(). But if the app specifies a 22 | particular size using setFramesPerCallback() then that size will be used. 23 | Here is some pseudo-code to calculate the latency. 24 | 25 | latencyMillis = 0 26 | targetRate = isOutput ? deviceRate : applicationRate 27 | // Add latency from FIR 28 | latencyMillis += numTaps * 1000.0 / targetRate 29 | // Add latency from block size adaptation 30 | adapterSize = (callbackSize > 0) ? callbackSize : burstSize 31 | if (isOutput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate 32 | else if (isInput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / applicationRate 33 | else if (isInput && !isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate 34 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceFloatCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_SOURCE_FLOAT_CALLER_H 18 | #define OBOE_SOURCE_FLOAT_CALLER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "flowgraph/FlowGraphNode.h" 24 | #include "AudioSourceCaller.h" 25 | #include "FixedBlockReader.h" 26 | 27 | namespace oboe { 28 | /** 29 | * AudioSource that uses callback to get more float data. 30 | */ 31 | class SourceFloatCaller : public AudioSourceCaller { 32 | public: 33 | SourceFloatCaller(int32_t channelCount, int32_t framesPerCallback) 34 | : AudioSourceCaller(channelCount, framesPerCallback, (int32_t)sizeof(float)) {} 35 | 36 | int32_t onProcess(int32_t numFrames) override; 37 | 38 | const char *getName() override { 39 | return "SourceFloatCaller"; 40 | } 41 | }; 42 | 43 | } 44 | #endif //OBOE_SOURCE_FLOAT_CALLER_H 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPReceiver.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #ifndef DOXYGEN 24 | 25 | namespace juce::universal_midi_packets 26 | { 27 | 28 | /** 29 | A base class for classes which receive Universal MIDI Packets from an input. 30 | 31 | @tags{Audio} 32 | */ 33 | struct Receiver 34 | { 35 | virtual ~Receiver() noexcept = default; 36 | 37 | /** This will be called each time a new packet is ready for processing. */ 38 | virtual void packetReceived (const View& packet, double time) = 0; 39 | }; 40 | 41 | } // namespace juce::universal_midi_packets 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoBlend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_MONO_BLEND_H 18 | #define FLOWGRAPH_MONO_BLEND_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * Combine data between multiple channels so each channel is an average 29 | * of all channels. 30 | */ 31 | class MonoBlend : public FlowGraphFilter { 32 | public: 33 | explicit MonoBlend(int32_t channelCount); 34 | 35 | virtual ~MonoBlend() = default; 36 | 37 | int32_t onProcess(int32_t numFrames) override; 38 | 39 | const char *getName() override { 40 | return "MonoBlend"; 41 | } 42 | private: 43 | const float mInvChannelCount; 44 | }; 45 | 46 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 47 | 48 | #endif //FLOWGRAPH_MONO_BLEND 49 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/misc/juce_RuntimePermissions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | #if ! JUCE_ANDROID // We currently don't request runtime permissions on any other platform 27 | // than Android, so this file contains a dummy implementation for those. 28 | // This may change in the future. 29 | 30 | void RuntimePermissions::request (PermissionID, Callback callback) { callback (true); } 31 | bool RuntimePermissions::isRequired (PermissionID) { return false; } 32 | bool RuntimePermissions::isGranted (PermissionID) { return true; } 33 | 34 | #endif 35 | 36 | } // namespace juce 37 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/OboeDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | #ifndef OBOE_DEBUG_H 19 | #define OBOE_DEBUG_H 20 | 21 | #include 22 | 23 | #ifndef MODULE_NAME 24 | #define MODULE_NAME "OboeAudio" 25 | #endif 26 | 27 | // Always log INFO and errors. 28 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, MODULE_NAME, __VA_ARGS__) 29 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, MODULE_NAME, __VA_ARGS__) 30 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, MODULE_NAME, __VA_ARGS__) 31 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, MODULE_NAME, __VA_ARGS__) 32 | 33 | #if OBOE_ENABLE_LOGGING 34 | #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, MODULE_NAME, __VA_ARGS__) 35 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, MODULE_NAME, __VA_ARGS__) 36 | #else 37 | #define LOGV(...) 38 | #define LOGD(...) 39 | #endif 40 | 41 | #endif //OBOE_DEBUG_H 42 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoToMultiConverter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "FlowGraphNode.h" 19 | #include "MonoToMultiConverter.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | MonoToMultiConverter::MonoToMultiConverter(int32_t outputChannelCount) 24 | : input(*this, 1) 25 | , output(*this, outputChannelCount) { 26 | } 27 | 28 | int32_t MonoToMultiConverter::onProcess(int32_t numFrames) { 29 | const float *inputBuffer = input.getBuffer(); 30 | float *outputBuffer = output.getBuffer(); 31 | int32_t channelCount = output.getSamplesPerFrame(); 32 | for (int i = 0; i < numFrames; i++) { 33 | // read one, write many 34 | float sample = *inputBuffer++; 35 | for (int channel = 0; channel < channelCount; channel++) { 36 | *outputBuffer++ = sample; 37 | } 38 | } 39 | return numFrames; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToMonoConverter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "FlowGraphNode.h" 19 | #include "MultiToMonoConverter.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | MultiToMonoConverter::MultiToMonoConverter(int32_t inputChannelCount) 24 | : input(*this, inputChannelCount) 25 | , output(*this, 1) { 26 | } 27 | 28 | MultiToMonoConverter::~MultiToMonoConverter() = default; 29 | 30 | int32_t MultiToMonoConverter::onProcess(int32_t numFrames) { 31 | const float *inputBuffer = input.getBuffer(); 32 | float *outputBuffer = output.getBuffer(); 33 | int32_t channelCount = input.getSamplesPerFrame(); 34 | for (int i = 0; i < numFrames; i++) { 35 | // read first channel of multi stream, write many 36 | *outputBuffer++ = *inputBuffer; 37 | inputBuffer += channelCount; 38 | } 39 | return numFrames; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/interprocess/juce_ChildProcessManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | namespace juce 27 | { 28 | 29 | void ChildProcessManager::checkProcesses() 30 | { 31 | for (auto it = processes.begin(); it != processes.end();) 32 | { 33 | auto processPtr = *it; 34 | 35 | if (! processPtr->isRunning()) 36 | { 37 | listeners.call (processPtr.get()); 38 | it = processes.erase (it); 39 | } 40 | else 41 | { 42 | ++it; 43 | } 44 | } 45 | 46 | if (processes.empty()) 47 | timer.stopTimer(); 48 | } 49 | 50 | JUCE_IMPLEMENT_SINGLETON (ChildProcessManager) 51 | 52 | } // namespace juce 53 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2020 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoBlend.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "MonoBlend.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | MonoBlend::MonoBlend(int32_t channelCount) 24 | : FlowGraphFilter(channelCount) 25 | , mInvChannelCount(1. / channelCount) 26 | { 27 | } 28 | 29 | int32_t MonoBlend::onProcess(int32_t numFrames) { 30 | int32_t channelCount = output.getSamplesPerFrame(); 31 | const float *inputBuffer = input.getBuffer(); 32 | float *outputBuffer = output.getBuffer(); 33 | 34 | for (size_t i = 0; i < numFrames; ++i) { 35 | float accum = 0; 36 | for (size_t j = 0; j < channelCount; ++j) { 37 | accum += *inputBuffer++; 38 | } 39 | accum *= mInvChannelCount; 40 | for (size_t j = 0; j < channelCount; ++j) { 41 | *outputBuffer++ = accum; 42 | } 43 | } 44 | 45 | return numFrames; 46 | } 47 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/LinearResampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_LINEAR_RESAMPLER_H 18 | #define RESAMPLER_LINEAR_RESAMPLER_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "MultiChannelResampler.h" 25 | #include "ResamplerDefinitions.h" 26 | 27 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 28 | 29 | /** 30 | * Simple resampler that uses bi-linear interpolation. 31 | */ 32 | class LinearResampler : public MultiChannelResampler { 33 | public: 34 | explicit LinearResampler(const MultiChannelResampler::Builder &builder); 35 | 36 | void writeFrame(const float *frame) override; 37 | 38 | void readFrame(float *frame) override; 39 | 40 | private: 41 | std::unique_ptr mPreviousFrame; 42 | std::unique_ptr mCurrentFrame; 43 | }; 44 | 45 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 46 | 47 | #endif //RESAMPLER_LINEAR_RESAMPLER_H 48 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMP.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | #include "juce_UMPProtocols.h" 24 | #include "juce_UMPUtils.h" 25 | #include "juce_UMPacket.h" 26 | #include "juce_UMPSysEx7.h" 27 | #include "juce_UMPView.h" 28 | #include "juce_UMPIterator.h" 29 | #include "juce_UMPackets.h" 30 | #include "juce_UMPFactory.h" 31 | #include "juce_UMPConversion.h" 32 | #include "juce_UMPMidi1ToBytestreamTranslator.h" 33 | #include "juce_UMPMidi1ToMidi2DefaultTranslator.h" 34 | #include "juce_UMPConverters.h" 35 | #include "juce_UMPDispatcher.h" 36 | #include "juce_UMPReceiver.h" 37 | 38 | #ifndef DOXYGEN 39 | 40 | namespace juce 41 | { 42 | namespace ump = universal_midi_packets; 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 90 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 10 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - enhancement 10 | # Label to use when marking an issue as stale 11 | staleLabel: stale 12 | # Comment to post when marking an issue as stale. Set to `false` to disable 13 | markComment: | 14 | Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention. 15 | 16 | This issue will be closed, as it meets the following criteria: 17 | - No activity in the past 90 days 18 | - No one is assigned to this issue 19 | 20 | We'd like to ask you to help us out and determine whether this issue should be reopened. 21 | - If this issue is reporting a bug, please can you attempt to reproduce on the [latest daily build](https://www.openshot.org/download/#daily) to help us to understand whether the bug still needs our attention. 22 | - If this issue is proposing a new feature, please can you verify whether the feature proposal is still relevant. 23 | 24 | Thanks again for your help! 25 | # Comment to post when closing a stale issue. Set to `false` to disable 26 | closeComment: false 27 | # Only close issues 28 | only: issues 29 | # Don't close issues which are assigned to somebody 30 | exemptAssignees: true 31 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/IntegerRatio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_INTEGER_RATIO_H 18 | #define RESAMPLER_INTEGER_RATIO_H 19 | 20 | #include 21 | 22 | #include "ResamplerDefinitions.h" 23 | 24 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 25 | 26 | /** 27 | * Represent the ratio of two integers. 28 | */ 29 | class IntegerRatio { 30 | public: 31 | IntegerRatio(int32_t numerator, int32_t denominator) 32 | : mNumerator(numerator), mDenominator(denominator) {} 33 | 34 | /** 35 | * Reduce by removing common prime factors. 36 | */ 37 | void reduce(); 38 | 39 | int32_t getNumerator() { 40 | return mNumerator; 41 | } 42 | 43 | int32_t getDenominator() { 44 | return mDenominator; 45 | } 46 | 47 | private: 48 | int32_t mNumerator; 49 | int32_t mDenominator; 50 | }; 51 | 52 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 53 | 54 | #endif //RESAMPLER_INTEGER_RATIO_H 55 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/native/juce_Misc_android.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | void Logger::outputDebugString (const String& text) 27 | { 28 | char* data = text.toUTF8().getAddress(); 29 | const size_t length = CharPointer_UTF8::getBytesRequiredFor (text.getCharPointer()); 30 | const size_t chunkSize = 1023; 31 | 32 | size_t position = 0; 33 | size_t numToRead = jmin (chunkSize, length); 34 | 35 | while (numToRead > 0) 36 | { 37 | __android_log_print (ANDROID_LOG_INFO, "JUCE", "%s", data + position); 38 | 39 | position += numToRead; 40 | numToRead = jmin (chunkSize, length - position); 41 | } 42 | } 43 | 44 | } // namespace juce 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceFloat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "FlowGraphNode.h" 20 | #include "SourceFloat.h" 21 | 22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 23 | 24 | SourceFloat::SourceFloat(int32_t channelCount) 25 | : FlowGraphSourceBuffered(channelCount) { 26 | } 27 | 28 | int32_t SourceFloat::onProcess(int32_t numFrames) { 29 | float *outputBuffer = output.getBuffer(); 30 | const int32_t channelCount = output.getSamplesPerFrame(); 31 | 32 | const int32_t framesLeft = mSizeInFrames - mFrameIndex; 33 | const int32_t framesToProcess = std::min(numFrames, framesLeft); 34 | const int32_t numSamples = framesToProcess * channelCount; 35 | 36 | const float *floatBase = (float *) mData; 37 | const float *floatData = &floatBase[mFrameIndex * channelCount]; 38 | memcpy(outputBuffer, floatData, numSamples * sizeof(float)); 39 | mFrameIndex += framesToProcess; 40 | return framesToProcess; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/messages/juce_NotificationType.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | //============================================================================== 27 | /** 28 | These enums are used in various classes to indicate whether a notification 29 | event should be sent out. 30 | */ 31 | enum NotificationType 32 | { 33 | dontSendNotification = 0, /**< No notification message should be sent. */ 34 | sendNotification = 1, /**< Requests a notification message, either synchronous or not. */ 35 | sendNotificationSync, /**< Requests a synchronous notification. */ 36 | sendNotificationAsync, /**< Requests an asynchronous notification. */ 37 | }; 38 | 39 | } // namespace juce 40 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoToMultiConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H 18 | #define FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * Convert a monophonic stream to a multi-channel interleaved stream 29 | * with the same signal on each channel. 30 | */ 31 | class MonoToMultiConverter : public FlowGraphNode { 32 | public: 33 | explicit MonoToMultiConverter(int32_t outputChannelCount); 34 | 35 | virtual ~MonoToMultiConverter() = default; 36 | 37 | int32_t onProcess(int32_t numFrames) override; 38 | 39 | const char *getName() override { 40 | return "MonoToMultiConverter"; 41 | } 42 | 43 | FlowGraphPortFloatInput input; 44 | FlowGraphPortFloatOutput output; 45 | }; 46 | 47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 48 | 49 | #endif //FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToMonoConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H 18 | #define FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * Convert a multi-channel interleaved stream to a monophonic stream 29 | * by extracting channel[0]. 30 | */ 31 | class MultiToMonoConverter : public FlowGraphNode { 32 | public: 33 | explicit MultiToMonoConverter(int32_t inputChannelCount); 34 | 35 | virtual ~MultiToMonoConverter(); 36 | 37 | int32_t onProcess(int32_t numFrames) override; 38 | 39 | const char *getName() override { 40 | return "MultiToMonoConverter"; 41 | } 42 | 43 | FlowGraphPortFloatInput input; 44 | FlowGraphPortFloatOutput output; 45 | }; 46 | 47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 48 | 49 | #endif //FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_SampleRateHelpers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::SampleRateHelpers 24 | { 25 | 26 | static inline const std::vector& getAllSampleRates() 27 | { 28 | static auto sampleRates = [] 29 | { 30 | std::vector result; 31 | constexpr double baseRates[] = { 8000.0, 11025.0, 12000.0 }; 32 | constexpr double maxRate = 768000.0; 33 | 34 | for (auto rate : baseRates) 35 | for (; rate <= maxRate; rate *= 2) 36 | result.insert (std::upper_bound (result.begin(), result.end(), rate), 37 | rate); 38 | 39 | return result; 40 | }(); 41 | 42 | return sampleRates; 43 | } 44 | 45 | } // namespace juce::SampleRateHelpers 46 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/SincResampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_SINC_RESAMPLER_H 18 | #define RESAMPLER_SINC_RESAMPLER_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "MultiChannelResampler.h" 25 | #include "ResamplerDefinitions.h" 26 | 27 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 28 | 29 | /** 30 | * Resampler that can interpolate between coefficients. 31 | * This can be used to support arbitrary ratios. 32 | */ 33 | class SincResampler : public MultiChannelResampler { 34 | public: 35 | explicit SincResampler(const MultiChannelResampler::Builder &builder); 36 | 37 | virtual ~SincResampler() = default; 38 | 39 | void readFrame(float *frame) override; 40 | 41 | protected: 42 | 43 | std::vector mSingleFrame2; // for interpolation 44 | int32_t mNumRows = 0; 45 | double mPhaseScaler = 1.0; 46 | }; 47 | 48 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 49 | 50 | #endif //RESAMPLER_SINC_RESAMPLER_H 51 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: libopenshot-audio CI Build 2 | on: [push, pull_request] 3 | jobs: 4 | build: 5 | runs-on: ${{ matrix.os }} 6 | strategy: 7 | matrix: 8 | os: [ubuntu-22.04, ubuntu-24.04] 9 | steps: 10 | - uses: actions/checkout@v4 11 | 12 | - uses: msys2/setup-msys2@v2 13 | if: ${{ runner.os == 'Windows' }} 14 | with: 15 | update: true 16 | install: >- 17 | mingw-w64-x86_64-gcc 18 | mingw-w64-x86_64-pkgconf 19 | mingw-w64-x86_64-make 20 | make 21 | pkgconf 22 | 23 | - uses: haya14busa/action-cond@v1 24 | id: generator 25 | with: 26 | cond: ${{ runner.os == 'Windows' }} 27 | if_true: "MinGW Makefiles" 28 | if_false: "Unix Makefiles" 29 | 30 | - name: Install Linux dependencies 31 | if: ${{ runner.os == 'Linux' }} 32 | shell: bash 33 | run: | 34 | sudo apt update 35 | sudo apt install cmake doxygen graphviz 36 | sudo apt install libasound2-dev 37 | 38 | - name: Build libopenshot-audio 39 | run: | 40 | mkdir build 41 | pushd build 42 | cmake -B . -S .. -G "${{ steps.generator.outputs.value }}" -DCMAKE_INSTALL_PREFIX:PATH="dist" -DCMAKE_BUILD_TYPE="Debug" -DAUTO_INSTALL_DOCS=0 43 | cmake --build . -- VERBOSE=1 44 | popd 45 | 46 | - name: Generate API documentation 47 | if: ${{ runner.os == 'Linux' }} 48 | shell: bash 49 | run: | 50 | pushd build 51 | cmake --build . --target doc 52 | popd 53 | 54 | - name: Install libopenshot-audio 55 | run: | 56 | pushd build 57 | cmake --build . --target install -- VERBOSE=1 58 | popd 59 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/AudioSourceCaller.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "AudioSourceCaller.h" 18 | 19 | using namespace oboe; 20 | using namespace flowgraph; 21 | 22 | int32_t AudioSourceCaller::onProcessFixedBlock(uint8_t *buffer, int32_t numBytes) { 23 | AudioStreamDataCallback *callback = mStream->getDataCallback(); 24 | int32_t result = 0; 25 | int32_t numFrames = numBytes / mStream->getBytesPerFrame(); 26 | if (callback != nullptr) { 27 | DataCallbackResult callbackResult = callback->onAudioReady(mStream, buffer, numFrames); 28 | // onAudioReady() does not return the number of bytes processed so we have to assume all. 29 | result = (callbackResult == DataCallbackResult::Continue) 30 | ? numBytes 31 | : -1; 32 | } else { 33 | auto readResult = mStream->read(buffer, numFrames, mTimeoutNanos); 34 | if (!readResult) return (int32_t) readResult.error(); 35 | result = readResult.value() * mStream->getBytesPerFrame(); 36 | } 37 | return result; 38 | } 39 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToManyConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H 18 | #define FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * Convert a multi-channel interleaved stream to multiple mono-channel 29 | * outputs 30 | */ 31 | class MultiToManyConverter : public FlowGraphNode { 32 | public: 33 | explicit MultiToManyConverter(int32_t channelCount); 34 | 35 | virtual ~MultiToManyConverter(); 36 | 37 | int32_t onProcess(int32_t numFrames) override; 38 | 39 | const char *getName() override { 40 | return "MultiToManyConverter"; 41 | } 42 | 43 | std::vector> outputs; 44 | flowgraph::FlowGraphPortFloatInput input; 45 | }; 46 | 47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 48 | 49 | #endif //FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/OpenSLESUtilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_OPENSLES_OPENSLESUTILITIES_H 18 | #define OBOE_OPENSLES_OPENSLESUTILITIES_H 19 | 20 | #include 21 | #include "oboe/Oboe.h" 22 | 23 | namespace oboe { 24 | 25 | const char *getSLErrStr(SLresult code); 26 | 27 | /** 28 | * Creates an extended PCM format from the supplied format and data representation. This method 29 | * should only be called on Android devices with API level 21+. API 21 introduced the 30 | * SLAndroidDataFormat_PCM_EX object which allows audio samples to be represented using 31 | * single precision floating-point. 32 | * 33 | * @param format 34 | * @param representation 35 | * @return the extended PCM format 36 | */ 37 | SLAndroidDataFormat_PCM_EX OpenSLES_createExtendedFormat(SLDataFormat_PCM format, 38 | SLuint32 representation); 39 | 40 | SLuint32 OpenSLES_ConvertFormatToRepresentation(AudioFormat format); 41 | 42 | } // namespace oboe 43 | 44 | #endif //OBOE_OPENSLES_OPENSLESUTILITIES_H 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | MPESynthesiserVoice::MPESynthesiserVoice() 27 | { 28 | } 29 | 30 | MPESynthesiserVoice::~MPESynthesiserVoice() 31 | { 32 | } 33 | 34 | //============================================================================== 35 | bool MPESynthesiserVoice::isCurrentlyPlayingNote (MPENote note) const noexcept 36 | { 37 | return isActive() && currentlyPlayingNote.noteID == note.noteID; 38 | } 39 | 40 | bool MPESynthesiserVoice::isPlayingButReleased() const noexcept 41 | { 42 | return isActive() && currentlyPlayingNote.keyState == MPENote::off; 43 | } 44 | 45 | void MPESynthesiserVoice::clearCurrentNote() noexcept 46 | { 47 | currentlyPlayingNote = MPENote(); 48 | } 49 | 50 | } // namespace juce 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI16Caller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_SOURCE_I16_CALLER_H 18 | #define OBOE_SOURCE_I16_CALLER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "flowgraph/FlowGraphNode.h" 24 | #include "AudioSourceCaller.h" 25 | #include "FixedBlockReader.h" 26 | 27 | namespace oboe { 28 | /** 29 | * AudioSource that uses callback to get more data. 30 | */ 31 | class SourceI16Caller : public AudioSourceCaller { 32 | public: 33 | SourceI16Caller(int32_t channelCount, int32_t framesPerCallback) 34 | : AudioSourceCaller(channelCount, framesPerCallback, sizeof(int16_t)) { 35 | mConversionBuffer = std::make_unique(static_cast(channelCount) 36 | * static_cast(output.getFramesPerBuffer())); 37 | } 38 | 39 | int32_t onProcess(int32_t numFrames) override; 40 | 41 | const char *getName() override { 42 | return "SourceI16Caller"; 43 | } 44 | private: 45 | std::unique_ptr mConversionBuffer; 46 | }; 47 | 48 | } 49 | #endif //OBOE_SOURCE_I16_CALLER_H 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/messages/juce_MessageListener.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | Message::Message() noexcept {} 27 | Message::~Message() {} 28 | 29 | void Message::messageCallback() 30 | { 31 | if (auto* r = recipient.get()) 32 | r->handleMessage (*this); 33 | } 34 | 35 | MessageListener::MessageListener() noexcept 36 | { 37 | // Are you trying to create a messagelistener before or after juce has been initialised?? 38 | JUCE_ASSERT_MESSAGE_MANAGER_EXISTS 39 | } 40 | 41 | MessageListener::~MessageListener() 42 | { 43 | masterReference.clear(); 44 | } 45 | 46 | void MessageListener::postMessage (Message* const message) const 47 | { 48 | message->recipient = const_cast (this); 49 | message->post(); 50 | } 51 | 52 | } // namespace juce 53 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI32Caller.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "flowgraph/FlowGraphNode.h" 20 | #include "SourceI32Caller.h" 21 | 22 | #if FLOWGRAPH_ANDROID_INTERNAL 23 | #include 24 | #endif 25 | 26 | using namespace oboe; 27 | using namespace flowgraph; 28 | 29 | int32_t SourceI32Caller::onProcess(int32_t numFrames) { 30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames; 31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes); 32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame(); 33 | 34 | float *floatData = output.getBuffer(); 35 | const int32_t *intData = mConversionBuffer.get(); 36 | int32_t numSamples = framesRead * output.getSamplesPerFrame(); 37 | 38 | #if FLOWGRAPH_ANDROID_INTERNAL 39 | memcpy_to_float_from_i32(floatData, shortData, numSamples); 40 | #else 41 | for (int i = 0; i < numSamples; i++) { 42 | *floatData++ = *intData++ * kScale; 43 | } 44 | #endif 45 | 46 | return framesRead; 47 | } 48 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/native/juce_ScopedLowPowerModeDisabler.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | //============================================================================== 27 | /** 28 | Disables low-power-mode for the duration of an instance's lifetime. 29 | 30 | Currently this is only implemented on macOS, where it will disable the 31 | "App Nap" power-saving feature. 32 | 33 | @tags{Events} 34 | */ 35 | class ScopedLowPowerModeDisabler 36 | { 37 | public: 38 | ScopedLowPowerModeDisabler(); 39 | ~ScopedLowPowerModeDisabler(); 40 | 41 | private: 42 | class Pimpl; 43 | std::unique_ptr pimpl; 44 | 45 | JUCE_DECLARE_NON_COPYABLE (ScopedLowPowerModeDisabler) 46 | JUCE_DECLARE_NON_MOVEABLE (ScopedLowPowerModeDisabler) 47 | }; 48 | 49 | } // namespace juce 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkFloat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "FlowGraphNode.h" 20 | #include "SinkFloat.h" 21 | 22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 23 | 24 | SinkFloat::SinkFloat(int32_t channelCount) 25 | : FlowGraphSink(channelCount) { 26 | } 27 | 28 | int32_t SinkFloat::read(void *data, int32_t numFrames) { 29 | float *floatData = (float *) data; 30 | const int32_t channelCount = input.getSamplesPerFrame(); 31 | 32 | int32_t framesLeft = numFrames; 33 | while (framesLeft > 0) { 34 | // Run the graph and pull data through the input port. 35 | int32_t framesPulled = pullData(framesLeft); 36 | if (framesPulled <= 0) { 37 | break; 38 | } 39 | const float *signal = input.getBuffer(); 40 | int32_t numSamples = framesPulled * channelCount; 41 | memcpy(floatData, signal, numSamples * sizeof(float)); 42 | floatData += numSamples; 43 | framesLeft -= framesPulled; 44 | } 45 | return numFrames - framesLeft; 46 | } 47 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::universal_midi_packets 24 | { 25 | 26 | uint32_t Utils::getNumWordsForMessageType (uint32_t mt) 27 | { 28 | switch (Utils::getMessageType (mt)) 29 | { 30 | case 0x0: 31 | case 0x1: 32 | case 0x2: 33 | case 0x6: 34 | case 0x7: 35 | return 1; 36 | case 0x3: 37 | case 0x4: 38 | case 0x8: 39 | case 0x9: 40 | case 0xa: 41 | return 2; 42 | case 0xb: 43 | case 0xc: 44 | return 3; 45 | case 0x5: 46 | case 0xd: 47 | case 0xe: 48 | case 0xf: 49 | return 4; 50 | } 51 | 52 | jassertfalse; 53 | return 1; 54 | } 55 | 56 | } // namespace juce::universal_midi_packets 57 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI16Caller.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "flowgraph/FlowGraphNode.h" 20 | #include "SourceI16Caller.h" 21 | 22 | #if FLOWGRAPH_ANDROID_INTERNAL 23 | #include 24 | #endif 25 | 26 | using namespace oboe; 27 | using namespace flowgraph; 28 | 29 | int32_t SourceI16Caller::onProcess(int32_t numFrames) { 30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames; 31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes); 32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame(); 33 | 34 | float *floatData = output.getBuffer(); 35 | const int16_t *shortData = mConversionBuffer.get(); 36 | int32_t numSamples = framesRead * output.getSamplesPerFrame(); 37 | 38 | #if FLOWGRAPH_ANDROID_INTERNAL 39 | memcpy_to_float_from_i16(floatData, shortData, numSamples); 40 | #else 41 | for (int i = 0; i < numSamples; i++) { 42 | *floatData++ = *shortData++ * (1.0f / 32768); 43 | } 44 | #endif 45 | 46 | return framesRead; 47 | } 48 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToManyConverter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "FlowGraphNode.h" 19 | #include "MultiToManyConverter.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | MultiToManyConverter::MultiToManyConverter(int32_t channelCount) 24 | : outputs(channelCount) 25 | , input(*this, channelCount) { 26 | for (int i = 0; i < channelCount; i++) { 27 | outputs[i] = std::make_unique(*this, 1); 28 | } 29 | } 30 | 31 | MultiToManyConverter::~MultiToManyConverter() = default; 32 | 33 | int32_t MultiToManyConverter::onProcess(int32_t numFrames) { 34 | int32_t channelCount = input.getSamplesPerFrame(); 35 | 36 | for (int ch = 0; ch < channelCount; ch++) { 37 | const float *inputBuffer = input.getBuffer() + ch; 38 | float *outputBuffer = outputs[ch]->getBuffer(); 39 | 40 | for (int i = 0; i < numFrames; i++) { 41 | *outputBuffer++ = *inputBuffer; 42 | inputBuffer += channelCount; 43 | } 44 | } 45 | 46 | return numFrames; 47 | } 48 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ManyToMultiConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H 18 | #define FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "FlowGraphNode.h" 25 | 26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 27 | 28 | /** 29 | * Combine multiple mono inputs into one interleaved multi-channel output. 30 | */ 31 | class ManyToMultiConverter : public flowgraph::FlowGraphNode { 32 | public: 33 | explicit ManyToMultiConverter(int32_t channelCount); 34 | 35 | virtual ~ManyToMultiConverter() = default; 36 | 37 | int32_t onProcess(int numFrames) override; 38 | 39 | void setEnabled(bool /*enabled*/) {} 40 | 41 | std::vector> inputs; 42 | flowgraph::FlowGraphPortFloatOutput output; 43 | 44 | const char *getName() override { 45 | return "ManyToMultiConverter"; 46 | } 47 | 48 | private: 49 | }; 50 | 51 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 52 | 53 | #endif //FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H 54 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/OutputMixerOpenSLES.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_OUTPUT_MIXER_OPENSLES_H 18 | #define OBOE_OUTPUT_MIXER_OPENSLES_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace oboe { 27 | 28 | /** 29 | * INTERNAL USE ONLY 30 | */ 31 | 32 | class OutputMixerOpenSL { 33 | public: 34 | static OutputMixerOpenSL &getInstance(); 35 | 36 | SLresult open(); 37 | 38 | void close(); 39 | 40 | SLresult createAudioPlayer(SLObjectItf *objectItf, 41 | SLDataSource *audioSource); 42 | 43 | private: 44 | // Make this a safe Singleton 45 | OutputMixerOpenSL()= default; 46 | ~OutputMixerOpenSL()= default; 47 | OutputMixerOpenSL(const OutputMixerOpenSL&)= delete; 48 | OutputMixerOpenSL& operator=(const OutputMixerOpenSL&)= delete; 49 | 50 | std::mutex mLock; 51 | int32_t mOpenCount = 0; 52 | 53 | SLObjectItf mOutputMixObject = nullptr; 54 | }; 55 | 56 | } // namespace oboe 57 | 58 | #endif //OBOE_OUTPUT_MIXER_OPENSLES_H 59 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/broadcasters/juce_ActionListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | //============================================================================== 27 | /** 28 | Interface class for delivery of events that are sent by an ActionBroadcaster. 29 | 30 | @see ActionBroadcaster, ChangeListener 31 | 32 | @tags{Events} 33 | */ 34 | class JUCE_API ActionListener 35 | { 36 | public: 37 | /** Destructor. */ 38 | virtual ~ActionListener() = default; 39 | 40 | /** Overridden by your subclass to receive the callback. 41 | 42 | @param message the string that was specified when the event was triggered 43 | by a call to ActionBroadcaster::sendActionMessage() 44 | */ 45 | virtual void actionListenerCallback (const String& message) = 0; 46 | }; 47 | 48 | } // namespace juce 49 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_H 18 | #define RESAMPLER_POLYPHASE_RESAMPLER_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "MultiChannelResampler.h" 26 | #include "ResamplerDefinitions.h" 27 | 28 | namespace RESAMPLER_OUTER_NAMESPACE::resampler { 29 | /** 30 | * Resampler that is optimized for a reduced ratio of sample rates. 31 | * All of the coefficients for each possible phase value are pre-calculated. 32 | */ 33 | class PolyphaseResampler : public MultiChannelResampler { 34 | public: 35 | /** 36 | * 37 | * @param builder containing lots of parameters 38 | */ 39 | explicit PolyphaseResampler(const MultiChannelResampler::Builder &builder); 40 | 41 | virtual ~PolyphaseResampler() = default; 42 | 43 | void readFrame(float *frame) override; 44 | 45 | protected: 46 | 47 | int32_t mCoefficientCursor = 0; 48 | 49 | }; 50 | 51 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */ 52 | 53 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_H 54 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/misc/juce_ScopeGuard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | ErasedScopeGuard::ErasedScopeGuard (std::function d) 27 | : detach (std::move (d)) {} 28 | 29 | ErasedScopeGuard::ErasedScopeGuard (ErasedScopeGuard&& other) noexcept 30 | : detach (std::exchange (other.detach, nullptr)) {} 31 | 32 | ErasedScopeGuard& ErasedScopeGuard::operator= (ErasedScopeGuard&& other) noexcept 33 | { 34 | ErasedScopeGuard token { std::move (other) }; 35 | std::swap (token.detach, detach); 36 | return *this; 37 | } 38 | 39 | ErasedScopeGuard::~ErasedScopeGuard() noexcept 40 | { 41 | reset(); 42 | } 43 | 44 | void ErasedScopeGuard::reset() 45 | { 46 | if (auto d = std::exchange (detach, nullptr)) 47 | d(); 48 | } 49 | 50 | void ErasedScopeGuard::release() 51 | { 52 | detach = nullptr; 53 | } 54 | 55 | } // namespace juce 56 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/LinearResampler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "LinearResampler.h" 18 | 19 | using namespace RESAMPLER_OUTER_NAMESPACE::resampler; 20 | 21 | LinearResampler::LinearResampler(const MultiChannelResampler::Builder &builder) 22 | : MultiChannelResampler(builder) { 23 | mPreviousFrame = std::make_unique(getChannelCount()); 24 | mCurrentFrame = std::make_unique(getChannelCount()); 25 | } 26 | 27 | void LinearResampler::writeFrame(const float *frame) { 28 | memcpy(mPreviousFrame.get(), mCurrentFrame.get(), sizeof(float) * getChannelCount()); 29 | memcpy(mCurrentFrame.get(), frame, sizeof(float) * getChannelCount()); 30 | } 31 | 32 | void LinearResampler::readFrame(float *frame) { 33 | float *previous = mPreviousFrame.get(); 34 | float *current = mCurrentFrame.get(); 35 | float phase = (float) getIntegerPhase() / mDenominator; 36 | // iterate across samples in the frame 37 | for (int channel = 0; channel < getChannelCount(); channel++) { 38 | float f0 = *previous++; 39 | float f1 = *current++; 40 | *frame++ = f0 + (phase * (f1 - f0)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ManyToMultiConverter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "ManyToMultiConverter.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | ManyToMultiConverter::ManyToMultiConverter(int32_t channelCount) 24 | : inputs(channelCount) 25 | , output(*this, channelCount) { 26 | for (int i = 0; i < channelCount; i++) { 27 | inputs[i] = std::make_unique(*this, 1); 28 | } 29 | } 30 | 31 | int32_t ManyToMultiConverter::onProcess(int32_t numFrames) { 32 | int32_t channelCount = output.getSamplesPerFrame(); 33 | 34 | for (int ch = 0; ch < channelCount; ch++) { 35 | const float *inputBuffer = inputs[ch]->getBuffer(); 36 | float *outputBuffer = output.getBuffer() + ch; 37 | 38 | for (int i = 0; i < numFrames; i++) { 39 | // read one, write into the proper interleaved output channel 40 | float sample = *inputBuffer++; 41 | *outputBuffer = sample; 42 | outputBuffer += channelCount; // advance to next multichannel frame 43 | } 44 | } 45 | return numFrames; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/streams/juce_FileInputSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | FileInputSource::FileInputSource (const File& f, bool useFileTimeInHash) 27 | : file (f), useFileTimeInHashGeneration (useFileTimeInHash) 28 | { 29 | } 30 | 31 | FileInputSource::~FileInputSource() 32 | { 33 | } 34 | 35 | InputStream* FileInputSource::createInputStream() 36 | { 37 | return file.createInputStream().release(); 38 | } 39 | 40 | InputStream* FileInputSource::createInputStreamFor (const String& relatedItemPath) 41 | { 42 | return file.getSiblingFile (relatedItemPath).createInputStream().release(); 43 | } 44 | 45 | int64 FileInputSource::hashCode() const 46 | { 47 | int64 h = file.hashCode(); 48 | 49 | if (useFileTimeInHashGeneration) 50 | h ^= file.getLastModificationTime().toMilliseconds(); 51 | 52 | return h; 53 | } 54 | 55 | } // namespace juce 56 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI32Caller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_SOURCE_I32_CALLER_H 18 | #define OBOE_SOURCE_I32_CALLER_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "flowgraph/FlowGraphNode.h" 25 | #include "AudioSourceCaller.h" 26 | #include "FixedBlockReader.h" 27 | 28 | namespace oboe { 29 | 30 | /** 31 | * AudioSource that uses callback to get more data. 32 | */ 33 | class SourceI32Caller : public AudioSourceCaller { 34 | public: 35 | SourceI32Caller(int32_t channelCount, int32_t framesPerCallback) 36 | : AudioSourceCaller(channelCount, framesPerCallback, sizeof(int32_t)) { 37 | mConversionBuffer = std::make_unique(static_cast(channelCount) 38 | * static_cast(output.getFramesPerBuffer())); 39 | } 40 | 41 | int32_t onProcess(int32_t numFrames) override; 42 | 43 | const char *getName() override { 44 | return "SourceI32Caller"; 45 | } 46 | 47 | private: 48 | std::unique_ptr mConversionBuffer; 49 | static constexpr float kScale = 1.0 / (1UL << 31); 50 | }; 51 | 52 | } 53 | #endif //OBOE_SOURCE_I32_CALLER_H 54 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ChannelCountConverter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H 18 | #define FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "FlowGraphNode.h" 24 | 25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 26 | 27 | /** 28 | * Change the number of number of channels without mixing. 29 | * When increasing the channel count, duplicate input channels. 30 | * When decreasing the channel count, drop input channels. 31 | */ 32 | class ChannelCountConverter : public FlowGraphNode { 33 | public: 34 | explicit ChannelCountConverter( 35 | int32_t inputChannelCount, 36 | int32_t outputChannelCount); 37 | 38 | virtual ~ChannelCountConverter(); 39 | 40 | int32_t onProcess(int32_t numFrames) override; 41 | 42 | const char *getName() override { 43 | return "ChannelCountConverter"; 44 | } 45 | 46 | FlowGraphPortFloatInput input; 47 | FlowGraphPortFloatOutput output; 48 | }; 49 | 50 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 51 | 52 | #endif //FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H 53 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI24Caller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_SOURCE_I24_CALLER_H 18 | #define OBOE_SOURCE_I24_CALLER_H 19 | 20 | #include 21 | #include 22 | 23 | #include "flowgraph/FlowGraphNode.h" 24 | #include "AudioSourceCaller.h" 25 | #include "FixedBlockReader.h" 26 | 27 | namespace oboe { 28 | 29 | /** 30 | * AudioSource that uses callback to get more data. 31 | */ 32 | class SourceI24Caller : public AudioSourceCaller { 33 | public: 34 | SourceI24Caller(int32_t channelCount, int32_t framesPerCallback) 35 | : AudioSourceCaller(channelCount, framesPerCallback, kBytesPerI24Packed) { 36 | mConversionBuffer = std::make_unique(static_cast(kBytesPerI24Packed) 37 | * static_cast(channelCount) 38 | * static_cast(output.getFramesPerBuffer())); 39 | } 40 | 41 | int32_t onProcess(int32_t numFrames) override; 42 | 43 | const char *getName() override { 44 | return "SourceI24Caller"; 45 | } 46 | 47 | private: 48 | std::unique_ptr mConversionBuffer; 49 | static constexpr int kBytesPerI24Packed = 3; 50 | }; 51 | 52 | } 53 | #endif //OBOE_SOURCE_I16_CALLER_H 54 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef FLAC__PRIVATE__MD5_H 2 | #define FLAC__PRIVATE__MD5_H 3 | 4 | /* 5 | * This is the header file for the MD5 message-digest algorithm. 6 | * The algorithm is due to Ron Rivest. This code was 7 | * written by Colin Plumb in 1993, no copyright is claimed. 8 | * This code is in the public domain; do with it what you wish. 9 | * 10 | * Equivalent code is available from RSA Data Security, Inc. 11 | * This code has been tested against that, and is equivalent, 12 | * except that you don't need to include two pages of legalese 13 | * with every copy. 14 | * 15 | * To compute the message digest of a chunk of bytes, declare an 16 | * MD5Context structure, pass it to MD5Init, call MD5Update as 17 | * needed on buffers full of bytes, and then call MD5Final, which 18 | * will fill a supplied 16-byte array with the digest. 19 | * 20 | * Changed so as no longer to depend on Colin Plumb's `usual.h' 21 | * header definitions; now uses stuff from dpkg's config.h 22 | * - Ian Jackson . 23 | * Still in the public domain. 24 | * 25 | * Josh Coalson: made some changes to integrate with libFLAC. 26 | * Still in the public domain, with no warranty. 27 | */ 28 | 29 | #include "../../../ordinals.h" 30 | 31 | typedef union { 32 | FLAC__byte *p8; 33 | FLAC__int16 *p16; 34 | FLAC__int32 *p32; 35 | } FLAC__multibyte; 36 | 37 | typedef struct { 38 | FLAC__uint32 in[16]; 39 | FLAC__uint32 buf[4]; 40 | FLAC__uint32 bytes[2]; 41 | FLAC__multibyte internal_buf; 42 | size_t capacity; 43 | } FLAC__MD5Context; 44 | 45 | void FLAC__MD5Init(FLAC__MD5Context *context); 46 | void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context); 47 | 48 | FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], uint32_t channels, uint32_t samples, uint32_t bytes_per_sample); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPSysEx7.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce::universal_midi_packets 24 | { 25 | 26 | uint32_t SysEx7::getNumPacketsRequiredForDataSize (uint32_t size) 27 | { 28 | constexpr auto denom = 6; 29 | return (size / denom) + ((size % denom) != 0); 30 | } 31 | 32 | SysEx7::PacketBytes SysEx7::getDataBytes (const PacketX2& packet) 33 | { 34 | const auto numBytes = Utils::getChannel (packet[0]); 35 | constexpr uint8_t maxBytes = 6; 36 | jassert (numBytes <= maxBytes); 37 | 38 | return 39 | { 40 | { { std::byte { packet.getU8<2>() }, 41 | std::byte { packet.getU8<3>() }, 42 | std::byte { packet.getU8<4>() }, 43 | std::byte { packet.getU8<5>() }, 44 | std::byte { packet.getU8<6>() }, 45 | std::byte { packet.getU8<7>() } } }, 46 | jmin (numBytes, maxBytes) 47 | }; 48 | } 49 | 50 | } // namespace juce::universal_midi_packets 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/IntegerRatio.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "IntegerRatio.h" 18 | 19 | using namespace RESAMPLER_OUTER_NAMESPACE::resampler; 20 | 21 | // Enough primes to cover the common sample rates. 22 | static const int kPrimes[] = { 23 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 24 | 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 25 | 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 26 | 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199}; 27 | 28 | void IntegerRatio::reduce() { 29 | for (int prime : kPrimes) { 30 | if (mNumerator < prime || mDenominator < prime) { 31 | break; 32 | } 33 | 34 | // Find biggest prime factor for numerator. 35 | while (true) { 36 | int top = mNumerator / prime; 37 | int bottom = mDenominator / prime; 38 | if ((top >= 1) 39 | && (bottom >= 1) 40 | && (top * prime == mNumerator) // divided evenly? 41 | && (bottom * prime == mDenominator)) { 42 | mNumerator = top; 43 | mDenominator = bottom; 44 | } else { 45 | break; 46 | } 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI16.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "FlowGraphNode.h" 21 | #include "SourceI16.h" 22 | 23 | #if FLOWGRAPH_ANDROID_INTERNAL 24 | #include 25 | #endif 26 | 27 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 28 | 29 | SourceI16::SourceI16(int32_t channelCount) 30 | : FlowGraphSourceBuffered(channelCount) { 31 | } 32 | 33 | int32_t SourceI16::onProcess(int32_t numFrames) { 34 | float *floatData = output.getBuffer(); 35 | int32_t channelCount = output.getSamplesPerFrame(); 36 | 37 | int32_t framesLeft = mSizeInFrames - mFrameIndex; 38 | int32_t framesToProcess = std::min(numFrames, framesLeft); 39 | int32_t numSamples = framesToProcess * channelCount; 40 | 41 | const int16_t *shortBase = static_cast(mData); 42 | const int16_t *shortData = &shortBase[mFrameIndex * channelCount]; 43 | 44 | #if FLOWGRAPH_ANDROID_INTERNAL 45 | memcpy_to_float_from_i16(floatData, shortData, numSamples); 46 | #else 47 | for (int i = 0; i < numSamples; i++) { 48 | *floatData++ = *shortData++ * (1.0f / 32768); 49 | } 50 | #endif 51 | 52 | mFrameIndex += framesToProcess; 53 | return framesToProcess; 54 | } 55 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "FlowGraphNode.h" 21 | #include "SourceI32.h" 22 | 23 | #if FLOWGRAPH_ANDROID_INTERNAL 24 | #include 25 | #endif 26 | 27 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 28 | 29 | SourceI32::SourceI32(int32_t channelCount) 30 | : FlowGraphSourceBuffered(channelCount) { 31 | } 32 | 33 | int32_t SourceI32::onProcess(int32_t numFrames) { 34 | float *floatData = output.getBuffer(); 35 | const int32_t channelCount = output.getSamplesPerFrame(); 36 | 37 | const int32_t framesLeft = mSizeInFrames - mFrameIndex; 38 | const int32_t framesToProcess = std::min(numFrames, framesLeft); 39 | const int32_t numSamples = framesToProcess * channelCount; 40 | 41 | const int32_t *intBase = static_cast(mData); 42 | const int32_t *intData = &intBase[mFrameIndex * channelCount]; 43 | 44 | #if FLOWGRAPH_ANDROID_INTERNAL 45 | memcpy_to_float_from_i32(floatData, intData, numSamples); 46 | #else 47 | for (int i = 0; i < numSamples; i++) { 48 | *floatData++ = *intData++ * kScale; 49 | } 50 | #endif 51 | 52 | mFrameIndex += framesToProcess; 53 | return framesToProcess; 54 | } 55 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #################### CMakeLists.txt (libopenshot-audio) ###################### 2 | # @brief CMake build file for libopenshot-audio (used to generate makefiles) 3 | # @author Jonathan Thomas 4 | # 5 | # @section LICENSE 6 | # 7 | # Copyright (c) 2008-2016 OpenShot Studios, LLC 8 | # . This file is part of 9 | # OpenShot Audio Library (libopenshot-audio), an open-source project dedicated 10 | # to delivering high quality audio editing and playback solutions to the 11 | # world. For more information visit . 12 | # 13 | # OpenShot Audio Library (libopenshot-audio) is free software: you can 14 | # redistribute it and/or modify it under the terms of the GNU General Public 15 | # License as published by the Free Software Foundation, either version 3 of the 16 | # License, or (at your option) any later version. 17 | # 18 | # OpenShot Audio Library (libopenshot-audio) is distributed in the hope that it 19 | # will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 20 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 21 | # Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with OpenShot Audio Library. If not, see . 25 | ################################################################################ 26 | 27 | add_executable(openshot-audio-demo Main.cpp) 28 | target_link_libraries(openshot-audio-demo OpenShot::Audio) 29 | 30 | # Set compile features in ancient CMake (newer releases would 31 | # make them transitive from the library) 32 | if(CMAKE_VERSION VERSION_LESS 3.8) 33 | set_target_properties(openshot-audio-demo PROPERTIES 34 | CXX_STANDARD 11 35 | CXX_STANDARD_REQUIRED YES 36 | CXX_EXTENSIONS NO 37 | ) 38 | endif() 39 | 40 | install(TARGETS openshot-audio-demo 41 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 42 | ) 43 | 44 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/FixedBlockWriter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef AAUDIO_FIXED_BLOCK_WRITER_H 18 | #define AAUDIO_FIXED_BLOCK_WRITER_H 19 | 20 | #include 21 | 22 | #include "FixedBlockAdapter.h" 23 | 24 | /** 25 | * This can be used to convert a push data flow from variable sized buffers to fixed sized buffers. 26 | * An example would be an audio input callback. 27 | */ 28 | class FixedBlockWriter : public FixedBlockAdapter 29 | { 30 | public: 31 | FixedBlockWriter(FixedBlockProcessor &fixedBlockProcessor); 32 | 33 | virtual ~FixedBlockWriter() = default; 34 | 35 | /** 36 | * Write from a variable sized block. 37 | * 38 | * Note that if the fixed-sized blocks must be aligned, then the variable-sized blocks 39 | * must have the same alignment. 40 | * For example, if the fixed-size blocks must be a multiple of 8, then the variable-sized 41 | * blocks must also be a multiple of 8. 42 | * 43 | * @param buffer 44 | * @param numBytes 45 | * @return Number of bytes written or a negative error code. 46 | */ 47 | int32_t write(uint8_t *buffer, int32_t numBytes); 48 | 49 | private: 50 | 51 | int32_t writeToStorage(uint8_t *buffer, int32_t numBytes); 52 | }; 53 | 54 | #endif /* AAUDIO_FIXED_BLOCK_WRITER_H */ 55 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/AudioInputStreamOpenSLES.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef AUDIO_INPUT_STREAM_OPENSL_ES_H_ 18 | #define AUDIO_INPUT_STREAM_OPENSL_ES_H_ 19 | 20 | 21 | #include 22 | #include 23 | 24 | #include "oboe/Oboe.h" 25 | #include "AudioStreamOpenSLES.h" 26 | 27 | namespace oboe { 28 | 29 | /** 30 | * INTERNAL USE ONLY 31 | */ 32 | 33 | class AudioInputStreamOpenSLES : public AudioStreamOpenSLES { 34 | public: 35 | AudioInputStreamOpenSLES(); 36 | explicit AudioInputStreamOpenSLES(const AudioStreamBuilder &builder); 37 | 38 | virtual ~AudioInputStreamOpenSLES(); 39 | 40 | Result open() override; 41 | Result close() override; 42 | 43 | Result requestStart() override; 44 | Result requestPause() override; 45 | Result requestFlush() override; 46 | Result requestStop() override; 47 | 48 | protected: 49 | Result requestStop_l(); 50 | 51 | Result updateServiceFrameCounter() override; 52 | 53 | void updateFramesWritten() override; 54 | 55 | private: 56 | 57 | SLuint32 channelCountToChannelMask(int chanCount) const; 58 | 59 | Result setRecordState_l(SLuint32 newState); 60 | 61 | SLRecordItf mRecordInterface = nullptr; 62 | }; 63 | 64 | } // namespace oboe 65 | 66 | #endif //AUDIO_INPUT_STREAM_OPENSL_ES_H_ 67 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/registry.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #include "../../codec.h" 18 | #include "codec_internal.h" 19 | #include "registry.h" 20 | #include "misc.h" 21 | /* seems like major overkill now; the backend numbers will grow into 22 | the infrastructure soon enough */ 23 | 24 | extern const vorbis_func_floor floor0_exportbundle; 25 | extern const vorbis_func_floor floor1_exportbundle; 26 | extern const vorbis_func_residue residue0_exportbundle; 27 | extern const vorbis_func_residue residue1_exportbundle; 28 | extern const vorbis_func_residue residue2_exportbundle; 29 | extern const vorbis_func_mapping mapping0_exportbundle; 30 | 31 | const vorbis_func_floor *const _floor_P[]={ 32 | &floor0_exportbundle, 33 | &floor1_exportbundle, 34 | }; 35 | 36 | const vorbis_func_residue *const _residue_P[]={ 37 | &residue0_exportbundle, 38 | &residue1_exportbundle, 39 | &residue2_exportbundle, 40 | }; 41 | 42 | const vorbis_func_mapping *const _mapping_P[]={ 43 | &mapping0_exportbundle, 44 | }; 45 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_data_structures/juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | #ifdef JUCE_DATA_STRUCTURES_H_INCLUDED 27 | /* When you add this cpp file to your project, you mustn't include it in a file where you've 28 | already included any other headers - just put it inside a file on its own, possibly with your config 29 | flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix 30 | header files that the compiler may be using. 31 | */ 32 | #error "Incorrect use of JUCE cpp file" 33 | #endif 34 | 35 | #include "juce_data_structures.h" 36 | 37 | #include "values/juce_Value.cpp" 38 | #include "values/juce_ValueTree.cpp" 39 | #include "values/juce_ValueTreeSynchroniser.cpp" 40 | #include "values/juce_CachedValue.cpp" 41 | #include "undomanager/juce_UndoManager.cpp" 42 | #include "undomanager/juce_UndoableAction.cpp" 43 | #include "app_properties/juce_ApplicationProperties.cpp" 44 | #include "app_properties/juce_PropertiesFile.cpp" 45 | 46 | #if JUCE_UNIT_TESTS 47 | #include "values/juce_ValueTreePropertyWithDefault_test.cpp" 48 | #endif 49 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/FlowgraphUtilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_UTILITIES_H 18 | #define FLOWGRAPH_UTILITIES_H 19 | 20 | #include 21 | 22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 23 | 24 | class FlowgraphUtilities { 25 | public: 26 | // This was copied from audio_utils/primitives.h 27 | /** 28 | * Convert a single-precision floating point value to a Q0.31 integer value. 29 | * Rounds to nearest, ties away from 0. 30 | * 31 | * Values outside the range [-1.0, 1.0) are properly clamped to -2147483648 and 2147483647, 32 | * including -Inf and +Inf. NaN values are considered undefined, and behavior may change 33 | * depending on hardware and future implementation of this function. 34 | */ 35 | static int32_t clamp32FromFloat(float f) 36 | { 37 | static const float scale = (float)(1UL << 31); 38 | static const float limpos = 1.; 39 | static const float limneg = -1.; 40 | 41 | if (f <= limneg) { 42 | return INT32_MIN; 43 | } else if (f >= limpos) { 44 | return INT32_MAX; 45 | } 46 | f *= scale; 47 | /* integer conversion is through truncation (though int to float is not). 48 | * ensure that we round to nearest, ties away from 0. 49 | */ 50 | return f > 0 ? f + 0.5 : f - 0.5; 51 | } 52 | 53 | }; 54 | 55 | #endif // FLOWGRAPH_UTILITIES_H 56 | -------------------------------------------------------------------------------- /cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | ### 2 | # @file 3 | # @brief CMake EXPORTED configuration for @PROJECT_NAME@ 4 | # @author FeRD (Frank Dana) 5 | # 6 | # Copyright (c) 2008-2020 OpenShot Studios, LLC 7 | # . This file is part of 8 | # OpenShot Audio Library (libopenshot-audio), an open-source project dedicated 9 | # to delivering high quality audio editing and playback solutions to the 10 | # world. For more information visit . 11 | # 12 | # OpenShot Audio Library (libopenshot-audio) is free software: you can 13 | # redistribute it and/or modify it under the terms of the GNU General Public 14 | # License as published by the Free Software Foundation, either version 3 of the 15 | # License, or (at your option) any later version. 16 | # 17 | # OpenShot Audio Library (libopenshot-audio) is distributed in the hope that it 18 | # will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 19 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 20 | # Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with OpenShot Audio Library. If not, see . 24 | ################################################################################ 25 | 26 | @PACKAGE_INIT@ 27 | 28 | include(CMakeFindDependencyMacro) 29 | 30 | if(@NEED_ASIO@) 31 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 32 | find_dependency(ASIO) 33 | endif() 34 | 35 | if(@NEED_ALSA@) 36 | find_dependency(ALSA) 37 | if (ALSA_FOUND AND NOT TARGET ALSA::ALSA) # CMake < 3.12 38 | add_library(ALSA::ALSA INTERFACE IMPORTED) 39 | set_target_properties(ALSA::ALSA PROPERTIES 40 | INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} 41 | INTERFACE_LINK_LIBRARIES ${ALSA_LIBRARIES} 42 | ) 43 | endif() 44 | endif() 45 | 46 | find_dependency(ZLIB) 47 | 48 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 49 | 50 | check_required_components(@PROJECT_NAME@) 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "FlowGraphNode.h" 18 | #include "FlowgraphUtilities.h" 19 | #include "SinkI32.h" 20 | 21 | #if FLOWGRAPH_ANDROID_INTERNAL 22 | #include 23 | #endif 24 | 25 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 26 | 27 | SinkI32::SinkI32(int32_t channelCount) 28 | : FlowGraphSink(channelCount) {} 29 | 30 | int32_t SinkI32::read(void *data, int32_t numFrames) { 31 | int32_t *intData = (int32_t *) data; 32 | const int32_t channelCount = input.getSamplesPerFrame(); 33 | 34 | int32_t framesLeft = numFrames; 35 | while (framesLeft > 0) { 36 | // Run the graph and pull data through the input port. 37 | int32_t framesRead = pullData(framesLeft); 38 | if (framesRead <= 0) { 39 | break; 40 | } 41 | const float *signal = input.getBuffer(); 42 | int32_t numSamples = framesRead * channelCount; 43 | #if FLOWGRAPH_ANDROID_INTERNAL 44 | memcpy_to_i32_from_float(intData, signal, numSamples); 45 | intData += numSamples; 46 | signal += numSamples; 47 | #else 48 | for (int i = 0; i < numSamples; i++) { 49 | *intData++ = FlowgraphUtilities::clamp32FromFloat(*signal++); 50 | } 51 | #endif 52 | framesLeft -= framesRead; 53 | } 54 | return numFrames - framesLeft; 55 | } 56 | -------------------------------------------------------------------------------- /JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION 27 | /** If you've hit this error then the version of the Projucer that was used to generate this project is 28 | older than the version of the JUCE modules being included. To fix this error, re-save your project 29 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, 30 | remove the JUCE_PROJUCER_VERSION define. 31 | */ 32 | #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." 33 | #endif 34 | 35 | #if ! DONT_SET_USING_JUCE_NAMESPACE 36 | // If your code uses a lot of JUCE classes, then this will obviously save you 37 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 38 | using namespace juce; 39 | #endif 40 | 41 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 42 | namespace ProjectInfo 43 | { 44 | const char* const projectName = "OpenShotAudio"; 45 | const char* const companyName = "OpenShot Studios, LLC"; 46 | const char* const versionString = "0.2.1"; 47 | const int versionNumber = 0x201; 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/include/oboe/OboeExtensions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_EXTENSIONS_ 18 | #define OBOE_EXTENSIONS_ 19 | 20 | #include 21 | 22 | #include "oboe/Definitions.h" 23 | #include "oboe/AudioStream.h" 24 | 25 | namespace oboe { 26 | 27 | /** 28 | * The definitions below are only for testing. 29 | * They are not recommended for use in an application. 30 | * They may change or be removed at any time. 31 | */ 32 | class OboeExtensions { 33 | public: 34 | 35 | /** 36 | * @returns true if the device supports AAudio MMAP 37 | */ 38 | static bool isMMapSupported(); 39 | 40 | /** 41 | * @returns true if the AAudio MMAP data path can be selected 42 | */ 43 | static bool isMMapEnabled(); 44 | 45 | /** 46 | * Controls whether the AAudio MMAP data path can be selected when opening a stream. 47 | * It has no effect after the stream has been opened. 48 | * It only affects the application that calls it. Other apps are not affected. 49 | * 50 | * @param enabled 51 | * @return 0 or a negative error code 52 | */ 53 | static int32_t setMMapEnabled(bool enabled); 54 | 55 | /** 56 | * @param oboeStream 57 | * @return true if the AAudio MMAP data path is used on the stream 58 | */ 59 | static bool isMMapUsed(oboe::AudioStream *oboeStream); 60 | }; 61 | 62 | } // namespace oboe 63 | 64 | #endif // OBOE_LATENCY_TUNER_ 65 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | #if JUCE_MAC || JUCE_WINDOWS || DOXYGEN 27 | 28 | //============================================================================== 29 | /** 30 | An instance of this class will provide callbacks when drives are 31 | mounted or unmounted on the system. 32 | 33 | Just inherit from this class and implement the pure virtual method 34 | to get the callbacks, there's no need to do anything else. 35 | 36 | @see File::findFileSystemRoots() 37 | 38 | @tags{Events} 39 | */ 40 | class JUCE_API MountedVolumeListChangeDetector 41 | { 42 | public: 43 | MountedVolumeListChangeDetector(); 44 | virtual ~MountedVolumeListChangeDetector(); 45 | 46 | /** This method is called when a volume is mounted or unmounted. */ 47 | virtual void mountedVolumeListChanged() = 0; 48 | 49 | private: 50 | JUCE_PUBLIC_IN_DLL_BUILD (struct Pimpl) 51 | std::unique_ptr pimpl; 52 | 53 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MountedVolumeListChangeDetector) 54 | }; 55 | 56 | #endif 57 | 58 | } // namespace juce 59 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/streams/juce_URLInputSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | URLInputSource::URLInputSource (const URL& url) 27 | : u (url) 28 | { 29 | } 30 | 31 | URLInputSource::URLInputSource (URL&& url) 32 | : u (std::move (url)) 33 | { 34 | } 35 | 36 | URLInputSource::~URLInputSource() 37 | { 38 | } 39 | 40 | InputStream* URLInputSource::createInputStream() 41 | { 42 | return u.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)).release(); 43 | } 44 | 45 | InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath) 46 | { 47 | auto sub = u.getSubPath(); 48 | auto parent = sub.containsChar (L'/') ? sub.upToLastOccurrenceOf ("/", false, false) 49 | : String(); 50 | 51 | return u.withNewSubPath (parent) 52 | .getChildURL (relatedItemPath) 53 | .createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)) 54 | .release(); 55 | } 56 | 57 | int64 URLInputSource::hashCode() const 58 | { 59 | return u.toString (true).hashCode64(); 60 | } 61 | 62 | } // namespace juce 63 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI16.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include "SinkI16.h" 21 | 22 | #if FLOWGRAPH_ANDROID_INTERNAL 23 | #include 24 | #endif 25 | 26 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 27 | 28 | SinkI16::SinkI16(int32_t channelCount) 29 | : FlowGraphSink(channelCount) {} 30 | 31 | int32_t SinkI16::read(void *data, int32_t numFrames) { 32 | int16_t *shortData = (int16_t *) data; 33 | const int32_t channelCount = input.getSamplesPerFrame(); 34 | 35 | int32_t framesLeft = numFrames; 36 | while (framesLeft > 0) { 37 | // Run the graph and pull data through the input port. 38 | int32_t framesRead = pullData(framesLeft); 39 | if (framesRead <= 0) { 40 | break; 41 | } 42 | const float *signal = input.getBuffer(); 43 | int32_t numSamples = framesRead * channelCount; 44 | #if FLOWGRAPH_ANDROID_INTERNAL 45 | memcpy_to_i16_from_float(shortData, signal, numSamples); 46 | shortData += numSamples; 47 | signal += numSamples; 48 | #else 49 | for (int i = 0; i < numSamples; i++) { 50 | int32_t n = (int32_t) (*signal++ * 32768.0f); 51 | *shortData++ = std::min(INT16_MAX, std::max(INT16_MIN, n)); // clip 52 | } 53 | #endif 54 | framesLeft -= framesRead; 55 | } 56 | return numFrames - framesLeft; 57 | } 58 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/EngineOpenSLES.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OBOE_ENGINE_OPENSLES_H 18 | #define OBOE_ENGINE_OPENSLES_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace oboe { 27 | 28 | /** 29 | * INTERNAL USE ONLY 30 | */ 31 | class EngineOpenSLES { 32 | public: 33 | static EngineOpenSLES &getInstance(); 34 | 35 | SLresult open(); 36 | 37 | void close(); 38 | 39 | SLresult createOutputMix(SLObjectItf *objectItf); 40 | 41 | SLresult createAudioPlayer(SLObjectItf *objectItf, 42 | SLDataSource *audioSource, 43 | SLDataSink *audioSink); 44 | SLresult createAudioRecorder(SLObjectItf *objectItf, 45 | SLDataSource *audioSource, 46 | SLDataSink *audioSink); 47 | 48 | private: 49 | // Make this a safe Singleton 50 | EngineOpenSLES()= default; 51 | ~EngineOpenSLES()= default; 52 | EngineOpenSLES(const EngineOpenSLES&)= delete; 53 | EngineOpenSLES& operator=(const EngineOpenSLES&)= delete; 54 | 55 | std::mutex mLock; 56 | int32_t mOpenCount = 0; 57 | 58 | SLObjectItf mEngineObject = nullptr; 59 | SLEngineItf mEngineInterface = nullptr; 60 | }; 61 | 62 | } // namespace oboe 63 | 64 | 65 | #endif //OBOE_ENGINE_OPENSLES_H 66 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ClipToRange.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef FLOWGRAPH_CLIP_TO_RANGE_H 18 | #define FLOWGRAPH_CLIP_TO_RANGE_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "FlowGraphNode.h" 25 | 26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph { 27 | 28 | // This is 3 dB, (10^(3/20)), to match the maximum headroom in AudioTrack for float data. 29 | // It is designed to allow occasional transient peaks. 30 | constexpr float kDefaultMaxHeadroom = 1.41253754f; 31 | constexpr float kDefaultMinHeadroom = -kDefaultMaxHeadroom; 32 | 33 | class ClipToRange : public FlowGraphFilter { 34 | public: 35 | explicit ClipToRange(int32_t channelCount); 36 | 37 | virtual ~ClipToRange() = default; 38 | 39 | int32_t onProcess(int32_t numFrames) override; 40 | 41 | void setMinimum(float min) { 42 | mMinimum = min; 43 | } 44 | 45 | float getMinimum() const { 46 | return mMinimum; 47 | } 48 | 49 | void setMaximum(float min) { 50 | mMaximum = min; 51 | } 52 | 53 | float getMaximum() const { 54 | return mMaximum; 55 | } 56 | 57 | const char *getName() override { 58 | return "ClipToRange"; 59 | } 60 | 61 | private: 62 | float mMinimum = kDefaultMinHeadroom; 63 | float mMaximum = kDefaultMaxHeadroom; 64 | }; 65 | 66 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */ 67 | 68 | #endif //FLOWGRAPH_CLIP_TO_RANGE_H 69 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/highlevel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: highlevel encoder setup struct separated out for vorbisenc clarity 14 | 15 | ********************************************************************/ 16 | 17 | typedef struct highlevel_byblocktype { 18 | double tone_mask_setting; 19 | double tone_peaklimit_setting; 20 | double noise_bias_setting; 21 | double noise_compand_setting; 22 | } highlevel_byblocktype; 23 | 24 | typedef struct highlevel_encode_setup { 25 | int set_in_stone; 26 | const void *setup; 27 | double base_setting; 28 | 29 | double impulse_noisetune; 30 | 31 | /* bitrate management below all settable */ 32 | float req; 33 | int managed; 34 | long bitrate_min; 35 | long bitrate_av; 36 | double bitrate_av_damp; 37 | long bitrate_max; 38 | long bitrate_reservoir; 39 | double bitrate_reservoir_bias; 40 | 41 | int impulse_block_p; 42 | int noise_normalize_p; 43 | int coupling_p; 44 | 45 | double stereo_point_setting; 46 | double lowpass_kHz; 47 | int lowpass_altered; 48 | 49 | double ath_floating_dB; 50 | double ath_absolute_dB; 51 | 52 | double amplitude_track_dBpersec; 53 | double trigger_setting; 54 | 55 | highlevel_byblocktype block[4]; /* padding, impulse, transition, long */ 56 | 57 | } highlevel_encode_setup; 58 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/timers/juce_TimedCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | namespace juce 27 | { 28 | 29 | /** Utility class wrapping a single non-null callback called by a Timer. 30 | 31 | You can use the usual Timer functions to start and stop the TimedCallback. Deleting the 32 | TimedCallback will automatically stop the underlying Timer. 33 | 34 | With this class you can use the Timer facility without inheritance. 35 | 36 | @see Timer 37 | @tags{Events} 38 | */ 39 | class TimedCallback final : private Timer 40 | { 41 | public: 42 | /** Constructor. The passed in callback must be non-null. */ 43 | explicit TimedCallback (std::function callbackIn) 44 | : callback (std::move (callbackIn)) 45 | { 46 | jassert (callback); 47 | } 48 | 49 | /** Destructor. */ 50 | ~TimedCallback() noexcept override { stopTimer(); } 51 | 52 | using Timer::startTimer; 53 | using Timer::startTimerHz; 54 | using Timer::stopTimer; 55 | using Timer::isTimerRunning; 56 | using Timer::getTimerInterval; 57 | 58 | private: 59 | void timerCallback() override { callback(); } 60 | 61 | std::function callback; 62 | }; 63 | 64 | } // namespace juce 65 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_dsp/maths/juce_Phase.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License 11 | Agreement and JUCE Privacy Policy. 12 | 13 | End User License Agreement: www.juce.com/juce-7-licence 14 | Privacy Policy: www.juce.com/juce-privacy-policy 15 | 16 | Or: You may also use this code under the terms of the GPL v3 (see 17 | www.gnu.org/licenses). 18 | 19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 | DISCLAIMED. 22 | 23 | ============================================================================== 24 | */ 25 | 26 | namespace juce::dsp 27 | { 28 | 29 | /** 30 | Represents an increasing phase value between 0 and 2*pi. 31 | 32 | This represents a value which can be incremented, and which wraps back to 0 when it 33 | goes past 2 * pi. 34 | 35 | @tags{DSP} 36 | */ 37 | template 38 | struct Phase 39 | { 40 | /** Resets the phase to 0. */ 41 | void reset() noexcept { phase = 0; } 42 | 43 | /** Returns the current value, and increments the phase by the given increment. 44 | The increment must be a positive value, it can't go backwards! 45 | The new value of the phase after calling this function will be (phase + increment) % (2 * pi). 46 | */ 47 | Type advance (Type increment) noexcept 48 | { 49 | jassert (increment >= 0); // cannot run this value backwards! 50 | 51 | auto last = phase; 52 | auto next = last + increment; 53 | 54 | while (next >= MathConstants::twoPi) 55 | next -= MathConstants::twoPi; 56 | 57 | phase = next; 58 | return last; 59 | } 60 | 61 | Type phase = 0; 62 | }; 63 | 64 | } // namespace juce::dsp 65 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_events/native/juce_ScopedLowPowerModeDisabler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | #if JUCE_MAC 27 | 28 | class ScopedLowPowerModeDisabler::Pimpl 29 | { 30 | public: 31 | Pimpl() 32 | { 33 | if (@available (macOS 10.9, *)) 34 | activity = [[NSProcessInfo processInfo] beginActivityWithOptions: NSActivityUserInitiatedAllowingIdleSystemSleep 35 | reason: @"App must remain in high-power mode"]; 36 | } 37 | 38 | ~Pimpl() 39 | { 40 | if (@available (macOS 10.9, *)) 41 | [[NSProcessInfo processInfo] endActivity: activity]; 42 | } 43 | 44 | private: 45 | id activity; 46 | 47 | JUCE_DECLARE_NON_COPYABLE (Pimpl) 48 | JUCE_DECLARE_NON_MOVEABLE (Pimpl) 49 | }; 50 | 51 | #else 52 | 53 | class ScopedLowPowerModeDisabler::Pimpl {}; 54 | 55 | #endif 56 | 57 | //============================================================================== 58 | ScopedLowPowerModeDisabler::ScopedLowPowerModeDisabler() 59 | : pimpl (std::make_unique()) {} 60 | 61 | ScopedLowPowerModeDisabler::~ScopedLowPowerModeDisabler() = default; 62 | 63 | } // namespace juce 64 | -------------------------------------------------------------------------------- /include/OpenShotAudio.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #define Point IgnorePoint 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #undef Point 26 | 27 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION 28 | /** If you've hit this error then the version of the Projucer that was used to generate this project is 29 | older than the version of the JUCE modules being included. To fix this error, re-save your project 30 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, 31 | remove the JUCE_PROJUCER_VERSION define from the AppConfig.h file. 32 | */ 33 | #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." 34 | #endif 35 | 36 | #if ! DONT_SET_USING_JUCE_NAMESPACE 37 | // If your code uses a lot of JUCE classes, then this will obviously save you 38 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 39 | using namespace juce; 40 | #endif 41 | 42 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 43 | namespace ProjectInfo 44 | { 45 | const char* const projectName = "@PROJECT_NAME@"; 46 | const char* const companyName = "OpenShot Studios, LLC"; 47 | const char* const versionString = "@PROJECT_VERSION_FULL@"; 48 | const int versionNumber = @PROJECT_VERSION_HEX@; 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI24Caller.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include "flowgraph/FlowGraphNode.h" 20 | #include "SourceI24Caller.h" 21 | 22 | #if FLOWGRAPH_ANDROID_INTERNAL 23 | #include 24 | #endif 25 | 26 | using namespace oboe; 27 | using namespace flowgraph; 28 | 29 | int32_t SourceI24Caller::onProcess(int32_t numFrames) { 30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames; 31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes); 32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame(); 33 | 34 | float *floatData = output.getBuffer(); 35 | const uint8_t *byteData = mConversionBuffer.get(); 36 | int32_t numSamples = framesRead * output.getSamplesPerFrame(); 37 | 38 | #if FLOWGRAPH_ANDROID_INTERNAL 39 | memcpy_to_float_from_p24(floatData, byteData, numSamples); 40 | #else 41 | static const float scale = 1. / (float)(1UL << 31); 42 | for (int i = 0; i < numSamples; i++) { 43 | // Assemble the data assuming Little Endian format. 44 | int32_t pad = byteData[2]; 45 | pad <<= 8; 46 | pad |= byteData[1]; 47 | pad <<= 8; 48 | pad |= byteData[0]; 49 | pad <<= 8; // Shift to 32 bit data so the sign is correct. 50 | byteData += kBytesPerI24Packed; 51 | *floatData++ = pad * scale; // scale to range -1.0 to 1.0 52 | } 53 | #endif 54 | 55 | return framesRead; 56 | } 57 | -------------------------------------------------------------------------------- /src/hex_version.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @brief Build utility program to generate hex-format version numbers 4 | * @author FeRD (Frank Dana) 5 | * 6 | * @section LICENSE 7 | * 8 | * Copyright (c) 2008-2020 OpenShot Studios, LLC 9 | * . This file is part of OpenShot Audio 10 | * Library (libopenshot-audio), an open-source project dedicated to delivering 11 | * high quality audio editing and playback solutions to the world. For more 12 | * information visit . 13 | * 14 | * OpenShot Audio Library (libopenshot-audio) is free software: you can 15 | * redistribute it and/or modify it under the terms of the GNU General 16 | * Public License as published by the Free Software Foundation, either version 17 | * 3 of the License, or (at your option) any later version. 18 | * 19 | * OpenShot Audio Library (libopenshot-audio) is distributed in the hope that 20 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 21 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * You should have received a copy of the GNU General Public License 25 | * along with OpenShot Library. If not, see . 26 | * 27 | * @mainpage OpenShot Audio Library C++ API 28 | * 29 | * Welcome to the OpenShot Audio Library C++ API. This library is used by libopenshot to enable audio 30 | * features, which powers the OpenShot Video Editor application. 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | // The following values must be defined at compile time: 37 | // VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH 38 | 39 | #if !defined(VERSION_MAJOR) || !defined(VERSION_MINOR) || !defined(VERSION_PATCH) 40 | #pragma error "Define version components on compiler command line!" 41 | #endif 42 | 43 | int main() 44 | { 45 | 46 | int hex_version = (VERSION_MAJOR << 16) + 47 | (VERSION_MINOR << 8) + 48 | (VERSION_PATCH); 49 | 50 | std::cout << std::hex << "0x" << hex_version; 51 | } 52 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_core/threads/juce_WaitableEvent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file is part of the JUCE library. 5 | Copyright (c) 2022 - Raw Material Software Limited 6 | 7 | JUCE is an open source library subject to commercial or open-source 8 | licensing. 9 | 10 | The code included in this file is provided under the terms of the ISC license 11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission 12 | To use, copy, modify, and/or distribute this software for any purpose with or 13 | without fee is hereby granted provided that the above copyright notice and 14 | this permission notice appear in all copies. 15 | 16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 18 | DISCLAIMED. 19 | 20 | ============================================================================== 21 | */ 22 | 23 | namespace juce 24 | { 25 | 26 | WaitableEvent::WaitableEvent (bool manualReset) noexcept 27 | : useManualReset (manualReset) 28 | { 29 | } 30 | 31 | bool WaitableEvent::wait (double timeOutMilliseconds) const 32 | { 33 | std::unique_lock lock (mutex); 34 | 35 | if (! triggered) 36 | { 37 | if (timeOutMilliseconds < 0.0) 38 | { 39 | condition.wait (lock, [this] { return triggered == true; }); 40 | } 41 | else 42 | { 43 | if (! condition.wait_for (lock, std::chrono::duration { timeOutMilliseconds }, 44 | [this] { return triggered == true; })) 45 | { 46 | return false; 47 | } 48 | } 49 | } 50 | 51 | if (! useManualReset) 52 | reset(); 53 | 54 | return true; 55 | } 56 | 57 | void WaitableEvent::signal() const 58 | { 59 | std::lock_guard lock (mutex); 60 | 61 | triggered = true; 62 | condition.notify_all(); 63 | } 64 | 65 | void WaitableEvent::reset() const 66 | { 67 | triggered = false; 68 | } 69 | 70 | } // namespace juce 71 | -------------------------------------------------------------------------------- /JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ChannelCountConverter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "FlowGraphNode.h" 19 | #include "ChannelCountConverter.h" 20 | 21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; 22 | 23 | ChannelCountConverter::ChannelCountConverter( 24 | int32_t inputChannelCount, 25 | int32_t outputChannelCount) 26 | : input(*this, inputChannelCount) 27 | , output(*this, outputChannelCount) { 28 | } 29 | 30 | ChannelCountConverter::~ChannelCountConverter() = default; 31 | 32 | int32_t ChannelCountConverter::onProcess(int32_t numFrames) { 33 | const float *inputBuffer = input.getBuffer(); 34 | float *outputBuffer = output.getBuffer(); 35 | int32_t inputChannelCount = input.getSamplesPerFrame(); 36 | int32_t outputChannelCount = output.getSamplesPerFrame(); 37 | for (int i = 0; i < numFrames; i++) { 38 | int inputChannel = 0; 39 | for (int outputChannel = 0; outputChannel < outputChannelCount; outputChannel++) { 40 | // Copy input channels to output channels. 41 | // Wrap if we run out of inputs. 42 | // Discard if we run out of outputs. 43 | outputBuffer[outputChannel] = inputBuffer[inputChannel]; 44 | inputChannel = (inputChannel == inputChannelCount) 45 | ? 0 : inputChannel + 1; 46 | } 47 | inputBuffer += inputChannelCount; 48 | outputBuffer += outputChannelCount; 49 | } 50 | return numFrames; 51 | } 52 | 53 | --------------------------------------------------------------------------------