├── .clang-format ├── .clangd ├── .cmake-format.json ├── .github └── workflows │ ├── build_and_test.yml │ └── release_generator.yml ├── .gitignore ├── .vscode └── launch.json ├── CMakeLists.txt ├── LICENSE ├── README.md ├── RELEASE.md ├── code ├── common │ ├── audio_data.cpp │ ├── audio_data.h │ ├── audio_duration.cpp │ ├── audio_duration.h │ ├── audio_file_io.cpp │ ├── audio_file_io.h │ ├── audio_files.cpp │ ├── audio_files.h │ ├── backup.cpp │ ├── backup.h │ ├── common.cpp │ ├── common.h │ ├── defer.h │ ├── defs.h │ ├── drwav_tests.cpp │ ├── edit_tracked_audio_file.h │ ├── expected_midi_pitch.cpp │ ├── expected_midi_pitch.h │ ├── filepath_set.cpp │ ├── filepath_set.h │ ├── filter.cpp │ ├── filter.h │ ├── flac_decoder.h │ ├── gain_calculators.cpp │ ├── gain_calculators.h │ ├── identical_processing_set.cpp │ ├── identical_processing_set.h │ ├── metadata.h │ ├── midi_pitches.cpp │ ├── midi_pitches.h │ ├── string_utils.cpp │ ├── string_utils.h │ └── types.h ├── signet │ ├── cli_formatter.h │ ├── command.h │ ├── commands │ │ ├── add_loop │ │ │ ├── add_loop.cpp │ │ │ └── add_loop.h │ │ ├── auto_tune │ │ │ ├── auto_tune.cpp │ │ │ └── auto_tune.h │ │ ├── convert │ │ │ ├── convert.cpp │ │ │ └── convert.h │ │ ├── detect_pitch │ │ │ ├── detect_pitch.cpp │ │ │ └── detect_pitch.h │ │ ├── embed_sampler_info │ │ │ ├── embed_sampler_info.cpp │ │ │ └── embed_sampler_info.h │ │ ├── fade │ │ │ ├── fade.cpp │ │ │ └── fade.h │ │ ├── filter │ │ │ ├── filters.cpp │ │ │ └── filters.h │ │ ├── fix_pitch_drift │ │ │ ├── fix_pitch_drift_command.cpp │ │ │ ├── fix_pitch_drift_command.h │ │ │ ├── pitch_drift_corrector.cpp │ │ │ └── pitch_drift_corrector.h │ │ ├── folderise │ │ │ ├── folderise.cpp │ │ │ └── folderise.h │ │ ├── gain │ │ │ ├── gain.cpp │ │ │ └── gain.h │ │ ├── move │ │ │ ├── move.cpp │ │ │ └── move.h │ │ ├── normalise │ │ │ ├── normalise.cpp │ │ │ └── normalise.h │ │ ├── pan │ │ │ ├── pan.cpp │ │ │ └── pan.h │ │ ├── print_info │ │ │ ├── print_info.cpp │ │ │ └── print_info.h │ │ ├── rename │ │ │ ├── auto_mapper.cpp │ │ │ ├── auto_mapper.h │ │ │ ├── note_to_midi.cpp │ │ │ ├── note_to_midi.h │ │ │ ├── rename.cpp │ │ │ ├── rename.h │ │ │ ├── rename_substitutions.cpp │ │ │ └── rename_substitutions.h │ │ ├── reverse │ │ │ ├── reverse.cpp │ │ │ └── reverse.h │ │ ├── sample_blend │ │ │ ├── sample_blend.cpp │ │ │ └── sample_blend.h │ │ ├── seamless_loop │ │ │ ├── seamless_loop.cpp │ │ │ └── seamless_loop.h │ │ ├── trim │ │ │ ├── trim.cpp │ │ │ └── trim.h │ │ ├── trim_silence │ │ │ ├── remove_silence.cpp │ │ │ ├── trim_silence.cpp │ │ │ └── trim_silence.h │ │ ├── tune │ │ │ ├── tune.cpp │ │ │ └── tune.h │ │ └── zcross_offset │ │ │ ├── zcross_offset.cpp │ │ │ └── zcross_offset.h │ ├── signet_interface.cpp │ ├── signet_interface.h │ ├── signet_main.cpp │ └── version.h.in ├── tests │ ├── test_helpers.cpp │ ├── test_helpers.h │ ├── tests_config.h.in │ └── tests_main.cpp └── third_party_libs │ ├── CLI11.hpp │ ├── CLI11_Fwd.hpp │ ├── FLAC │ ├── all.h │ ├── assert.h │ ├── callback.h │ ├── export.h │ ├── format.h │ ├── metadata.h │ ├── ordinals.h │ ├── src │ │ ├── bitmath.c │ │ ├── bitreader.c │ │ ├── bitwriter.c │ │ ├── cpu.c │ │ ├── crc.c │ │ ├── fixed.c │ │ ├── fixed_intrin_sse2.c │ │ ├── fixed_intrin_ssse3.c │ │ ├── float.c │ │ ├── format.c │ │ ├── ia32 │ │ │ ├── cpu_asm.nasm │ │ │ ├── fixed_asm.nasm │ │ │ ├── lpc_asm.nasm │ │ │ └── nasm.h │ │ ├── include │ │ │ ├── private │ │ │ │ ├── all.h │ │ │ │ ├── bitmath.h │ │ │ │ ├── bitreader.h │ │ │ │ ├── bitwriter.h │ │ │ │ ├── cpu.h │ │ │ │ ├── crc.h │ │ │ │ ├── fixed.h │ │ │ │ ├── float.h │ │ │ │ ├── format.h │ │ │ │ ├── lpc.h │ │ │ │ ├── macros.h │ │ │ │ ├── md5.h │ │ │ │ ├── memory.h │ │ │ │ ├── metadata.h │ │ │ │ ├── ogg_decoder_aspect.h │ │ │ │ ├── ogg_encoder_aspect.h │ │ │ │ ├── ogg_helper.h │ │ │ │ ├── ogg_mapping.h │ │ │ │ ├── stream_encoder.h │ │ │ │ ├── stream_encoder_framing.h │ │ │ │ └── window.h │ │ │ ├── protected │ │ │ │ ├── all.h │ │ │ │ ├── stream_decoder.h │ │ │ │ └── stream_encoder.h │ │ │ └── share │ │ │ │ ├── alloc.h │ │ │ │ ├── compat.h │ │ │ │ ├── endswap.h │ │ │ │ ├── getopt.h │ │ │ │ ├── macros.h │ │ │ │ ├── private.h │ │ │ │ ├── safe_str.h │ │ │ │ ├── utf8.h │ │ │ │ └── win_utf8_io.h │ │ ├── lpc.c │ │ ├── lpc_intrin_avx2.c │ │ ├── lpc_intrin_sse.c │ │ ├── lpc_intrin_sse2.c │ │ ├── lpc_intrin_sse41.c │ │ ├── md5.c │ │ ├── memory.c │ │ ├── metadata_iterators.c │ │ ├── metadata_object.c │ │ ├── ogg_decoder_aspect.c │ │ ├── ogg_encoder_aspect.c │ │ ├── ogg_helper.c │ │ ├── ogg_mapping.c │ │ ├── stream_decoder.c │ │ ├── stream_encoder.c │ │ ├── stream_encoder_framing.c │ │ ├── stream_encoder_intrin_avx2.c │ │ ├── stream_encoder_intrin_sse2.c │ │ ├── stream_encoder_intrin_ssse3.c │ │ ├── win_utf8_io.c │ │ └── window.c │ ├── stream_decoder.h │ └── stream_encoder.h │ ├── backward.cpp │ ├── backward.hpp │ ├── cereal │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ └── include │ │ └── cereal │ │ ├── access.hpp │ │ ├── archives │ │ ├── adapters.hpp │ │ ├── binary.hpp │ │ ├── json.hpp │ │ ├── portable_binary.hpp │ │ └── xml.hpp │ │ ├── cereal.hpp │ │ ├── details │ │ ├── helpers.hpp │ │ ├── polymorphic_impl.hpp │ │ ├── polymorphic_impl_fwd.hpp │ │ ├── static_object.hpp │ │ ├── traits.hpp │ │ └── util.hpp │ │ ├── external │ │ ├── base64.hpp │ │ ├── rapidjson │ │ │ ├── allocators.h │ │ │ ├── cursorstreamwrapper.h │ │ │ ├── document.h │ │ │ ├── encodedstream.h │ │ │ ├── encodings.h │ │ │ ├── error │ │ │ │ ├── en.h │ │ │ │ └── error.h │ │ │ ├── filereadstream.h │ │ │ ├── filewritestream.h │ │ │ ├── fwd.h │ │ │ ├── internal │ │ │ │ ├── biginteger.h │ │ │ │ ├── diyfp.h │ │ │ │ ├── dtoa.h │ │ │ │ ├── ieee754.h │ │ │ │ ├── itoa.h │ │ │ │ ├── meta.h │ │ │ │ ├── pow10.h │ │ │ │ ├── regex.h │ │ │ │ ├── stack.h │ │ │ │ ├── strfunc.h │ │ │ │ ├── strtod.h │ │ │ │ └── swap.h │ │ │ ├── istreamwrapper.h │ │ │ ├── memorybuffer.h │ │ │ ├── memorystream.h │ │ │ ├── msinttypes │ │ │ │ ├── inttypes.h │ │ │ │ └── stdint.h │ │ │ ├── ostreamwrapper.h │ │ │ ├── pointer.h │ │ │ ├── prettywriter.h │ │ │ ├── rapidjson.h │ │ │ ├── reader.h │ │ │ ├── schema.h │ │ │ ├── stream.h │ │ │ ├── stringbuffer.h │ │ │ └── writer.h │ │ └── rapidxml │ │ │ ├── license.txt │ │ │ ├── manual.html │ │ │ ├── rapidxml.hpp │ │ │ ├── rapidxml_iterators.hpp │ │ │ ├── rapidxml_print.hpp │ │ │ └── rapidxml_utils.hpp │ │ ├── macros.hpp │ │ ├── specialize.hpp │ │ ├── types │ │ ├── array.hpp │ │ ├── atomic.hpp │ │ ├── base_class.hpp │ │ ├── bitset.hpp │ │ ├── boost_variant.hpp │ │ ├── chrono.hpp │ │ ├── common.hpp │ │ ├── complex.hpp │ │ ├── concepts │ │ │ └── pair_associative_container.hpp │ │ ├── deque.hpp │ │ ├── forward_list.hpp │ │ ├── functional.hpp │ │ ├── list.hpp │ │ ├── map.hpp │ │ ├── memory.hpp │ │ ├── optional.hpp │ │ ├── polymorphic.hpp │ │ ├── queue.hpp │ │ ├── set.hpp │ │ ├── stack.hpp │ │ ├── string.hpp │ │ ├── tuple.hpp │ │ ├── unordered_map.hpp │ │ ├── unordered_set.hpp │ │ ├── utility.hpp │ │ ├── valarray.hpp │ │ ├── variant.hpp │ │ └── vector.hpp │ │ └── version.hpp │ ├── doctest.hpp │ ├── dr_wav.h │ ├── dywapitchtrack │ ├── DOCUMENTATION.txt │ ├── README.txt │ ├── dywapitchtrack.c │ └── dywapitchtrack.h │ ├── filesystem.hpp │ ├── filesystem_ghc.hpp │ ├── fmt │ ├── CMakeLists.txt │ ├── ChangeLog.rst │ ├── LICENSE.rst │ ├── README.rst │ ├── include │ │ └── fmt │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── compile.h │ │ │ ├── core.h │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── os.h │ │ │ ├── ostream.h │ │ │ ├── posix.h │ │ │ ├── printf.h │ │ │ └── ranges.h │ ├── src │ │ ├── format.cc │ │ └── os.cc │ └── support │ │ ├── Android.mk │ │ ├── AndroidManifest.xml │ │ ├── C++.sublime-syntax │ │ ├── README │ │ ├── Vagrantfile │ │ ├── appveyor-build.py │ │ ├── appveyor.yml │ │ ├── build.gradle │ │ ├── cmake │ │ ├── FindSetEnv.cmake │ │ ├── JoinPaths.cmake │ │ ├── cxx14.cmake │ │ ├── fmt-config.cmake.in │ │ └── fmt.pc.in │ │ ├── compute-powers.py │ │ ├── docopt.py │ │ ├── manage.py │ │ ├── rst2md.py │ │ ├── rtd │ │ ├── conf.py │ │ ├── index.rst │ │ └── theme │ │ │ ├── layout.html │ │ │ └── theme.conf │ │ └── travis-build.py │ ├── json.hpp │ ├── magic_enum.hpp │ ├── r8brain-resampler │ ├── CDSPBlockConvolver.h │ ├── CDSPFIRFilter.h │ ├── CDSPFracInterpolator.h │ ├── CDSPHBDownsampler.h │ ├── CDSPHBUpsampler.h │ ├── CDSPProcessor.h │ ├── CDSPRealFFT.h │ ├── CDSPResampler.h │ ├── CDSPSincFilterGen.h │ ├── LICENSE │ ├── fft4g.h │ ├── r8bbase.cpp │ ├── r8bbase.h │ ├── r8bconf.h │ └── r8butil.h │ └── span.hpp ├── docs └── usage.md ├── flake.lock ├── flake.nix ├── justfile ├── signet.sublime-project ├── signet_win32.manifest └── test_data ├── flac_with_comments.flac ├── sawtooth_unlooped.flac ├── test.flac ├── test.wav ├── test_192khz_24bit.wav ├── test_96khz_24bit.wav ├── wav_metadata_80bpm_5-4_time_sig.wav ├── wav_with_bext.wav ├── wav_with_region_and_marker.wav ├── wave_with_markers_and_loop.wav ├── white-noise-16-bit-44100-1ch.aif ├── white-noise-24-bit-44100-2ch.aif ├── white-noise-8-bit-96000-1ch.aif └── white-noise.wav /.clang-format: -------------------------------------------------------------------------------- 1 | AlignAfterOpenBracket: Align 2 | AlignOperands: true 3 | AlignTrailingComments: false 4 | AllowAllParametersOfDeclarationOnNextLine: false 5 | AllowShortBlocksOnASingleLine: false 6 | AllowShortCaseLabelsOnASingleLine: true 7 | AllowShortFunctionsOnASingleLine: All 8 | AllowShortIfStatementsOnASingleLine: true 9 | AllowShortLoopsOnASingleLine: false 10 | AlwaysBreakTemplateDeclarations: true 11 | BinPackArguments: true 12 | BinPackParameters: false 13 | BreakBeforeBraces: Attach 14 | BreakConstructorInitializersBeforeComma: true 15 | BreakStringLiterals: false 16 | ColumnLimit: 110 17 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 18 | IndentCaseLabels: true 19 | IndentWidth: 4 20 | PointerAlignment: Right 21 | SortIncludes: true 22 | SpaceAfterCStyleCast: false 23 | SpaceBeforeCpp11BracedList: true 24 | SpacesInParentheses: false 25 | TabWidth: 4 26 | UseTab: Never 27 | IndentPPDirectives: None 28 | -------------------------------------------------------------------------------- /.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | CompilationDatabase: build # Extra search path for compile_commands.json 3 | -------------------------------------------------------------------------------- /.cmake-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "tab_size": 4, 3 | "line_width": 110, 4 | "autosort": true, 5 | "separate_ctrl_name_with_space": true, 6 | "dangle_parens": false 7 | } 8 | 9 | -------------------------------------------------------------------------------- /.github/workflows/build_and_test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: [push] 4 | 5 | env: 6 | CMAKE_BUILD_TYPE: Debug 7 | 8 | jobs: 9 | build: 10 | runs-on: ${{ matrix.os }} 11 | strategy: 12 | matrix: 13 | os: [windows-latest, macos-latest, ubuntu-latest] 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | 18 | - name: Get required GCC version 19 | if: matrix.os == 'ubuntu-latest' 20 | shell: bash 21 | run: sudo apt install gcc-9 g++-9 22 | 23 | - name: Create Build Environment 24 | run: cmake -E make_directory ${{github.workspace}}/build 25 | 26 | - name: Configure CMake Using Default Compiler 27 | if: matrix.os != 'ubuntu-latest' 28 | shell: bash 29 | working-directory: ${{github.workspace}}/build 30 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DENABLE_SANITIZERS:BOOL=YES 31 | 32 | - name: Configure CMake Using GCC 33 | if: matrix.os == 'ubuntu-latest' 34 | shell: bash 35 | working-directory: ${{github.workspace}}/build 36 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DENABLE_SANITIZERS:BOOL=YES 37 | env: 38 | CC: gcc-9 39 | CXX: g++-9 40 | 41 | - name: Build 42 | working-directory: ${{github.workspace}}/build 43 | shell: bash 44 | run: cmake --build . --config $CMAKE_BUILD_TYPE --target tests 45 | 46 | - name: Test 47 | working-directory: ${{github.workspace}}/build 48 | shell: bash 49 | run: ctest -C $CMAKE_BUILD_TYPE --output-on-failure 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .cache/ 3 | *.sublime-workspace 4 | *.DS_Store 5 | *.reapeaks 6 | tests_config.h 7 | .vscode/c_cpp_properties.json 8 | .vscode/settings.json 9 | code/signet/version.h 10 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "lldb", 6 | "request": "launch", 7 | "name": "Tests", 8 | "runInTerminal": true, 9 | "program": "build/tests" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Sam Windell 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /code/common/audio_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "FLAC/metadata.h" 7 | 8 | #include "common.h" 9 | #include "metadata.h" 10 | #include "types.h" 11 | 12 | enum class AudioFileFormat { 13 | Wav, 14 | Flac, 15 | }; 16 | 17 | bool ApproxEqual(double a, double b, double epsilon); 18 | 19 | struct AudioData { 20 | std::vector interleaved_samples {}; 21 | unsigned num_channels {}; 22 | unsigned sample_rate {}; 23 | unsigned bits_per_sample = 24; 24 | AudioFileFormat format {AudioFileFormat::Wav}; 25 | 26 | Metadata metadata {}; 27 | 28 | // We store these file-format-specific bits of metadata because not all types of metadata are handled by 29 | // the generic Metadata struct and therefore it still might contain data that we want to write back to the 30 | // file. 31 | WaveMetadata wave_metadata {}; 32 | std::vector> flac_metadata {}; 33 | 34 | // 35 | // 36 | bool IsEmpty() const { return interleaved_samples.empty(); } 37 | size_t NumFrames() const; 38 | double &GetSample(unsigned channel, size_t frame); 39 | const double &GetSample(unsigned channel, size_t frame) const; 40 | 41 | // 42 | // 43 | void MultiplyByScalar(const double amount); 44 | void MultiplyByScalar(unsigned channel, const double amount); 45 | void AddOther(const AudioData &other); 46 | void Resample(double new_sample_rate); 47 | void ChangePitch(double cents); 48 | std::optional DetectPitch() const; 49 | bool IsSilent() const; 50 | 51 | std::vector MixDownToMono() const; 52 | 53 | // 54 | // 55 | void FramesWereRemovedFromStart(size_t num_frames); 56 | void FramesWereRemovedFromEnd(); 57 | void AudioDataWasStretched(double stretch_factor); 58 | void AudioDataWasReversed(); 59 | 60 | private: 61 | void PrintMetadataRemovalWarning(std::string_view metadata_name); 62 | }; 63 | -------------------------------------------------------------------------------- /code/common/audio_duration.cpp: -------------------------------------------------------------------------------- 1 | #include "audio_duration.h" 2 | 3 | #include "doctest.hpp" 4 | 5 | TEST_CASE("Audio Duration") { 6 | SUBCASE("validation") { 7 | REQUIRE_NOTHROW(AudioDuration("100smp")); 8 | REQUIRE_NOTHROW(AudioDuration("100s")); 9 | REQUIRE_NOTHROW(AudioDuration("100ms")); 10 | REQUIRE_NOTHROW(AudioDuration("100%")); 11 | REQUIRE_NOTHROW(AudioDuration("-10%")); 12 | REQUIRE_NOTHROW(AudioDuration("22.334%")); 13 | REQUIRE_THROWS(AudioDuration("foo")); 14 | 15 | REQUIRE(*AudioDuration::GetUnit("10") == AudioDuration::Unit::Samples); 16 | REQUIRE(*AudioDuration::GetUnit("10s") == AudioDuration::Unit::Seconds); 17 | REQUIRE(*AudioDuration::GetUnit("10ms") == AudioDuration::Unit::Milliseconds); 18 | REQUIRE(*AudioDuration::GetUnit("10smp") == AudioDuration::Unit::Samples); 19 | REQUIRE(*AudioDuration::GetUnit("10%") == AudioDuration::Unit::Percent); 20 | } 21 | 22 | SUBCASE("constructors") { 23 | AudioDuration value_init {AudioDuration::Unit::Seconds, 100}; 24 | AudioDuration string_init {"100s"}; 25 | REQUIRE(value_init == string_init); 26 | } 27 | 28 | SUBCASE("values") { 29 | SUBCASE("samples") { 30 | AudioDuration a {AudioDuration::Unit::Samples, 10}; 31 | REQUIRE(a.GetDurationAsFrames(44100, 100) == 10); 32 | } 33 | 34 | SUBCASE("seconds") { 35 | AudioDuration a {AudioDuration::Unit::Seconds, 1}; 36 | REQUIRE(a.GetDurationAsFrames(44100, 44100) == 44100); 37 | } 38 | 39 | SUBCASE("milliseconds") { 40 | AudioDuration a {AudioDuration::Unit::Milliseconds, 1000}; 41 | REQUIRE(a.GetDurationAsFrames(44100, 44100) == 44100); 42 | } 43 | 44 | SUBCASE("percent") { 45 | AudioDuration a {AudioDuration::Unit::Percent, 10}; 46 | REQUIRE(a.GetDurationAsFrames(44100, 100) == 10); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /code/common/audio_file_io.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "filesystem.hpp" 5 | 6 | #include "audio_data.h" 7 | 8 | std::optional ReadAudioFile(const fs::path &filename); 9 | bool WriteAudioFile(const fs::path &filename, 10 | const AudioData &audio_data, 11 | const std::optional new_bits_per_sample = {}); 12 | 13 | bool CanFileBeConvertedToBitDepth(AudioFileFormat file, unsigned bit_depth); 14 | bool IsPathReadableAudioFile(const fs::path &path); 15 | std::string GetLowercaseExtension(AudioFileFormat file); 16 | -------------------------------------------------------------------------------- /code/common/audio_files.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "edit_tracked_audio_file.h" 5 | #include "types.h" 6 | 7 | class SignetBackup; 8 | class FilepathSet; 9 | 10 | class AudioFiles { 11 | public: 12 | AudioFiles() {} 13 | 14 | // Passes path_items to FilepathSet to construct the list of audio files 15 | AudioFiles(const std::vector &path_items, const bool recursive_directory_search); 16 | 17 | // Simply copies the EditTrackedAudioFile 18 | AudioFiles(const tcb::span files); 19 | 20 | // 21 | // Files are typically read from the underlying vector with these methods. 22 | // 23 | usize Size() const { return m_all_files.size(); } 24 | const auto &Files() { return m_all_files; } 25 | 26 | auto begin() { return m_all_files.begin(); } 27 | auto end() { return m_all_files.end(); } 28 | auto begin() const { return m_all_files.begin(); } 29 | auto end() const { return m_all_files.end(); } 30 | EditTrackedAudioFile &operator[](size_t index) { return m_all_files[index]; } 31 | 32 | // 33 | // You can also get a std::map of the same files based on what folder each file is in. For example 34 | // Folders()["my-folder"] would return a vector of all of the files in the folder with the name 35 | // "my-folder". 36 | // 37 | const auto &Folders() { return m_folders; } 38 | 39 | // 40 | // 41 | bool WriteFilesThatHaveBeenEdited(SignetBackup &backup, bool create_copies); 42 | int GetNumFilesProcessed() const { 43 | int n = 0; 44 | for (const auto &f : m_all_files) { 45 | if (f.AudioChanged() || f.PathChanged() || f.FormatChanged()) { 46 | n++; 47 | } 48 | } 49 | return n; 50 | } 51 | 52 | private: 53 | void ReadAllAudioFiles(const FilepathSet &paths); 54 | bool WouldWritingAllFilesCreateConflicts(); 55 | void CreateFoldersDataStructure(); 56 | 57 | std::vector m_all_files {}; 58 | std::map> m_folders {}; 59 | }; 60 | -------------------------------------------------------------------------------- /code/common/backup.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "filesystem.hpp" 4 | #include "json.hpp" 5 | 6 | struct AudioData; 7 | 8 | class SignetBackup { 9 | public: 10 | SignetBackup(); 11 | bool LoadBackup(); 12 | void ClearBackup(); 13 | 14 | bool DeleteFile(const fs::path &path); 15 | bool MoveFile(const fs::path &from, const fs::path &to); 16 | bool CreateFile(const fs::path &path, const AudioData &data, bool create_directories); 17 | bool OverwriteFile(const fs::path &path, const AudioData &data); 18 | 19 | bool AddFileToBackup(const fs::path &path); 20 | 21 | private: 22 | bool AddMovedFileToBackup(const fs::path &from, const fs::path &to); 23 | bool AddNewlyCreatedFileToBackup(const fs::path &path); 24 | 25 | bool WriteDatabaseFile(); 26 | bool CreateBackupFilesDirIfNeeded(); 27 | 28 | void ClearOldBackIfNeeded(); 29 | 30 | bool m_old_backup_cleared {false}; 31 | fs::path m_database_file {}; 32 | fs::path m_backup_dir {}; 33 | fs::path m_backup_files_dir {}; 34 | nlohmann::json m_database {}; 35 | bool m_parsed_json {}; 36 | }; 37 | -------------------------------------------------------------------------------- /code/common/defer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Author: Jonathan Blow 3 | // Version: 1 4 | // Date: 31 August, 2018 5 | // 6 | // This code is released under the MIT license, which you can find at 7 | // 8 | // https://opensource.org/licenses/MIT 9 | // 10 | // 11 | // 12 | // See the comments for how to use this library just below the includes. 13 | // 14 | 15 | // See https://gist.github.com/andrewrk/ffb272748448174e6cdb4958dae9f3d8#file-microsoft_craziness-h for the 16 | // full source 17 | 18 | #pragma once 19 | 20 | // Example: defer { ReleaseResources(); }; 21 | 22 | #define CONCAT_INTERNAL(x, y) x##y 23 | #define CONCAT(x, y) CONCAT_INTERNAL(x, y) 24 | 25 | template 26 | struct ExitScope { 27 | T lambda; 28 | ExitScope(T lambda) : lambda(lambda) {} 29 | ~ExitScope() { lambda(); } 30 | ExitScope(const ExitScope &); 31 | 32 | private: 33 | ExitScope &operator=(const ExitScope &); 34 | }; 35 | 36 | class ExitScopeHelp { 37 | public: 38 | template 39 | ExitScope operator+(T t) { 40 | return t; 41 | } 42 | }; 43 | 44 | #define defer const auto &CONCAT(defer__, __LINE__) = ExitScopeHelp() + [&]() -------------------------------------------------------------------------------- /code/common/defs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class TargetOs { Windows, Mac, Linux }; 4 | constexpr TargetOs target_os = 5 | #if _WIN32 6 | TargetOs::Windows; 7 | #elif __APPLE__ 8 | TargetOs::Mac; 9 | #else 10 | TargetOs::Linux; 11 | #endif 12 | -------------------------------------------------------------------------------- /code/common/edit_tracked_audio_file.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "audio_file_io.h" 4 | #include "common.h" 5 | #include "string_utils.h" 6 | 7 | // Changes made to the data, path or format are tracked, and the data is only loaded when it is requested 8 | struct EditTrackedAudioFile { 9 | EditTrackedAudioFile(const fs::path &path) : m_path(path), m_original_path(path) {} 10 | 11 | AudioData &GetWritableAudio() { 12 | ++m_file_edited; 13 | return const_cast(GetAudio()); 14 | } 15 | 16 | const AudioData &GetAudio() { 17 | if (!m_file_loaded && m_file_valid) { 18 | if (const auto data = ReadAudioFile(m_original_path)) { 19 | SetAudioData(*data); 20 | } else { 21 | ErrorWithNewLine("Signet", m_original_path, "could not load audio"); 22 | m_file_valid = false; 23 | } 24 | } 25 | return m_data; 26 | } 27 | 28 | const fs::path &GetPath() const { return m_path; } 29 | 30 | void SetPath(const fs::path &path) { 31 | ++m_path_edited; 32 | m_path = path; 33 | } 34 | 35 | bool AudioChanged() const { return m_file_edited && m_file_valid; } 36 | bool PathChanged() const { return m_path_edited; } 37 | bool FormatChanged() const { return m_file_loaded && m_original_file_format != m_data.format; } 38 | 39 | void SetAudioData(const AudioData &data) { 40 | m_data = data; 41 | m_original_file_format = m_data.format; 42 | m_file_loaded = true; 43 | } 44 | 45 | int NumTimesAudioChanged() const { return m_file_edited; } 46 | int NumTimesPathChanged() const { return m_path_edited; } 47 | 48 | const fs::path &OriginalPath() const { return m_original_path; } 49 | std::string OriginalFilename() const { return GetJustFilenameWithNoExtension(OriginalPath()); } 50 | 51 | private: 52 | AudioFileFormat m_original_file_format {}; 53 | fs::path m_path {}; 54 | AudioData m_data {}; 55 | bool m_file_loaded = false; 56 | bool m_file_valid = true; 57 | 58 | int m_file_edited = 0; 59 | int m_path_edited = 0; 60 | 61 | fs::path m_original_path; 62 | }; 63 | -------------------------------------------------------------------------------- /code/common/expected_midi_pitch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "CLI11_Fwd.hpp" 7 | #include "midi_pitches.h" 8 | 9 | struct EditTrackedAudioFile; 10 | 11 | class ExpectedMidiPitch { 12 | public: 13 | void AddCli(CLI::App &command, bool accept_any_octave); 14 | std::optional GetExpectedMidiPitch(const std::string &command_name, EditTrackedAudioFile &f); 15 | 16 | private: 17 | std::optional m_expected_note_capture {}; 18 | int m_expected_note_capture_midi_zero_octave {-1}; 19 | }; -------------------------------------------------------------------------------- /code/common/filepath_set.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "filesystem.hpp" 11 | #include "span.hpp" 12 | 13 | class FilepathSet { 14 | public: 15 | // Creates a FilepathSet from a vector of glob patterns, filenames, or directories. 16 | // Each part can start with a - to signify that the result should exclude anything that matches it. 17 | // e.g. ["*.wav", "file.flac", "-foo*"] 18 | static std::optional CreateFromPatterns(const std::vector &parts, 19 | bool recursive_directory_search, 20 | std::string *error = nullptr); 21 | 22 | auto Size() const { return m_filepaths.size(); } 23 | 24 | auto begin() { return m_filepaths.begin(); } 25 | auto end() { return m_filepaths.end(); } 26 | auto begin() const { return m_filepaths.begin(); } 27 | auto end() const { return m_filepaths.end(); } 28 | 29 | private: 30 | FilepathSet() {} 31 | void AddNonExcludedPaths(const tcb::span paths, 32 | const std::vector &exclude_patterns); 33 | void Add(const fs::path &path) { m_filepaths.insert(fs::canonical(path)); } 34 | void Add(const std::vector &paths) { 35 | for (const auto &p : paths) { 36 | Add(p); 37 | } 38 | } 39 | 40 | std::set m_filepaths {}; 41 | }; 42 | -------------------------------------------------------------------------------- /code/common/filter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Filter { 4 | 5 | struct Data { 6 | double out1 = 0, out2 = 0, in1 = 0, in2 = 0; 7 | }; 8 | 9 | struct Coeffs { 10 | double b0 = 0, b1 = 0, b2 = 0, a1 = 0, a2 = 0; 11 | }; 12 | 13 | static constexpr double default_q_factor = 0.70710678118; // sqrt(2)/2 14 | 15 | struct Params { 16 | int type = 0; 17 | double sample_rate = 44100; 18 | double cutoff_freq = 10000; 19 | double Q = default_q_factor; 20 | double peak_gain = 0; 21 | bool q_is_bandwidth = false; 22 | }; 23 | 24 | enum class Type { 25 | Biquad, 26 | RBJ, 27 | }; 28 | 29 | enum class BiquadType { 30 | LowPass, 31 | HighPass, 32 | BandPass, 33 | Notch, 34 | Peak, 35 | LowShelf, 36 | HighShelf, 37 | }; 38 | 39 | enum class RBJType { 40 | LowPass, 41 | HighPass, 42 | BandPassCSG, 43 | BandPassCZPG, 44 | Notch, 45 | AllPass, 46 | Peaking, 47 | LowShelf, 48 | HighShelf, 49 | }; 50 | 51 | void SetParamsAndCoeffs(Type filter_type, 52 | Params &b, 53 | Coeffs &c, 54 | int type, 55 | double sample_rate, 56 | double cutoff_freq, 57 | double Q, 58 | double gain_db); 59 | 60 | double Process(Data &d, const Coeffs &c, const double in); 61 | 62 | } // namespace Filter 63 | -------------------------------------------------------------------------------- /code/common/gain_calculators.cpp: -------------------------------------------------------------------------------- 1 | #include "gain_calculators.h" 2 | 3 | #include 4 | 5 | #include "doctest.hpp" 6 | #include "test_helpers.h" 7 | 8 | void NormaliseToTarget(AudioData &audio, const double target_amp) { 9 | PeakGainCalculator calc {}; 10 | calc.RegisterBufferMagnitudes(audio, {}); 11 | const auto gain = calc.GetGain(target_amp); 12 | audio.MultiplyByScalar(gain); 13 | } 14 | 15 | void NormaliseToTarget(std::vector &samples, const double target_amp) { 16 | AudioData audio {}; 17 | audio.interleaved_samples = std::move(samples); 18 | audio.num_channels = 1; 19 | NormaliseToTarget(audio, target_amp); 20 | samples = std::move(audio.interleaved_samples); 21 | } 22 | 23 | double GetRMS(const tcb::span samples) { 24 | if (!samples.size()) return 0; 25 | double result = 0; 26 | for (const auto s : samples) { 27 | result += s * s; 28 | } 29 | result /= samples.size(); 30 | REQUIRE(result >= 0); 31 | return std::sqrt(result); 32 | } 33 | 34 | double GetPeak(const tcb::span samples) { 35 | if (!samples.size()) return 0; 36 | double result = 0; 37 | for (const auto s : samples) { 38 | result = std::max(result, std::abs(s)); 39 | } 40 | return result; 41 | } 42 | 43 | TEST_CASE_TEMPLATE("[NormaliseCommand] gain calcs", T, RMSGainCalculator, PeakGainCalculator) { 44 | T calc; 45 | INFO(calc.GetName()); 46 | auto buf = TestHelpers::CreateSingleOscillationSineWave(1, 44100, 100); 47 | 48 | SUBCASE("full volume sample with full volume target") { 49 | calc.RegisterBufferMagnitudes(buf, {}); 50 | const auto magnitude = calc.GetLargestRegisteredMagnitude(); 51 | REQUIRE(calc.GetGain(magnitude) == doctest::Approx(1.0)); 52 | 53 | SUBCASE("mulitple buffers") { 54 | for (int i = 0; i < 10; ++i) { 55 | calc.RegisterBufferMagnitudes(buf, {}); 56 | } 57 | REQUIRE(calc.GetGain(magnitude) == doctest::Approx(1.0)); 58 | } 59 | } 60 | 61 | SUBCASE("half volume sample with full volume target") { 62 | for (auto &s : buf.interleaved_samples) { 63 | s *= 0.5; 64 | } 65 | calc.RegisterBufferMagnitudes(buf, {}); 66 | const auto magnitude = calc.GetLargestRegisteredMagnitude(); 67 | REQUIRE(calc.GetGain(magnitude * 2) == doctest::Approx(2.0)); 68 | } 69 | 70 | SUBCASE("full volume sample with half volume target") { 71 | for (int i = 0; i < 10; ++i) { 72 | calc.RegisterBufferMagnitudes(buf, {}); 73 | const auto magnitude = calc.GetLargestRegisteredMagnitude(); 74 | REQUIRE(calc.GetGain(magnitude / 2) == doctest::Approx(0.5)); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /code/common/identical_processing_set.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "CLI11_Fwd.hpp" 7 | 8 | #include "audio_files.h" 9 | #include "edit_tracked_audio_file.h" 10 | 11 | class IdenticalProcessingSet { 12 | public: 13 | void AddCli(CLI::App &command); 14 | bool ShouldProcessInSets() const { return !m_sample_set_args.empty(); } 15 | void ProcessSets(AudioFiles &files, 16 | std::string_view command_name, 17 | const std::function &set)> &callback); 19 | 20 | static bool AllHaveSameNumFrames(const std::vector &set); 21 | 22 | private: 23 | std::vector m_sample_set_args; 24 | }; 25 | -------------------------------------------------------------------------------- /code/common/midi_pitches.cpp: -------------------------------------------------------------------------------- 1 | #include "midi_pitches.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "doctest.hpp" 7 | 8 | MIDIPitch FindClosestMidiPitch(const double freq) { 9 | double min_distance = DBL_MAX; 10 | size_t min_index = (size_t)-1; 11 | for (size_t i = 0; i < std::size(g_midi_pitches); ++i) { 12 | const double delta = std::abs(freq - g_midi_pitches[i].pitch); 13 | if (delta < min_distance) { 14 | min_distance = delta; 15 | min_index = i; 16 | } 17 | } 18 | REQUIRE(min_index != (size_t)-1); 19 | 20 | return g_midi_pitches[min_index]; 21 | } 22 | 23 | int ScaleByOctavesToBeNearestToMiddleC(int midi_note) { 24 | constexpr int middle_c = 60; 25 | const auto pitch_index = midi_note % 12; 26 | if (pitch_index < 6) return middle_c + pitch_index; 27 | return middle_c - (12 - pitch_index); 28 | } 29 | 30 | TEST_CASE("Midi pitches") { 31 | REQUIRE(FindClosestMidiPitch(0).midi_note == 0); 32 | REQUIRE(FindClosestMidiPitch(440).midi_note == 69); 33 | REQUIRE(FindClosestMidiPitch(439).midi_note == 69); 34 | REQUIRE(FindClosestMidiPitch(441).midi_note == 69); 35 | REQUIRE(FindClosestMidiPitch(1566.55).midi_note == 91); 36 | REQUIRE(FindClosestMidiPitch(999999999).midi_note == 127); 37 | 38 | REQUIRE(ScaleByOctavesToBeNearestToMiddleC(1) == 61); 39 | REQUIRE(ScaleByOctavesToBeNearestToMiddleC(13) == 61); 40 | REQUIRE(ScaleByOctavesToBeNearestToMiddleC(25) == 61); 41 | REQUIRE(ScaleByOctavesToBeNearestToMiddleC(11) == 59); 42 | } 43 | -------------------------------------------------------------------------------- /code/common/string_utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "defs.h" 8 | #include "filesystem.hpp" 9 | #include "types.h" 10 | 11 | bool EndsWith(std::string_view str, std::string_view suffix); 12 | bool StartsWith(std::string_view str, std::string_view prefix); 13 | bool Contains(std::string_view haystack, std::string_view needle); 14 | 15 | bool WildcardMatch(std::string_view pattern, 16 | std::string_view str, 17 | bool case_insensitive = target_os != TargetOs::Linux); 18 | 19 | bool RegexReplace(std::string &str, std::string pattern, std::string replacement); 20 | bool Replace(std::string &str, std::string_view a, std::string_view b); 21 | bool Replace(std::string &str, char a, char b); 22 | bool Remove(std::string &str, char c); 23 | 24 | void Lowercase(std::string &str); 25 | std::string TrimWhitespace(std::string_view str); 26 | std::string TrimWhitespaceFront(std::string_view str); 27 | std::string ToSnakeCase(std::string_view str); 28 | std::string ToCamelCase(std::string_view str); 29 | 30 | std::string PutNumberInAngleBracket(usize num); 31 | std::string WrapText(const std::string_view text, const unsigned width); 32 | std::string IndentText(const std::string_view text, usize num_indent_spaces); 33 | 34 | std::string GetJustFilenameWithNoExtension(fs::path path); 35 | std::vector 36 | Split(std::string_view str, std::string_view delim, bool include_empties = false); 37 | 38 | std::optional Get3CharAlphaIdentifier(unsigned counter); 39 | 40 | bool IsAbsoluteDirectory(std::string_view path); 41 | bool IsPathSyntacticallyCorrect(std::string_view path, std::string *error = nullptr); 42 | -------------------------------------------------------------------------------- /code/common/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using u8 = uint8_t; 5 | using s8 = int8_t; 6 | using u16 = uint16_t; 7 | using s16 = int16_t; 8 | using u32 = uint32_t; 9 | using s32 = int32_t; 10 | using u64 = uint64_t; 11 | using s64 = int64_t; 12 | using b8 = s8; 13 | using usize = size_t; 14 | -------------------------------------------------------------------------------- /code/signet/command.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "CLI11_Fwd.hpp" 5 | 6 | #include "audio_files.h" 7 | 8 | class SignetBackup; 9 | 10 | class Command { 11 | public: 12 | virtual ~Command() {} 13 | virtual CLI::App *CreateCommandCLI(CLI::App &app) = 0; 14 | virtual std::string GetName() const = 0; 15 | 16 | virtual bool AllowsOutputFolder() const { return true; } 17 | virtual bool AllowsSingleOutputFile() const { return true; } 18 | 19 | virtual void GenerateFiles(AudioFiles &, SignetBackup &) {} 20 | virtual void ProcessFiles(AudioFiles &) {} 21 | }; 22 | -------------------------------------------------------------------------------- /code/signet/commands/add_loop/add_loop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "audio_duration.h" 4 | #include "command.h" 5 | 6 | class AddLoopCommand final : public Command { 7 | public: 8 | CLI::App *CreateCommandCLI(CLI::App &app) override; 9 | void ProcessFiles(AudioFiles &files) override; 10 | std::string GetName() const override { return "AddLoop"; } 11 | 12 | private: 13 | AudioDuration m_start_point {AudioDuration::Unit::Samples, 0}; 14 | std::optional m_end_point {}; 15 | std::optional m_num_frames; 16 | std::optional m_loop_name; 17 | MetadataItems::LoopType m_loop_type = MetadataItems::LoopType::Forward; 18 | unsigned m_num_times_to_loop = 0; // 0 = infinite 19 | }; 20 | -------------------------------------------------------------------------------- /code/signet/commands/auto_tune/auto_tune.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | #include "expected_midi_pitch.h" 5 | #include "identical_processing_set.h" 6 | 7 | class AutoTuneCommand final : public Command { 8 | public: 9 | std::string GetName() const override { return "AutoTune"; } 10 | CLI::App *CreateCommandCLI(CLI::App &app) override; 11 | void ProcessFiles(AudioFiles &files) override; 12 | 13 | private: 14 | IdenticalProcessingSet m_identical_processing_set; 15 | ExpectedMidiPitch m_expected_midi_pitch; 16 | }; 17 | -------------------------------------------------------------------------------- /code/signet/commands/convert/convert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "audio_file_io.h" 4 | #include "signet_interface.h" 5 | 6 | class ConvertCommand final : public Command { 7 | public: 8 | CLI::App *CreateCommandCLI(CLI::App &app) override; 9 | void ProcessFiles(AudioFiles &files) override; 10 | std::string GetName() const override { return "Convert"; } 11 | 12 | private: 13 | bool m_files_can_be_converted {}; 14 | std::optional m_sample_rate {}; 15 | std::optional m_bit_depth {}; 16 | std::optional m_file_format {}; 17 | }; 18 | -------------------------------------------------------------------------------- /code/signet/commands/detect_pitch/detect_pitch.cpp: -------------------------------------------------------------------------------- 1 | #include "detect_pitch.h" 2 | 3 | #include "CLI11.hpp" 4 | #include "doctest.hpp" 5 | 6 | #include "audio_files.h" 7 | #include "common.h" 8 | #include "midi_pitches.h" 9 | 10 | CLI::App *DetectPitchCommand::CreateCommandCLI(CLI::App &app) { 11 | auto detect_pitch = app.add_subcommand("detect-pitch", "Prints out the detected pitch of the file(s)."); 12 | return detect_pitch; 13 | } 14 | 15 | void DetectPitchCommand::ProcessFiles(AudioFiles &files) { 16 | for (auto &f : files) { 17 | const auto pitch = f.GetAudio().DetectPitch(); 18 | if (pitch) { 19 | const auto closest_musical_note = FindClosestMidiPitch(*pitch); 20 | 21 | MessageWithNewLine(GetName(), f, "Detected pitch {:.2f} Hz ({:.1f} cents from {}, MIDI {})", 22 | *pitch, GetCentsDifference(closest_musical_note.pitch, *pitch), 23 | closest_musical_note.name, closest_musical_note.midi_note); 24 | } else { 25 | MessageWithNewLine(GetName(), f, "No pitch could be found"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /code/signet/commands/detect_pitch/detect_pitch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class DetectPitchCommand final : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "DetectPitch"; } 10 | }; 11 | -------------------------------------------------------------------------------- /code/signet/commands/embed_sampler_info/embed_sampler_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class EmbedSamplerInfo : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | 10 | std::string GetName() const override { return "Sample Info Embedder"; } 11 | 12 | private: 13 | bool m_remove_embedded_info {false}; 14 | 15 | std::optional m_root_number; 16 | std::optional m_root_regex_pattern; 17 | std::optional m_root_auto_detect_name; 18 | 19 | bool m_note_range_auto_map {}; 20 | std::optional m_low_note_number; 21 | std::optional m_low_note_regex_pattern; 22 | std::optional m_high_note_number; 23 | std::optional m_high_note_regex_pattern; 24 | 25 | std::optional m_low_velo_number; 26 | std::optional m_low_velo_regex_pattern; 27 | std::optional m_high_velo_number; 28 | std::optional m_high_velo_regex_pattern; 29 | }; 30 | -------------------------------------------------------------------------------- /code/signet/commands/fade/fade.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "audio_duration.h" 4 | #include "span.hpp" 5 | #include "command.h" 6 | 7 | class FadeCommand final : public Command { 8 | public: 9 | enum class Shape { Linear, Sine, SCurve, Log, Exp, Sqrt }; 10 | 11 | std::string GetName() const override { return "Fade"; } 12 | CLI::App *CreateCommandCLI(CLI::App &app) override; 13 | void ProcessFiles(AudioFiles &files) override; 14 | 15 | static void PerformFade(AudioData &audio, 16 | const s64 silent_frame, 17 | const s64 fullvol_frame, 18 | const FadeCommand::Shape shape); 19 | 20 | private: 21 | Shape m_fade_out_shape = Shape::Sine; 22 | Shape m_fade_in_shape = Shape::Sine; 23 | std::optional m_fade_out_duration {}; 24 | std::optional m_fade_in_duration {}; 25 | }; 26 | -------------------------------------------------------------------------------- /code/signet/commands/filter/filters.cpp: -------------------------------------------------------------------------------- 1 | #include "filters.h" 2 | 3 | #include "CLI11.hpp" 4 | 5 | #include "audio_files.h" 6 | #include "common.h" 7 | #include "filter.h" 8 | 9 | void FilterProcessFiles(AudioFiles &files, 10 | const Filter::RBJType type, 11 | const double cutoff, 12 | const double Q, 13 | const double gain_db) { 14 | for (auto &f : files) { 15 | auto &audio = f.GetWritableAudio(); 16 | 17 | Filter::Params params; 18 | Filter::Coeffs coeffs; 19 | Filter::SetParamsAndCoeffs(Filter::Type::RBJ, params, coeffs, (int)type, (double)audio.sample_rate, 20 | cutoff, Q, gain_db); 21 | 22 | for (unsigned chan = 0; chan < audio.num_channels; ++chan) { 23 | Filter::Data data {}; 24 | for (size_t frame = 0; frame < audio.NumFrames(); ++frame) { 25 | auto &v = audio.GetSample(chan, frame); 26 | v = Filter::Process(data, coeffs, v); 27 | } 28 | } 29 | } 30 | } 31 | 32 | CLI::App *HighpassCommand::CreateCommandCLI(CLI::App &app) { 33 | auto hp = app.add_subcommand("highpass", R"aa(Removes frequencies below the given cutoff.)aa"); 34 | 35 | hp->add_option("cutoff-freq-hz", m_cutoff, 36 | "The cutoff point where frequencies below this should be removed.") 37 | ->required(); 38 | 39 | return hp; 40 | } 41 | 42 | void HighpassCommand::ProcessFiles(AudioFiles &files) { 43 | FilterProcessFiles(files, Filter::RBJType::HighPass, m_cutoff, Filter::default_q_factor, 0); 44 | } 45 | 46 | CLI::App *LowpassCommand::CreateCommandCLI(CLI::App &app) { 47 | auto lp = 48 | app.add_subcommand("lowpass", GetName() + R"aa(: removes frequencies above the given cutoff.)aa"); 49 | 50 | lp->add_option("cutoff-freq-hz", m_cutoff, 51 | "The cutoff point where frequencies above this should be removed.") 52 | ->required(); 53 | 54 | return lp; 55 | } 56 | 57 | void LowpassCommand::ProcessFiles(AudioFiles &files) { 58 | FilterProcessFiles(files, Filter::RBJType::LowPass, m_cutoff, Filter::default_q_factor, 0); 59 | } 60 | -------------------------------------------------------------------------------- /code/signet/commands/filter/filters.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "filter.h" 4 | #include "command.h" 5 | 6 | void FilterProcessFiles(const tcb::span files, 7 | Filter::RBJType type, 8 | double cutoff, 9 | double Q, 10 | double gain_db); 11 | 12 | class HighpassCommand final : public Command { 13 | public: 14 | CLI::App *CreateCommandCLI(CLI::App &app) override; 15 | void ProcessFiles(AudioFiles &files) override; 16 | std::string GetName() const override { return "Highpass"; } 17 | 18 | private: 19 | double m_cutoff; 20 | }; 21 | 22 | class LowpassCommand final : public Command { 23 | public: 24 | CLI::App *CreateCommandCLI(CLI::App &app) override; 25 | void ProcessFiles(AudioFiles &files) override; 26 | std::string GetName() const override { return "Lowpass"; } 27 | 28 | private: 29 | double m_cutoff; 30 | }; 31 | -------------------------------------------------------------------------------- /code/signet/commands/fix_pitch_drift/fix_pitch_drift_command.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | #include "expected_midi_pitch.h" 5 | #include "identical_processing_set.h" 6 | #include "midi_pitches.h" 7 | 8 | class FixPitchDriftCommand final : public Command { 9 | public: 10 | std::string GetName() const override { return "FixPitchDrift"; } 11 | CLI::App *CreateCommandCLI(CLI::App &app) override; 12 | void ProcessFiles(AudioFiles &files) override; 13 | 14 | private: 15 | IdenticalProcessingSet m_identical_processing_set; 16 | double m_chunk_length_milliseconds {60.0}; 17 | bool m_print_csv {false}; 18 | ExpectedMidiPitch m_expected_midi_pitch; 19 | }; 20 | -------------------------------------------------------------------------------- /code/signet/commands/fix_pitch_drift/pitch_drift_corrector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "span.hpp" 7 | 8 | #include "audio_data.h" 9 | #include "midi_pitches.h" 10 | 11 | struct AnalysisChunk { 12 | usize frame_start {}; 13 | int frame_size {}; 14 | double detected_pitch {}; 15 | 16 | bool is_detected_pitch_outlier {}; 17 | bool ignore_tuning {}; 18 | double target_pitch {}; 19 | 20 | double pitch_ratio_for_print {}; 21 | }; 22 | 23 | class PitchDriftCorrector { 24 | public: 25 | PitchDriftCorrector(const AudioData &data, 26 | std::string_view message_heading, 27 | const fs::path &file_name, 28 | double chunk_length_milliseconds, 29 | bool print_csv); 30 | bool CanFileBePitchCorrected() const; 31 | bool ProcessFile(AudioData &data, std::optional expected_midi_pitch); 32 | 33 | private: 34 | static constexpr bool k_brute_force_fix_octave_errors = false; 35 | 36 | void MarkOutlierChunks(); 37 | void MarkRegionsToIgnore(); 38 | static double FindTargetPitchForChunkRegion(tcb::span chunks); 39 | int MarkTargetPitches(); 40 | std::vector CalculatePitchCorrectedInterleavedSamples(const AudioData &data); 41 | 42 | void PrintChunkCSV() const; 43 | 44 | std::string m_message_heading; 45 | fs::path m_file_name; 46 | double m_chunk_length_milliseconds; // near 50ms is best 47 | unsigned m_sample_rate; 48 | bool m_print_csv; 49 | std::vector m_chunks; 50 | }; 51 | -------------------------------------------------------------------------------- /code/signet/commands/folderise/folderise.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "command.h" 6 | 7 | class FolderiseCommand final : public Command { 8 | public: 9 | CLI::App *CreateCommandCLI(CLI::App &app) override; 10 | void ProcessFiles(AudioFiles &files) override; 11 | std::string GetName() const override { return "Folderise"; } 12 | bool AllowsOutputFolder() const override { return false; } 13 | bool AllowsSingleOutputFile() const override { return false; } 14 | 15 | private: 16 | std::string m_filename_pattern; 17 | std::string m_out_folder; 18 | }; 19 | -------------------------------------------------------------------------------- /code/signet/commands/gain/gain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class GainAmount { 6 | public: 7 | enum class Unit { 8 | Decibels, 9 | Percent, 10 | }; 11 | 12 | GainAmount() {} 13 | GainAmount(std::string str); 14 | double GetMultiplier() const; 15 | 16 | private: 17 | Unit m_unit {}; 18 | double m_value {}; 19 | }; 20 | 21 | class GainCommand final : public Command { 22 | public: 23 | CLI::App *CreateCommandCLI(CLI::App &app) override; 24 | void ProcessFiles(AudioFiles &files) override; 25 | std::string GetName() const override { return "Gain"; } 26 | 27 | private: 28 | GainAmount m_gain; 29 | }; 30 | -------------------------------------------------------------------------------- /code/signet/commands/move/move.cpp: -------------------------------------------------------------------------------- 1 | #include "move.h" 2 | 3 | #include "CLI11.hpp" 4 | 5 | CLI::App *MoveCommand::CreateCommandCLI(CLI::App &app) { 6 | auto move = app.add_subcommand("move", "Moves all input files to a given folder."); 7 | move->add_option("destination-folder", m_destination_dir, "The folder to put all of the input files in."); 8 | return move; 9 | } 10 | 11 | void MoveCommand::ProcessFiles(AudioFiles &files) { 12 | std::vector dest_paths {}; 13 | for (auto &f : files) { 14 | const auto p = m_destination_dir / f.GetPath().filename(); 15 | 16 | bool already_exists = false; 17 | for (const auto &dp : dest_paths) { 18 | if (p == dp) { 19 | already_exists = true; 20 | ErrorWithNewLine( 21 | GetName(), p, 22 | "There is already another file with the same that will be moved to the destination folder"); 23 | } 24 | } 25 | 26 | if (!already_exists) { 27 | f.SetPath(p); 28 | dest_paths.push_back(p); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /code/signet/commands/move/move.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class MoveCommand final : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "Move"; } 10 | bool AllowsOutputFolder() const override { return false; } 11 | bool AllowsSingleOutputFile() const override { return false; } 12 | 13 | private: 14 | fs::path m_destination_dir; 15 | }; 16 | -------------------------------------------------------------------------------- /code/signet/commands/normalise/normalise.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "command.h" 3 | 4 | class NormaliseCommand final : public Command { 5 | public: 6 | CLI::App *CreateCommandCLI(CLI::App &app) override; 7 | void ProcessFiles(AudioFiles &files) override; 8 | std::string GetName() const override { return "Normalise"; } 9 | 10 | private: 11 | enum class Mode { Peak, Rms, Energy, Count }; 12 | 13 | double m_norm_mix_percent {100.0}; 14 | double m_norm_channel_mix_percent {100.0}; 15 | double m_crest_factor_scaling {0.0}; 16 | bool m_normalise_independently = false; 17 | bool m_normalise_channels_separately = false; 18 | double m_target_decibels = 0.0; 19 | Mode m_mode {Mode::Peak}; 20 | }; 21 | -------------------------------------------------------------------------------- /code/signet/commands/pan/pan.cpp: -------------------------------------------------------------------------------- 1 | #include "pan.h" 2 | 3 | #include "common.h" 4 | #include "test_helpers.h" 5 | 6 | PanUnit::PanUnit(std::string str) { 7 | Lowercase(str); 8 | 9 | value = (double)std::atoi(str.data()); 10 | if (value > 100 || value < 0) { 11 | throw CLI::ConversionError("Pan value must be from 0 to 100"); 12 | } 13 | 14 | if (EndsWith(str, "l")) { 15 | value *= -1; 16 | } else if (EndsWith(str, "r")) { 17 | } else { 18 | throw CLI::ConversionError("Pan value must be end with either R or L. For example 75R."); 19 | } 20 | 21 | value /= 100; 22 | assert(value >= -1 && value <= 1); 23 | } 24 | 25 | CLI::App *PanCommand::CreateCommandCLI(CLI::App &app) { 26 | auto pan = 27 | app.add_subcommand("pan", "Changes the pan of stereo file(s). Does not work on non-stereo files."); 28 | 29 | pan->add_option( 30 | "pan-amount", m_pan, 31 | "The pan amount. This is a number from 0 to 100 followed by either L or R (representing left or right). For example: 100R (full right pan), 100L (full left pan), 10R (pan right with 10% intensity).") 32 | ->required(); 33 | 34 | return pan; 35 | } 36 | 37 | inline void SetEqualPan(double pan_pos, double &out_left, double &out_right) { 38 | assert(pan_pos >= -1 && pan_pos <= 1); 39 | const auto angle = (pan_pos * (pi * 0.5)) * 0.5; 40 | const auto cosx = std::cos(angle); 41 | const auto sinx = std::sin(angle); 42 | 43 | auto left = (sqrt_two / 2) * (cosx - sinx); 44 | auto right = (sqrt_two / 2) * (cosx + sinx); 45 | assert(left >= 0 && right >= 0); 46 | 47 | out_left *= left; 48 | out_right *= right; 49 | } 50 | 51 | void PanCommand::ProcessFiles(AudioFiles &files) { 52 | for (auto &f : files) { 53 | auto &audio = f.GetWritableAudio(); 54 | if (audio.IsEmpty()) continue; 55 | if (audio.num_channels != 2) { 56 | MessageWithNewLine(GetName(), f, "Skipping non-stereo file"); 57 | continue; 58 | } 59 | 60 | for (size_t frame = 0; frame < audio.NumFrames(); ++frame) { 61 | SetEqualPan(m_pan, audio.GetSample(0, frame), audio.GetSample(1, frame)); 62 | } 63 | } 64 | } 65 | 66 | TEST_CASE("PanCommand") { 67 | const auto buf = TestHelpers::CreateSquareWaveAtFrequency(2, 44100, 0.2, 440); 68 | 69 | SUBCASE("requires pan arg") { 70 | REQUIRE_THROWS(TestHelpers::ProcessBufferWithCommand("pan", buf)); 71 | } 72 | 73 | SUBCASE("pans fully left") { 74 | const auto out = TestHelpers::ProcessBufferWithCommand("pan 100L", buf); 75 | REQUIRE(out); 76 | REQUIRE(out->interleaved_samples[0] == doctest::Approx(1)); 77 | REQUIRE(out->interleaved_samples[1] == doctest::Approx(0)); 78 | } 79 | 80 | SUBCASE("pans fully right") { 81 | const auto out = TestHelpers::ProcessBufferWithCommand("pan 100R", buf); 82 | REQUIRE(out); 83 | REQUIRE(out->interleaved_samples[0] == doctest::Approx(0)); 84 | REQUIRE(out->interleaved_samples[1] == doctest::Approx(1)); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /code/signet/commands/pan/pan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | struct PanUnit { 6 | PanUnit() {} 7 | PanUnit(std::string str); 8 | operator double() const { return value; } 9 | 10 | double value {}; 11 | }; 12 | 13 | class PanCommand final : public Command { 14 | public: 15 | CLI::App *CreateCommandCLI(CLI::App &app) override; 16 | void ProcessFiles(AudioFiles &files) override; 17 | std::string GetName() const override { return "Pan"; } 18 | 19 | private: 20 | PanUnit m_pan {}; 21 | }; 22 | -------------------------------------------------------------------------------- /code/signet/commands/print_info/print_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class PrintInfoCommand : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "PrintInfo"; } 10 | 11 | private: 12 | enum class Format { Text, Json, Lua }; 13 | Format m_format = Format::Text; 14 | bool m_detect_pitch = false; 15 | bool m_path_as_key = false; 16 | std::optional m_field_filter_regex {}; 17 | }; 18 | -------------------------------------------------------------------------------- /code/signet/commands/rename/auto_mapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "CLI11.hpp" 8 | #include "filesystem.hpp" 9 | #include "span.hpp" 10 | 11 | #include "audio_files.h" 12 | 13 | class AutomapFolder { 14 | public: 15 | struct AutomapFile { 16 | fs::path path; 17 | int root; 18 | int low; 19 | int high; 20 | std::vector regex_groups {}; 21 | }; 22 | 23 | void AddFile(const fs::path &path, int root_note, const std::smatch &match) { 24 | AutomapFile file {}; 25 | file.path = path; 26 | file.root = root_note; 27 | for (usize i = 0; i < match.size(); ++i) { 28 | file.regex_groups.push_back(match[i].str()); 29 | } 30 | m_files.push_back(file); 31 | } 32 | 33 | void Automap() { 34 | std::sort(m_files.begin(), m_files.end(), 35 | [](const auto &a, const auto &b) { return a.root < b.root; }); 36 | 37 | if (m_files.size() == 1) { 38 | m_files[0].low = 0; 39 | m_files[0].high = 127; 40 | } else { 41 | for (usize i = 0; i < m_files.size(); ++i) { 42 | if (i == 0) { 43 | MapFile(m_files[i], {{}, -1, -1, -1}, m_files[i + 1]); 44 | } else if (i == m_files.size() - 1) { 45 | MapFile(m_files[i], m_files[i - 1], {{}, 128, 128, 128}); 46 | } else { 47 | MapFile(m_files[i], m_files[i - 1], m_files[i + 1]); 48 | } 49 | } 50 | m_files.back().high = 127; 51 | } 52 | } 53 | 54 | const AutomapFile *GetFile(const fs::path &path) { 55 | for (const auto &f : m_files) { 56 | if (path == f.path) { 57 | return &f; 58 | } 59 | } 60 | return nullptr; 61 | } 62 | 63 | private: 64 | void MapFile(AutomapFile &file, const AutomapFile &prev, const AutomapFile &next) { 65 | file.low = prev.high + 1; 66 | file.high = file.root + (next.root - file.root) / 2; 67 | } 68 | 69 | std::vector m_files; 70 | }; 71 | 72 | class AutoMapper { 73 | public: 74 | void CreateCLI(CLI::App &rename); 75 | void InitialiseProcessing(AudioFiles &files); 76 | bool Rename(const EditTrackedAudioFile &file, const fs::path &folder, std::string &filename); 77 | 78 | private: 79 | void AddToFolderMap(const fs::path &folder, const fs::path &path); 80 | void ConstructAllAutomappings(); 81 | 82 | std::map m_folder_map; 83 | std::optional m_automap_pattern; 84 | std::optional m_automap_out; 85 | int m_root_note_regex_group {}; 86 | }; 87 | -------------------------------------------------------------------------------- /code/signet/commands/rename/note_to_midi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "CLI11.hpp" 6 | 7 | #include "edit_tracked_audio_file.h" 8 | 9 | class NoteToMIDIConverter { 10 | public: 11 | bool Rename(std::string &filename); 12 | void CreateCLI(CLI::App &rename); 13 | 14 | private: 15 | bool m_on {}; 16 | std::string m_midi_0_note {"C-1"}; 17 | }; 18 | -------------------------------------------------------------------------------- /code/signet/commands/rename/rename.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "auto_mapper.h" 7 | #include "command.h" 8 | #include "note_to_midi.h" 9 | #include "types.h" 10 | 11 | class RenameCommand final : public Command { 12 | public: 13 | CLI::App *CreateCommandCLI(CLI::App &app) override; 14 | void ProcessFiles(AudioFiles &files) override; 15 | std::string GetName() const override { return "Rename"; } 16 | bool AllowsSingleOutputFile() const override { return false; } 17 | 18 | private: 19 | AutoMapper m_auto_mapper; 20 | NoteToMIDIConverter m_note_to_midi_processor; 21 | 22 | std::optional m_prefix; 23 | std::optional m_suffix; 24 | std::optional m_regex_pattern; 25 | std::string m_regex_replacement; 26 | 27 | int m_counter {}; 28 | }; 29 | -------------------------------------------------------------------------------- /code/signet/commands/rename/rename_substitutions.cpp: -------------------------------------------------------------------------------- 1 | #include "rename_substitutions.h" 2 | 3 | namespace RenameSubstitution { 4 | 5 | std::string GetFullInfo() { 6 | std::string result = "\n\n"; 7 | for (const auto &v : g_vars) { 8 | result += v.name; 9 | result += "\n"; 10 | result += v.desc; 11 | result += "\n\n"; 12 | } 13 | result.resize(result.size() - 2); 14 | return result; 15 | } 16 | 17 | std::string GetVariableNames() { 18 | std::string result {}; 19 | for (const auto &v : g_vars) { 20 | result += v.name; 21 | result += "\n"; 22 | } 23 | result.resize(result.size() - 1); 24 | return result; 25 | } 26 | 27 | } // namespace RenameSubstitution 28 | -------------------------------------------------------------------------------- /code/signet/commands/rename/rename_substitutions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace RenameSubstitution { 6 | 7 | struct Variable { 8 | std::string_view name; 9 | std::string_view desc; 10 | }; 11 | 12 | static const Variable g_vars[] = { 13 | {"", "A unique number starting from zero. The ordering of these numbers is not specified."}, 14 | 15 | {"", 16 | "A unique 3 character counter starting from aaa and ending with zzz. Beyond zzz, will " 17 | "be replaced with a number instead. The ordering of these numbers is not specified."}, 18 | 19 | {"", 20 | "The detected pitch of audio file in Hz. If no pitch is found this variable will be empty."}, 21 | 22 | {"", "The MIDI note number that is closest to the detected pitch of the audio file. " 23 | "If no pitch is found this variable will be empty."}, 24 | 25 | {"", 26 | "The MIDI note number (+12 semitones) that is closest to the detected pitch of the audio file. If no " 27 | "pitch is found this variable will be empty."}, 28 | 29 | {"", 30 | "The MIDI note number (+24 semitones) that is closest to the detected pitch of the audio file. If no " 31 | "pitch is found this variable will be empty."}, 32 | 33 | {"", 34 | "The MIDI note number (-12 semitones) that is closest to the detected pitch of the audio file. If no " 35 | "pitch is found this variable will be empty."}, 36 | 37 | {"", 38 | "The MIDI note number (-24 semitones) that is closest to the detected pitch of the audio file. If no " 39 | "pitch is found this variable will be empty."}, 40 | 41 | {"", 42 | "The MIDI note number that is closest to the detected pitch of the audio file, but moved by octaves to " 43 | "be nearest as possible to middle C. If no " 44 | "pitch is found this variable will be empty."}, 45 | 46 | {"", "The musical note-name that is closest to the detected pitch of the audio file. The " 47 | "note is capitalised, and the octave number is specified. For example 'C3'. If no " 48 | "pitch is found this variable will be empty."}, 49 | 50 | {"", "The name of the folder that contains the audio file."}, 51 | 52 | {"", "The snake-case name of the folder that contains the audio file."}, 53 | 54 | {"", "The camel-case name of the folder that contains the audio file."}, 55 | }; 56 | 57 | std::string GetFullInfo(); 58 | std::string GetVariableNames(); 59 | 60 | } // namespace RenameSubstitution 61 | -------------------------------------------------------------------------------- /code/signet/commands/reverse/reverse.cpp: -------------------------------------------------------------------------------- 1 | #include "reverse.h" 2 | 3 | #include "common.h" 4 | #include "test_helpers.h" 5 | #include 6 | 7 | CLI::App *ReverseCommand::CreateCommandCLI(CLI::App &app) { 8 | auto reverse = app.add_subcommand("reverse", "Reverses the audio in the file(s)."); 9 | return reverse; 10 | } 11 | 12 | void ReverseCommand::ProcessFiles(AudioFiles &files) { 13 | for (auto &f : files) { 14 | auto &audio = f.GetWritableAudio(); 15 | if (audio.IsEmpty()) continue; 16 | 17 | MessageWithNewLine(GetName(), f, "Reversing audio"); 18 | 19 | std::reverse(audio.interleaved_samples.begin(), audio.interleaved_samples.end()); 20 | audio.AudioDataWasReversed(); 21 | } 22 | } 23 | 24 | TEST_CASE("ReverseCommand") { 25 | const auto buf = TestHelpers::CreateSquareWaveAtFrequency(1, 44100, 0.2, 440); 26 | 27 | SUBCASE("reverses samples") { 28 | const auto out = TestHelpers::ProcessBufferWithCommand("reverse", buf); 29 | REQUIRE(out); 30 | 31 | REQUIRE(out->interleaved_samples.size() == buf.interleaved_samples.size()); 32 | 33 | for (size_t i = 0; i < buf.interleaved_samples.size(); i++) { 34 | REQUIRE(out->interleaved_samples[i] == 35 | buf.interleaved_samples[buf.interleaved_samples.size() - 1 - i]); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /code/signet/commands/reverse/reverse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class ReverseCommand final : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "Reverse"; } 10 | }; 11 | -------------------------------------------------------------------------------- /code/signet/commands/sample_blend/sample_blend.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CLI11.hpp" 4 | #include "filesystem.hpp" 5 | 6 | #include "audio_file_io.h" 7 | #include "command.h" 8 | 9 | class SampleBlendCommand : public Command { 10 | public: 11 | CLI::App *CreateCommandCLI(CLI::App &app) override; 12 | void GenerateFiles(AudioFiles &files, SignetBackup &backup) override; 13 | std::string GetName() const override { return "SampleBlend"; } 14 | 15 | bool AllowsOutputFolder() const override { return false; } 16 | bool AllowsSingleOutputFile() const override { return true; } 17 | 18 | private: 19 | struct BaseBlendFile { 20 | BaseBlendFile(EditTrackedAudioFile *file_, const int root_note_) 21 | : root_note(root_note_), file(file_) {} 22 | int root_note; 23 | EditTrackedAudioFile *file; 24 | }; 25 | 26 | void GenerateSamplesByBlending(SignetBackup &backup, BaseBlendFile &f1, BaseBlendFile &f2); 27 | 28 | bool m_make_same_length {false}; 29 | std::string m_regex {}; 30 | int m_semitone_interval {}; 31 | std::string m_out_filename {}; 32 | }; 33 | -------------------------------------------------------------------------------- /code/signet/commands/seamless_loop/seamless_loop.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class SeamlessLoopCommand final : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "SeamlessLoop"; } 10 | 11 | private: 12 | double m_crossfade_percent; 13 | double m_strictness_percent = 50; 14 | }; 15 | -------------------------------------------------------------------------------- /code/signet/commands/trim/trim.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "audio_duration.h" 6 | #include "command.h" 7 | 8 | class TrimCommand final : public Command { 9 | public: 10 | CLI::App *CreateCommandCLI(CLI::App &app) override; 11 | void ProcessFiles(AudioFiles &files) override; 12 | std::string GetName() const override { return "Trim"; } 13 | 14 | private: 15 | std::optional m_start_duration; 16 | std::optional m_end_duration; 17 | }; 18 | -------------------------------------------------------------------------------- /code/signet/commands/trim_silence/remove_silence.cpp: -------------------------------------------------------------------------------- 1 | 2 | TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand 3 | TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand TrimSilenceCommand 4 | -------------------------------------------------------------------------------- /code/signet/commands/trim_silence/trim_silence.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | #include "identical_processing_set.h" 5 | 6 | class TrimSilenceCommand final : public Command { 7 | public: 8 | CLI::App *CreateCommandCLI(CLI::App &app) override; 9 | void ProcessFiles(AudioFiles &files) override; 10 | std::string GetName() const override { return "TrimSilence"; } 11 | 12 | private: 13 | std::pair GetLoudRegion(EditTrackedAudioFile &f) const; 14 | void ProcessFile(EditTrackedAudioFile &f, usize loud_region_start, usize loud_region_end) const; 15 | 16 | IdenticalProcessingSet m_identical_processing_set; 17 | enum class Region { Start, End, Both }; 18 | float m_silence_threshold_db = -90; 19 | Region m_region {Region::Both}; 20 | }; 21 | -------------------------------------------------------------------------------- /code/signet/commands/tune/tune.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "command.h" 4 | 5 | class TuneCommand final : public Command { 6 | public: 7 | CLI::App *CreateCommandCLI(CLI::App &app) override; 8 | void ProcessFiles(AudioFiles &files) override; 9 | std::string GetName() const override { return "Tune"; } 10 | 11 | private: 12 | double m_tune_cents {}; 13 | }; 14 | -------------------------------------------------------------------------------- /code/signet/commands/zcross_offset/zcross_offset.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "span.hpp" 8 | 9 | #include "audio_duration.h" 10 | #include "audio_file_io.h" 11 | #include "common.h" 12 | #include "signet_interface.h" 13 | 14 | class ZeroCrossOffsetCommand final : public Command { 15 | public: 16 | static size_t FindFrameNearestToZeroInBuffer(const tcb::span interleaved_buffer, 17 | const size_t num_frames, 18 | const unsigned num_channels); 19 | 20 | static bool CreateSampleOffsetToNearestZCross(AudioData &audio, 21 | const AudioDuration &search_size, 22 | const bool append_skipped_frames_on_end); 23 | 24 | void ProcessFiles(AudioFiles &files) override { 25 | for (auto &f : files) { 26 | auto &audio = f.GetAudio(); 27 | if (audio.IsEmpty()) continue; 28 | CreateSampleOffsetToNearestZCross(f.GetWritableAudio(), m_search_size, 29 | m_append_skipped_frames_on_end); 30 | } 31 | } 32 | std::string GetName() const override { return GetNameInternal(); } 33 | static std::string GetNameInternal() { return "ZeroCrossOffset"; } 34 | 35 | CLI::App *CreateCommandCLI(CLI::App &app) override { 36 | auto zcross = app.add_subcommand( 37 | "zcross-offset", "Offsets the start of an audio file to the nearest " 38 | "zero-crossing (or the closest thing to a zero crossing). You can use the " 39 | "option --append to cause the samples that were offsetted to be appended to the " 40 | "end of the file. This is useful for when the file is a seamless loop."); 41 | zcross->add_flag("--append", m_append_skipped_frames_on_end, 42 | "Append the frames offsetted to the end of the file - useful when the sample is a " 43 | "seamless loop."); 44 | 45 | zcross 46 | ->add_option("search_size", m_search_size, 47 | "The maximum length that it is allowed to offset to. " + 48 | AudioDuration::TypeDescription()) 49 | ->required(); 50 | return zcross; 51 | } 52 | 53 | private: 54 | bool m_append_skipped_frames_on_end = false; 55 | AudioDuration m_search_size {AudioDuration::Unit::Seconds, 1.0}; 56 | }; 57 | -------------------------------------------------------------------------------- /code/signet/signet_interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "doctest.hpp" 6 | #include "json.hpp" 7 | 8 | #include "audio_file_io.h" 9 | #include "audio_files.h" 10 | #include "backup.h" 11 | #include "command.h" 12 | #include "common.h" 13 | #include "filesystem.hpp" 14 | 15 | namespace SignetResult { 16 | enum SignetResultEnum { 17 | Success = 0, 18 | NoFilesMatchingInput, 19 | NoFilesWereProcessed, 20 | FailedToWriteFiles, 21 | FatalErrorOcurred, 22 | WarningsAreErrors, 23 | }; 24 | } 25 | 26 | class SignetInterface final { 27 | public: 28 | SignetInterface(); 29 | 30 | int Main(const int argc, const char *const argv[]); 31 | 32 | private: 33 | std::vector> m_commands {}; 34 | SignetBackup m_backup {}; 35 | 36 | AudioFiles m_input_audio_files {}; 37 | bool m_recursive_directory_search {}; 38 | fs::path m_make_docs_filepath {}; 39 | fs::path m_script_filepath {}; 40 | std::optional m_output_path {}; 41 | std::optional m_single_output_file {}; 42 | }; 43 | -------------------------------------------------------------------------------- /code/signet/signet_main.cpp: -------------------------------------------------------------------------------- 1 | #include "signet_interface.h" 2 | 3 | #define DOCTEST_CONFIG_IMPLEMENT 4 | #include "doctest.hpp" 5 | 6 | int main(const int argc, const char *argv[]) { 7 | doctest::Context context(0, nullptr); 8 | context.setAsDefaultForAssertsOutOfTestCases(); 9 | 10 | SignetInterface signet; 11 | return signet.Main(argc, argv); 12 | } 13 | -------------------------------------------------------------------------------- /code/signet/version.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define SIGNET_VERSION "@PROJECT_VERSION@" -------------------------------------------------------------------------------- /code/tests/test_helpers.cpp: -------------------------------------------------------------------------------- 1 | #include "test_helpers.h" 2 | 3 | #include "common.h" 4 | 5 | namespace TestHelpers { 6 | 7 | AudioData CreateSingleOscillationSineWave(const unsigned num_channels, 8 | const unsigned sample_rate, 9 | const size_t num_frames) { 10 | AudioData buf; 11 | buf.num_channels = num_channels; 12 | buf.sample_rate = sample_rate; 13 | buf.interleaved_samples.resize(num_frames * num_channels); 14 | for (size_t frame = 0; frame < num_frames; ++frame) { 15 | for (unsigned channel = 0; channel < num_channels; ++channel) { 16 | constexpr double two_pi = 6.28318530718; 17 | buf.GetSample(channel, frame) = std::sin(frame * (two_pi / num_frames)); 18 | } 19 | } 20 | return buf; 21 | } 22 | 23 | AudioData CreateSineWaveAtFrequency(const unsigned num_channels, 24 | const unsigned sample_rate, 25 | const double length_seconds, 26 | const double frequency_hz) { 27 | const auto num_frames = (size_t)(length_seconds * sample_rate); 28 | const auto oscillations_per_sec = frequency_hz; 29 | const auto oscillations_in_whole = oscillations_per_sec * length_seconds; 30 | const auto taus_in_whole = oscillations_in_whole * 2 * pi; 31 | const auto taus_per_sample = taus_in_whole / num_frames; 32 | 33 | AudioData buf; 34 | buf.num_channels = num_channels; 35 | buf.sample_rate = sample_rate; 36 | buf.interleaved_samples.resize(num_frames * num_channels); 37 | double phase = -pi * 2; 38 | for (size_t frame = 0; frame < num_frames; ++frame) { 39 | const double value = (double)std::sin(phase); 40 | phase += taus_per_sample; 41 | for (unsigned channel = 0; channel < num_channels; ++channel) { 42 | buf.GetSample(channel, frame) = value; 43 | } 44 | } 45 | return buf; 46 | } 47 | 48 | AudioData CreateSquareWaveAtFrequency(const unsigned num_channels, 49 | const unsigned sample_rate, 50 | const double length_seconds, 51 | const double frequency_hz) { 52 | auto result = CreateSineWaveAtFrequency(num_channels, sample_rate, length_seconds, frequency_hz); 53 | for (auto &s : result.interleaved_samples) { 54 | if (s < 0) 55 | s = -1; 56 | else 57 | s = 1; 58 | } 59 | return result; 60 | } 61 | 62 | } // namespace TestHelpers 63 | -------------------------------------------------------------------------------- /code/tests/tests_config.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define TEST_DATA_DIRECTORY "@PROJECT_SOURCE_DIR@/test_data" 3 | #define BUILD_DIRECTORY "@PROJECT_SOURCE_DIR@/build" 4 | -------------------------------------------------------------------------------- /code/tests/tests_main.cpp: -------------------------------------------------------------------------------- 1 | #define DOCTEST_CONFIG_IMPLEMENT 2 | #include "doctest.hpp" 3 | 4 | #include "common.h" 5 | #include "tests_config.h" 6 | 7 | static void HandleTestArgs(int argc, char **argv) { 8 | for (int i = 0; i < argc; ++i) { 9 | if (strcmp(argv[i], "--silent") == 0) { 10 | g_messages_enabled = false; 11 | return; 12 | } 13 | } 14 | } 15 | 16 | int main(int argc, char **argv) { 17 | fs::current_path(BUILD_DIRECTORY); 18 | HandleTestArgs(argc, argv); 19 | return doctest::Context(argc, argv).run(); 20 | } 21 | -------------------------------------------------------------------------------- /code/third_party_libs/CLI11_Fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace CLI { 4 | class App; 5 | } 6 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/assert.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__ASSERT_H 34 | #define FLAC__ASSERT_H 35 | 36 | /* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ 37 | #ifdef DEBUG 38 | #include 39 | #define FLAC__ASSERT(x) assert(x) 40 | #define FLAC__ASSERT_DECLARATION(x) x 41 | #else 42 | #define FLAC__ASSERT(x) 43 | #define FLAC__ASSERT_DECLARATION(x) 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/ordinals.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__ORDINALS_H 34 | #define FLAC__ORDINALS_H 35 | 36 | #if defined(_MSC_VER) && _MSC_VER < 1600 37 | 38 | /* Microsoft Visual Studio earlier than the 2010 version did not provide 39 | * the 1999 ISO C Standard header file . 40 | */ 41 | 42 | typedef __int8 FLAC__int8; 43 | typedef unsigned __int8 FLAC__uint8; 44 | 45 | typedef __int16 FLAC__int16; 46 | typedef __int32 FLAC__int32; 47 | typedef __int64 FLAC__int64; 48 | typedef unsigned __int16 FLAC__uint16; 49 | typedef unsigned __int32 FLAC__uint32; 50 | typedef unsigned __int64 FLAC__uint64; 51 | 52 | #else 53 | 54 | /* For MSVC 2010 and everything else which provides . */ 55 | 56 | #include 57 | 58 | typedef int8_t FLAC__int8; 59 | typedef uint8_t FLAC__uint8; 60 | 61 | typedef int16_t FLAC__int16; 62 | typedef int32_t FLAC__int32; 63 | typedef int64_t FLAC__int64; 64 | typedef uint16_t FLAC__uint16; 65 | typedef uint32_t FLAC__uint32; 66 | typedef uint64_t FLAC__uint64; 67 | 68 | #endif 69 | 70 | typedef int FLAC__bool; 71 | 72 | typedef FLAC__uint8 FLAC__byte; 73 | 74 | 75 | #ifdef true 76 | #undef true 77 | #endif 78 | #ifdef false 79 | #undef false 80 | #endif 81 | #ifndef __cplusplus 82 | #define true 1 83 | #define false 0 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/ia32/cpu_asm.nasm: -------------------------------------------------------------------------------- 1 | ; vim:filetype=nasm ts=8 2 | 3 | ; libFLAC - Free Lossless Audio Codec library 4 | ; Copyright (C) 2001-2009 Josh Coalson 5 | ; Copyright (C) 2011-2014 Xiph.Org Foundation 6 | ; 7 | ; Redistribution and use in source and binary forms, with or without 8 | ; modification, are permitted provided that the following conditions 9 | ; are met: 10 | ; 11 | ; - Redistributions of source code must retain the above copyright 12 | ; notice, this list of conditions and the following disclaimer. 13 | ; 14 | ; - Redistributions in binary form must reproduce the above copyright 15 | ; notice, this list of conditions and the following disclaimer in the 16 | ; documentation and/or other materials provided with the distribution. 17 | ; 18 | ; - Neither the name of the Xiph.org Foundation nor the names of its 19 | ; contributors may be used to endorse or promote products derived from 20 | ; this software without specific prior written permission. 21 | ; 22 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | ; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 26 | ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | ; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | ; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | %include "nasm.h" 35 | 36 | data_section 37 | 38 | cglobal FLAC__cpu_have_cpuid_asm_ia32 39 | cglobal FLAC__cpu_info_asm_ia32 40 | 41 | code_section 42 | 43 | ; ********************************************************************** 44 | ; 45 | ; FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32() 46 | ; 47 | 48 | cident FLAC__cpu_have_cpuid_asm_ia32 49 | pushfd 50 | pop eax 51 | mov edx, eax 52 | xor eax, 0x00200000 53 | push eax 54 | popfd 55 | pushfd 56 | pop eax 57 | xor eax, edx 58 | and eax, 0x00200000 59 | shr eax, 0x15 60 | push edx 61 | popfd 62 | ret 63 | 64 | ; ********************************************************************** 65 | ; 66 | ; void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx) 67 | ; 68 | 69 | cident FLAC__cpu_info_asm_ia32 70 | ;[esp + 8] == flags_edx 71 | ;[esp + 12] == flags_ecx 72 | 73 | push ebx 74 | call FLAC__cpu_have_cpuid_asm_ia32 75 | test eax, eax 76 | jz .no_cpuid 77 | mov eax, 0 78 | cpuid 79 | cmp eax, 1 80 | jb .no_cpuid 81 | mov eax, 1 82 | cpuid 83 | mov ebx, [esp + 8] 84 | mov [ebx], edx 85 | mov ebx, [esp + 12] 86 | mov [ebx], ecx 87 | jmp .end 88 | .no_cpuid: 89 | xor eax, eax 90 | mov ebx, [esp + 8] 91 | mov [ebx], eax 92 | mov ebx, [esp + 12] 93 | mov [ebx], eax 94 | .end: 95 | pop ebx 96 | ret 97 | 98 | ; end 99 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/all.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__ALL_H 34 | #define FLAC__PRIVATE__ALL_H 35 | 36 | #include "bitmath.h" 37 | #include "bitreader.h" 38 | #include "bitwriter.h" 39 | #include "cpu.h" 40 | #include "crc.h" 41 | #include "fixed.h" 42 | #include "float.h" 43 | #include "format.h" 44 | #include "lpc.h" 45 | #include "md5.h" 46 | #include "memory.h" 47 | #include "metadata.h" 48 | #include "stream_encoder_framing.h" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/crc.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__CRC_H 34 | #define FLAC__PRIVATE__CRC_H 35 | 36 | #include "FLAC/ordinals.h" 37 | 38 | /* 8 bit CRC generator, MSB shifted first 39 | ** polynomial = x^8 + x^2 + x^1 + x^0 40 | ** init = 0 41 | */ 42 | extern FLAC__byte const FLAC__crc8_table[256]; 43 | #define FLAC__CRC8_UPDATE(data, crc) (crc) = FLAC__crc8_table[(crc) ^ (data)]; 44 | void FLAC__crc8_update(const FLAC__byte data, FLAC__uint8 *crc); 45 | void FLAC__crc8_update_block(const FLAC__byte *data, unsigned len, FLAC__uint8 *crc); 46 | FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len); 47 | 48 | /* 16 bit CRC generator, MSB shifted first 49 | ** polynomial = x^16 + x^15 + x^2 + x^0 50 | ** init = 0 51 | */ 52 | extern unsigned const FLAC__crc16_table[256]; 53 | 54 | #define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) & 0xffff) ^ FLAC__crc16_table[((crc)>>8) ^ (data)]) 55 | /* this alternate may be faster on some systems/compilers */ 56 | #if 0 57 | #define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) ^ FLAC__crc16_table[((crc)>>8) ^ (data)]) & 0xffff) 58 | #endif 59 | 60 | unsigned FLAC__crc16(const FLAC__byte *data, unsigned len); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/format.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__FORMAT_H 34 | #define FLAC__PRIVATE__FORMAT_H 35 | 36 | #include "FLAC/format.h" 37 | 38 | unsigned FLAC__format_get_max_rice_partition_order(unsigned blocksize, unsigned predictor_order); 39 | unsigned FLAC__format_get_max_rice_partition_order_from_blocksize(unsigned blocksize); 40 | unsigned FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(unsigned limit, unsigned blocksize, unsigned predictor_order); 41 | void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); 42 | void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); 43 | FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, unsigned max_partition_order); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/macros.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2012-2014 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef FLAC__PRIVATE__MACROS_H 33 | #define FLAC__PRIVATE__MACROS_H 34 | 35 | #if defined(__GNUC__) && (__GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 36 | 37 | #define flac_max(a,b) \ 38 | ({ __typeof__ (a) _a = (a); \ 39 | __typeof__ (b) _b = (b); \ 40 | _a > _b ? _a : _b; }) 41 | 42 | #define MIN_PASTE(A,B) A##B 43 | #define MIN_IMPL(A,B,L) ({ \ 44 | __typeof__(A) MIN_PASTE(__a,L) = (A); \ 45 | __typeof__(B) MIN_PASTE(__b,L) = (B); \ 46 | MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); \ 47 | }) 48 | 49 | #define flac_min(A,B) MIN_IMPL(A,B,__COUNTER__) 50 | 51 | /* Whatever other unix that has sys/param.h */ 52 | #elif defined(HAVE_SYS_PARAM_H) 53 | #include 54 | #define flac_max(a,b) MAX(a,b) 55 | #define flac_min(a,b) MIN(a,b) 56 | 57 | /* Windows VS has them in stdlib.h.. XXX:Untested */ 58 | #elif defined(_MSC_VER) 59 | #include 60 | #define flac_max(a,b) __max(a,b) 61 | #define flac_min(a,b) __min(a,b) 62 | #endif 63 | 64 | #ifndef flac_min 65 | #define flac_min(x,y) ((x) <= (y) ? (x) : (y)) 66 | #endif 67 | 68 | #ifndef flac_max 69 | #define flac_max(x,y) ((x) >= (y) ? (x) : (y)) 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/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 "FLAC/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[], unsigned channels, unsigned samples, unsigned bytes_per_sample); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/memory.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__MEMORY_H 34 | #define FLAC__PRIVATE__MEMORY_H 35 | 36 | #ifdef HAVE_CONFIG_H 37 | #include 38 | #endif 39 | 40 | #include /* for size_t */ 41 | 42 | #include "private/float.h" 43 | #include "FLAC/ordinals.h" /* for FLAC__bool */ 44 | 45 | /* Returns the unaligned address returned by malloc. 46 | * Use free() on this address to deallocate. 47 | */ 48 | void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address); 49 | FLAC__bool FLAC__memory_alloc_aligned_int32_array(size_t elements, FLAC__int32 **unaligned_pointer, FLAC__int32 **aligned_pointer); 50 | FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32 **unaligned_pointer, FLAC__uint32 **aligned_pointer); 51 | FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer); 52 | FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, unsigned **unaligned_pointer, unsigned **aligned_pointer); 53 | #ifndef FLAC__INTEGER_ONLY_LIBRARY 54 | FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer); 55 | #endif 56 | void *safe_malloc_mul_2op_p(size_t size1, size_t size2); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/metadata.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2002-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__METADATA_H 34 | #define FLAC__PRIVATE__METADATA_H 35 | 36 | #include "FLAC/metadata.h" 37 | 38 | /* WATCHOUT: all malloc()ed data in the block is free()ed; this may not 39 | * be a consistent state (e.g. PICTURE) or equivalent to the initial 40 | * state after FLAC__metadata_object_new() 41 | */ 42 | void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object); 43 | 44 | void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/ogg_helper.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__OGG_HELPER_H 34 | #define FLAC__PRIVATE__OGG_HELPER_H 35 | 36 | #include 37 | #include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoder */ 38 | 39 | void simple_ogg_page__init(ogg_page *page); 40 | void simple_ogg_page__clear(ogg_page *page); 41 | FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data); 42 | FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/ogg_mapping.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__OGG_MAPPING_H 34 | #define FLAC__PRIVATE__OGG_MAPPING_H 35 | 36 | #include "FLAC/ordinals.h" 37 | 38 | /** The length of the packet type field in bytes. */ 39 | #define FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH (1u) 40 | 41 | extern const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN; /* = 8 bits */ 42 | 43 | extern const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; /* = 0x7f */ 44 | 45 | /** The length of the 'FLAC' magic in bytes. */ 46 | #define FLAC__OGG_MAPPING_MAGIC_LENGTH (4u) 47 | 48 | extern const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC; /* = "FLAC" */ 49 | 50 | extern const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN; /* = 8 bits */ 51 | extern const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN; /* = 8 bits */ 52 | 53 | /** The length of the Ogg FLAC mapping major version number in bytes. */ 54 | #define FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH (1u) 55 | 56 | /** The length of the Ogg FLAC mapping minor version number in bytes. */ 57 | #define FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH (1u) 58 | 59 | extern const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN; /* = 16 bits */ 60 | 61 | /** The length of the #-of-header-packets number bytes. */ 62 | #define FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH (2u) 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/private/stream_encoder_framing.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H 34 | #define FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H 35 | 36 | #include "FLAC/format.h" 37 | #include "bitwriter.h" 38 | 39 | FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw); 40 | FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw); 41 | FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 42 | FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 43 | FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 44 | FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe, unsigned samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/protected/all.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PROTECTED__ALL_H 34 | #define FLAC__PROTECTED__ALL_H 35 | 36 | #include "stream_decoder.h" 37 | #include "stream_encoder.h" 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/protected/stream_decoder.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PROTECTED__STREAM_DECODER_H 34 | #define FLAC__PROTECTED__STREAM_DECODER_H 35 | 36 | #include "FLAC/stream_decoder.h" 37 | #if FLAC__HAS_OGG 38 | #include "private/ogg_decoder_aspect.h" 39 | #endif 40 | 41 | typedef struct FLAC__StreamDecoderProtected { 42 | FLAC__StreamDecoderState state; 43 | FLAC__StreamDecoderInitStatus initstate; 44 | unsigned channels; 45 | FLAC__ChannelAssignment channel_assignment; 46 | unsigned bits_per_sample; 47 | unsigned sample_rate; /* in Hz */ 48 | unsigned blocksize; /* in samples (per channel) */ 49 | FLAC__bool md5_checking; /* if true, generate MD5 signature of decoded data and compare against signature in the STREAMINFO metadata block */ 50 | #if FLAC__HAS_OGG 51 | FLAC__OggDecoderAspect ogg_decoder_aspect; 52 | #endif 53 | } FLAC__StreamDecoderProtected; 54 | 55 | /* 56 | * return the number of input bytes consumed 57 | */ 58 | unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/endswap.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2012-2014 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | /* It is assumed that this header will be included after "config.h". */ 33 | 34 | #if HAVE_BSWAP32 /* GCC and Clang */ 35 | 36 | /* GCC prior to 4.8 didn't provide bswap16 on x86_64 */ 37 | #if ! HAVE_BSWAP16 38 | static inline unsigned short __builtin_bswap16(unsigned short a) 39 | { 40 | return (a<<8)|(a>>8); 41 | } 42 | #endif 43 | 44 | #define ENDSWAP_16(x) (__builtin_bswap16 (x)) 45 | #define ENDSWAP_32(x) (__builtin_bswap32 (x)) 46 | 47 | #elif defined _MSC_VER /* Windows. Apparently in . */ 48 | 49 | #define ENDSWAP_16(x) (_byteswap_ushort (x)) 50 | #define ENDSWAP_32(x) (_byteswap_ulong (x)) 51 | 52 | #elif defined HAVE_BYTESWAP_H /* Linux */ 53 | 54 | #include 55 | 56 | #define ENDSWAP_16(x) (bswap_16 (x)) 57 | #define ENDSWAP_32(x) (bswap_32 (x)) 58 | 59 | #else 60 | 61 | #define ENDSWAP_16(x) ((((x) >> 8) & 0xFF) | (((x) & 0xFF) << 8)) 62 | #define ENDSWAP_32(x) ((((x) >> 24) & 0xFF) | (((x) >> 8) & 0xFF00) | (((x) & 0xFF00) << 8) | (((x) & 0xFF) << 24)) 63 | 64 | #endif 65 | 66 | 67 | /* Host to little-endian byte swapping. */ 68 | #if CPU_IS_BIG_ENDIAN 69 | 70 | #define H2LE_16(x) ENDSWAP_16 (x) 71 | #define H2LE_32(x) ENDSWAP_32 (x) 72 | 73 | #else 74 | 75 | #define H2LE_16(x) (x) 76 | #define H2LE_32(x) (x) 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/macros.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013-2014 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | /* FLAC_CHECK_RETURN : Check the return value of of the provided function and 35 | * print and error message if it fails (ie returns a value < 0). 36 | */ 37 | 38 | #define FLAC_CHECK_RETURN(x) \ 39 | { if ((x) < 0) \ 40 | printf ("%s : %s\n", #x, strerror (errno)) ; \ 41 | } 42 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/private.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013-2014 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef FLAC__SHARE__PRIVATE_H 33 | #define FLAC__SHARE__PRIVATE_H 34 | 35 | /* 36 | * Unpublished debug routines from libFLAC> This should not be used from any 37 | * client code other than code shipped with the FLAC sources. 38 | */ 39 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 40 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 41 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 42 | FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value); 43 | FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder); 44 | 45 | #endif /* FLAC__SHARE__PRIVATE_H */ 46 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/safe_str.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013-2014 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | /* Safe string handling functions to replace things like strcpy, strncpy, 33 | * strcat, strncat etc. 34 | * All of these functions guarantee a correctly NUL terminated string but 35 | * the string may be truncated if the destination buffer was too short. 36 | */ 37 | 38 | #ifndef FLAC__SHARE_SAFE_STR_H 39 | #define FLAC__SHARE_SAFE_STR_H 40 | 41 | static inline char * 42 | safe_strncat(char *dest, const char *src, size_t dest_size) 43 | { 44 | char * ret; 45 | 46 | if (dest_size < 1) 47 | return dest; 48 | 49 | ret = strncat(dest, src, dest_size - strlen (dest)); 50 | dest [dest_size - 1] = 0; 51 | 52 | return ret; 53 | } 54 | 55 | static inline char * 56 | safe_strncpy(char *dest, const char *src, size_t dest_size) 57 | { 58 | char * ret; 59 | 60 | if (dest_size < 1) 61 | return dest; 62 | 63 | ret = strncpy(dest, src, dest_size); 64 | dest [dest_size - 1] = 0; 65 | 66 | return ret; 67 | } 68 | 69 | #endif /* FLAC__SHARE_SAFE_STR_H */ 70 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/utf8.h: -------------------------------------------------------------------------------- 1 | #ifndef SHARE__UTF8_H 2 | #define SHARE__UTF8_H 3 | 4 | /* 5 | * Convert a string between UTF-8 and the locale's charset. 6 | * Invalid bytes are replaced by '#', and characters that are 7 | * not available in the target encoding are replaced by '?'. 8 | * 9 | * If the locale's charset is not set explicitly then it is 10 | * obtained using nl_langinfo(CODESET), where available, the 11 | * environment variable CHARSET, or assumed to be US-ASCII. 12 | * 13 | * Return value of conversion functions: 14 | * 15 | * -1 : memory allocation failed 16 | * 0 : data was converted exactly 17 | * 1 : valid data was converted approximately (using '?') 18 | * 2 : input was invalid (but still converted, using '#') 19 | * 3 : unknown encoding (but still converted, using '?') 20 | */ 21 | 22 | int utf8_encode(const char *from, char **to); 23 | int utf8_decode(const char *from, char **to); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/include/share/win_utf8_io.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013-2014 Xiph.Org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifdef _WIN32 33 | 34 | #ifndef flac__win_utf8_io_h 35 | #define flac__win_utf8_io_h 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | int get_utf8_argv(int *argc, char ***argv); 47 | 48 | int printf_utf8(const char *format, ...); 49 | int fprintf_utf8(FILE *stream, const char *format, ...); 50 | int vfprintf_utf8(FILE *stream, const char *format, va_list argptr); 51 | 52 | FILE *fopen_utf8(const char *filename, const char *mode); 53 | int stat_utf8(const char *path, struct stat *buffer); 54 | int _stat64_utf8(const char *path, struct __stat64 *buffer); 55 | int chmod_utf8(const char *filename, int pmode); 56 | int utime_utf8(const char *filename, struct utimbuf *times); 57 | int unlink_utf8(const char *filename); 58 | int rename_utf8(const char *oldname, const char *newname); 59 | size_t strlen_utf8(const char *str); 60 | int win_get_console_width(void); 61 | int print_console(FILE *stream, const wchar_t *text, size_t len); 62 | HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); 63 | 64 | #ifdef __cplusplus 65 | } /* extern "C" */ 66 | #endif 67 | 68 | #endif 69 | #endif 70 | -------------------------------------------------------------------------------- /code/third_party_libs/FLAC/src/ogg_mapping.c: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2014 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifdef HAVE_CONFIG_H 34 | # include 35 | #endif 36 | 37 | #include "private/ogg_mapping.h" 38 | 39 | const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN = 8; /* bits */ 40 | 41 | const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE = 0x7f; 42 | 43 | const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC = (const FLAC__byte * const)"FLAC"; 44 | 45 | const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN = 8; /* bits */ 46 | const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN = 8; /* bits */ 47 | 48 | const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN = 16; /* bits */ 49 | -------------------------------------------------------------------------------- /code/third_party_libs/backward.cpp: -------------------------------------------------------------------------------- 1 | // Pick your poison. 2 | // 3 | // On GNU/Linux, you have few choices to get the most out of your stack trace. 4 | // 5 | // By default you get: 6 | // - object filename 7 | // - function name 8 | // 9 | // In order to add: 10 | // - source filename 11 | // - line and column numbers 12 | // - source code snippet (assuming the file is accessible) 13 | 14 | // Install one of the following libraries then uncomment one of the macro (or 15 | // better, add the detection of the lib and the macro definition in your build 16 | // system) 17 | 18 | // - apt-get install libdw-dev ... 19 | // - g++/clang++ -ldw ... 20 | // #define BACKWARD_HAS_DW 1 21 | 22 | // - apt-get install binutils-dev ... 23 | // - g++/clang++ -lbfd ... 24 | // #define BACKWARD_HAS_BFD 1 25 | 26 | // - apt-get install libdwarf-dev ... 27 | // - g++/clang++ -ldwarf ... 28 | // #define BACKWARD_HAS_DWARF 1 29 | 30 | // Regardless of the library you choose to read the debug information, 31 | // for potentially more detailed stack traces you can use libunwind 32 | // - apt-get install libunwind-dev 33 | // - g++/clang++ -lunwind 34 | // #define BACKWARD_HAS_LIBUNWIND 1 35 | 36 | #include "backward.hpp" 37 | 38 | namespace backward { 39 | 40 | backward::SignalHandling sh; 41 | 42 | } // namespace backward 43 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.2) 2 | project(cereal) 3 | 4 | option(SKIP_PORTABILITY_TEST "Skip portability (32 bit) tests" OFF) 5 | option(SKIP_PERFORMANCE_COMPARISON "Skip building performance comparison (requires boost)" OFF) 6 | if (NOT CMAKE_VERSION VERSION_LESS 3.0) # installing cereal requires INTERFACE lib 7 | option(JUST_INSTALL_CEREAL "Don't do anything besides installing the library" OFF) 8 | endif () 9 | 10 | option(THREAD_SAFE "Use mutexes to ensure thread safety" OFF) 11 | if (THREAD_SAFE) 12 | add_definitions(-DCEREAL_THREAD_SAFE=1) 13 | set(CEREAL_THREAD_LIBS "pthread") 14 | else () 15 | set(CEREAL_THREAD_LIBS "") 16 | endif () 17 | 18 | if (MSVC) 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /W3 /WX") 20 | else () 21 | set(CMAKE_CXX_FLAGS "-Wall -g -Wextra -Wshadow -pedantic -Wold-style-cast ${CMAKE_CXX_FLAGS}") 22 | option(WITH_WERROR "Compile with '-Werror' C++ compiler flag" ON) 23 | if (WITH_WERROR) 24 | set(CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS}") 25 | endif (WITH_WERROR) 26 | 27 | option(CLANG_USE_LIBCPP "Use libc++ for clang compilation" OFF) 28 | if (CLANG_USE_LIBCPP) 29 | set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") 30 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") 31 | endif () 32 | 33 | if (CMAKE_VERSION VERSION_LESS 3.1) 34 | set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") 35 | else () 36 | if (NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD STREQUAL "98") 37 | set(CMAKE_CXX_STANDARD 11) 38 | endif () 39 | 40 | if (CMAKE_CXX_STANDARD GREATER 14) 41 | cmake_minimum_required(VERSION 3.8) 42 | endif () 43 | 44 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 45 | endif () 46 | 47 | endif () 48 | 49 | if (NOT CMAKE_VERSION VERSION_LESS 3.0) 50 | add_library(cereal INTERFACE) 51 | target_include_directories(cereal INTERFACE $ 52 | $) 53 | install( 54 | TARGETS cereal 55 | EXPORT cereal 56 | DESTINATION lib) # ignored 57 | install( 58 | EXPORT cereal 59 | FILE cereal-config.cmake 60 | DESTINATION share/cmake/cereal) 61 | install(DIRECTORY include/cereal DESTINATION include) 62 | endif () 63 | 64 | if (JUST_INSTALL_CEREAL) 65 | return() 66 | endif () 67 | 68 | include_directories(./include) 69 | 70 | if (NOT CMAKE_VERSION VERSION_LESS 3.12) 71 | cmake_policy(VERSION 3.12) 72 | endif () 73 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of cereal nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/README.md: -------------------------------------------------------------------------------- 1 | cereal - A C++11 library for serialization 2 | ========================================== 3 | 4 |

cereal is a header-only C++11 serialization library. cereal takes arbitrary data types and reversibly turns them into different representations, such as compact binary encodings, XML, or JSON. cereal was designed to be fast, light-weight, and easy to extend - it has no external dependencies and can be easily bundled with other code or used standalone.

5 | 6 | ### cereal has great documentation 7 | 8 | Looking for more information on how cereal works and its documentation? Visit [cereal's web page](http://USCiLab.github.com/cereal) to get the latest information. 9 | 10 | ### cereal is easy to use 11 | 12 | Installation and use of of cereal is fully documented on the [main web page](http://USCiLab.github.com/cereal), but this is a quick and dirty version: 13 | 14 | * Download cereal and place the headers somewhere your code can see them 15 | * Write serialization functions for your custom types or use the built in support for the standard library cereal provides 16 | * Use the serialization archives to load and save data 17 | 18 | ```cpp 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | struct MyRecord 25 | { 26 | uint8_t x, y; 27 | float z; 28 | 29 | template 30 | void serialize( Archive & ar ) 31 | { 32 | ar( x, y, z ); 33 | } 34 | }; 35 | 36 | struct SomeData 37 | { 38 | int32_t id; 39 | std::shared_ptr> data; 40 | 41 | template 42 | void save( Archive & ar ) const 43 | { 44 | ar( data ); 45 | } 46 | 47 | template 48 | void load( Archive & ar ) 49 | { 50 | static int32_t idGen = 0; 51 | id = idGen++; 52 | ar( data ); 53 | } 54 | }; 55 | 56 | int main() 57 | { 58 | std::ofstream os("out.cereal", std::ios::binary); 59 | cereal::BinaryOutputArchive archive( os ); 60 | 61 | SomeData myData; 62 | archive( myData ); 63 | 64 | return 0; 65 | } 66 | ``` 67 | 68 | ### cereal has a mailing list 69 | 70 | Either get in touch over email or [on the web](https://groups.google.com/forum/#!forum/cerealcpp). 71 | 72 | 73 | 74 | ## cereal has a permissive license 75 | 76 | cereal is licensed under the [BSD license](http://opensource.org/licenses/BSD-3-Clause). 77 | 78 | ## cereal build status 79 | 80 | * master : [![Build Status](https://travis-ci.com/USCiLab/cereal.svg?branch=master)](https://travis-ci.com/USCiLab/cereal) 81 | [![Build status](https://ci.appveyor.com/api/projects/status/91aou6smj36or0vb/branch/master?svg=true)](https://ci.appveyor.com/project/AzothAmmo/cereal/branch/master) 82 | 83 | --- 84 | 85 | Were you looking for the Haskell cereal? Go here. 86 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/cursorstreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ 16 | #define CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | 20 | #if defined(__GNUC__) 21 | CEREAL_RAPIDJSON_DIAG_PUSH 22 | CEREAL_RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && _MSC_VER <= 1800 26 | CEREAL_RAPIDJSON_DIAG_PUSH 27 | CEREAL_RAPIDJSON_DIAG_OFF(4702) // unreachable code 28 | CEREAL_RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 29 | #endif 30 | 31 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 32 | 33 | 34 | //! Cursor stream wrapper for counting line and column number if error exists. 35 | /*! 36 | \tparam InputStream Any stream that implements Stream Concept 37 | */ 38 | template > 39 | class CursorStreamWrapper : public GenericStreamWrapper { 40 | public: 41 | typedef typename Encoding::Ch Ch; 42 | 43 | CursorStreamWrapper(InputStream& is): 44 | GenericStreamWrapper(is), line_(1), col_(0) {} 45 | 46 | // counting line and column number 47 | Ch Take() { 48 | Ch ch = this->is_.Take(); 49 | if(ch == '\n') { 50 | line_ ++; 51 | col_ = 0; 52 | } else { 53 | col_ ++; 54 | } 55 | return ch; 56 | } 57 | 58 | //! Get the error line number, if error exists. 59 | size_t GetLine() const { return line_; } 60 | //! Get the error column number, if error exists. 61 | size_t GetColumn() const { return col_; } 62 | 63 | private: 64 | size_t line_; //!< Current Line 65 | size_t col_; //!< Current Column 66 | }; 67 | 68 | #if defined(_MSC_VER) && _MSC_VER <= 1800 69 | CEREAL_RAPIDJSON_DIAG_POP 70 | #endif 71 | 72 | #if defined(__GNUC__) 73 | CEREAL_RAPIDJSON_DIAG_POP 74 | #endif 75 | 76 | CEREAL_RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // CEREAL_RAPIDJSON_CURSORSTREAMWRAPPER_H_ 79 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | #include 20 | 21 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 22 | namespace internal { 23 | 24 | //! Custom strlen() which works on different character types. 25 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 26 | \param s Null-terminated input string. 27 | \return Number of characters in the string. 28 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 29 | */ 30 | template 31 | inline SizeType StrLen(const Ch* s) { 32 | CEREAL_RAPIDJSON_ASSERT(s != 0); 33 | const Ch* p = s; 34 | while (*p) ++p; 35 | return SizeType(p - s); 36 | } 37 | 38 | template <> 39 | inline SizeType StrLen(const char* s) { 40 | return SizeType(std::strlen(s)); 41 | } 42 | 43 | template <> 44 | inline SizeType StrLen(const wchar_t* s) { 45 | return SizeType(std::wcslen(s)); 46 | } 47 | 48 | //! Returns number of code points in a encoded string. 49 | template 50 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { 51 | CEREAL_RAPIDJSON_ASSERT(s != 0); 52 | CEREAL_RAPIDJSON_ASSERT(outCount != 0); 53 | GenericStringStream is(s); 54 | const typename Encoding::Ch* end = s + length; 55 | SizeType count = 0; 56 | while (is.src_ < end) { 57 | unsigned codepoint; 58 | if (!Encoding::Decode(is, &codepoint)) 59 | return false; 60 | count++; 61 | } 62 | *outCount = count; 63 | return true; 64 | } 65 | 66 | } // namespace internal 67 | CEREAL_RAPIDJSON_NAMESPACE_END 68 | 69 | #endif // CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 70 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | CEREAL_RAPIDJSON_DIAG_PUSH 22 | CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) CEREAL_RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | CEREAL_RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | CEREAL_RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/memorybuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_MEMORYBUFFER_H_ 16 | #define CEREAL_RAPIDJSON_MEMORYBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 22 | 23 | //! Represents an in-memory output byte stream. 24 | /*! 25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. 26 | 27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. 28 | 29 | Differences between MemoryBuffer and StringBuffer: 30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. 32 | 33 | \tparam Allocator type for allocating memory buffer. 34 | \note implements Stream concept 35 | */ 36 | template 37 | struct GenericMemoryBuffer { 38 | typedef char Ch; // byte 39 | 40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 41 | 42 | void Put(Ch c) { *stack_.template Push() = c; } 43 | void Flush() {} 44 | 45 | void Clear() { stack_.Clear(); } 46 | void ShrinkToFit() { stack_.ShrinkToFit(); } 47 | Ch* Push(size_t count) { return stack_.template Push(count); } 48 | void Pop(size_t count) { stack_.template Pop(count); } 49 | 50 | const Ch* GetBuffer() const { 51 | return stack_.template Bottom(); 52 | } 53 | 54 | size_t GetSize() const { return stack_.GetSize(); } 55 | 56 | static const size_t kDefaultCapacity = 256; 57 | mutable internal::Stack stack_; 58 | }; 59 | 60 | typedef GenericMemoryBuffer<> MemoryBuffer; 61 | 62 | //! Implement specialized version of PutN() with memset() for better performance. 63 | template<> 64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { 65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); 66 | } 67 | 68 | CEREAL_RAPIDJSON_NAMESPACE_END 69 | 70 | #endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ 71 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/memorystream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_MEMORYSTREAM_H_ 16 | #define CEREAL_RAPIDJSON_MEMORYSTREAM_H_ 17 | 18 | #include "stream.h" 19 | 20 | #ifdef __clang__ 21 | CEREAL_RAPIDJSON_DIAG_PUSH 22 | CEREAL_RAPIDJSON_DIAG_OFF(unreachable-code) 23 | CEREAL_RAPIDJSON_DIAG_OFF(missing-noreturn) 24 | #endif 25 | 26 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Represents an in-memory input byte stream. 29 | /*! 30 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. 31 | 32 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. 33 | 34 | Differences between MemoryStream and StringStream: 35 | 1. StringStream has encoding but MemoryStream is a byte stream. 36 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. 37 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). 38 | \note implements Stream concept 39 | */ 40 | struct MemoryStream { 41 | typedef char Ch; // byte 42 | 43 | MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} 44 | 45 | Ch Peek() const { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } 46 | Ch Take() { return CEREAL_RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } 47 | size_t Tell() const { return static_cast(src_ - begin_); } 48 | 49 | Ch* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 50 | void Put(Ch) { CEREAL_RAPIDJSON_ASSERT(false); } 51 | void Flush() { CEREAL_RAPIDJSON_ASSERT(false); } 52 | size_t PutEnd(Ch*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 53 | 54 | // For encoding detection only. 55 | const Ch* Peek4() const { 56 | return Tell() + 4 <= size_ ? src_ : 0; 57 | } 58 | 59 | const Ch* src_; //!< Current read position. 60 | const Ch* begin_; //!< Original head of the string. 61 | const Ch* end_; //!< End of stream. 62 | size_t size_; //!< Size of the stream. 63 | }; 64 | 65 | CEREAL_RAPIDJSON_NAMESPACE_END 66 | 67 | #ifdef __clang__ 68 | CEREAL_RAPIDJSON_DIAG_POP 69 | #endif 70 | 71 | #endif // CEREAL_RAPIDJSON_MEMORYBUFFER_H_ 72 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidjson/ostreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ 16 | #define CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | CEREAL_RAPIDJSON_DIAG_PUSH 23 | CEREAL_RAPIDJSON_DIAG_OFF(padded) 24 | #endif 25 | 26 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. 29 | /*! 30 | The classes can be wrapped including but not limited to: 31 | 32 | - \c std::ostringstream 33 | - \c std::stringstream 34 | - \c std::wpstringstream 35 | - \c std::wstringstream 36 | - \c std::ifstream 37 | - \c std::fstream 38 | - \c std::wofstream 39 | - \c std::wfstream 40 | 41 | \tparam StreamType Class derived from \c std::basic_ostream. 42 | */ 43 | 44 | template 45 | class BasicOStreamWrapper { 46 | public: 47 | typedef typename StreamType::char_type Ch; 48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} 49 | 50 | void Put(Ch c) { 51 | stream_.put(c); 52 | } 53 | 54 | void Flush() { 55 | stream_.flush(); 56 | } 57 | 58 | // Not implemented 59 | char Peek() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 60 | char Take() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 61 | size_t Tell() const { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 62 | char* PutBegin() { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 63 | size_t PutEnd(char*) { CEREAL_RAPIDJSON_ASSERT(false); return 0; } 64 | 65 | private: 66 | BasicOStreamWrapper(const BasicOStreamWrapper&); 67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); 68 | 69 | StreamType& stream_; 70 | }; 71 | 72 | typedef BasicOStreamWrapper OStreamWrapper; 73 | typedef BasicOStreamWrapper WOStreamWrapper; 74 | 75 | #ifdef __clang__ 76 | CEREAL_RAPIDJSON_DIAG_POP 77 | #endif 78 | 79 | CEREAL_RAPIDJSON_NAMESPACE_END 80 | 81 | #endif // CEREAL_RAPIDJSON_OSTREAMWRAPPER_H_ 82 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/external/rapidxml/license.txt: -------------------------------------------------------------------------------- 1 | Use of this software is granted under one of the following two licenses, 2 | to be chosen freely by the user. 3 | 4 | 1. Boost Software License - Version 1.0 - August 17th, 2003 5 | =============================================================================== 6 | 7 | Copyright (c) 2006, 2007 Marcin Kalicinski 8 | 9 | Permission is hereby granted, free of charge, to any person or organization 10 | obtaining a copy of the software and accompanying documentation covered by 11 | this license (the "Software") to use, reproduce, display, distribute, 12 | execute, and transmit the Software, and to prepare derivative works of the 13 | Software, and to permit third-parties to whom the Software is furnished to 14 | do so, all subject to the following: 15 | 16 | The copyright notices in the Software and this entire statement, including 17 | the above license grant, this restriction and the following disclaimer, 18 | must be included in all copies of the Software, in whole or in part, and 19 | all derivative works of the Software, unless such copies or derivative 20 | works are solely in the form of machine-executable object code generated by 21 | a source language processor. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 26 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 27 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 28 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 | DEALINGS IN THE SOFTWARE. 30 | 31 | 2. The MIT License 32 | =============================================================================== 33 | 34 | Copyright (c) 2006, 2007 Marcin Kalicinski 35 | 36 | Permission is hereby granted, free of charge, to any person obtaining a copy 37 | of this software and associated documentation files (the "Software"), to deal 38 | in the Software without restriction, including without limitation the rights 39 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 40 | of the Software, and to permit persons to whom the Software is furnished to do so, 41 | subject to the following conditions: 42 | 43 | The above copyright notice and this permission notice shall be included in all 44 | copies or substantial portions of the Software. 45 | 46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 47 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 49 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 50 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 51 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 52 | IN THE SOFTWARE. 53 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/atomic.hpp: -------------------------------------------------------------------------------- 1 | /*! \file atomic.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_ATOMIC_HPP_ 31 | #define CEREAL_TYPES_ATOMIC_HPP_ 32 | 33 | #include 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Serializing (save) for std::atomic 39 | template inline 40 | void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::atomic const & a ) 41 | { 42 | ar( CEREAL_NVP_("atomic_data", a.load()) ); 43 | } 44 | 45 | //! Serializing (load) for std::atomic 46 | template inline 47 | void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::atomic & a ) 48 | { 49 | T tmp; 50 | ar( CEREAL_NVP_("atomic_data", tmp) ); 51 | a.store( tmp ); 52 | } 53 | } // namespace cereal 54 | 55 | #endif // CEREAL_TYPES_ATOMIC_HPP_ 56 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/complex.hpp: -------------------------------------------------------------------------------- 1 | /*! \file complex.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_COMPLEX_HPP_ 31 | #define CEREAL_TYPES_COMPLEX_HPP_ 32 | 33 | #include 34 | 35 | namespace cereal 36 | { 37 | //! Serializing (save) for std::complex 38 | template inline 39 | void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::complex const & comp ) 40 | { 41 | ar( CEREAL_NVP_("real", comp.real()), 42 | CEREAL_NVP_("imag", comp.imag()) ); 43 | } 44 | 45 | //! Serializing (load) for std::complex 46 | template inline 47 | void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::complex & bits ) 48 | { 49 | T real, imag; 50 | ar( CEREAL_NVP_("real", real), 51 | CEREAL_NVP_("imag", imag) ); 52 | bits = {real, imag}; 53 | } 54 | } // namespace cereal 55 | 56 | #endif // CEREAL_TYPES_COMPLEX_HPP_ 57 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/deque.hpp: -------------------------------------------------------------------------------- 1 | /*! \file deque.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_DEQUE_HPP_ 31 | #define CEREAL_TYPES_DEQUE_HPP_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Saving for std::deque 39 | template inline 40 | void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::deque const & deque ) 41 | { 42 | ar( make_size_tag( static_cast(deque.size()) ) ); 43 | 44 | for( auto const & i : deque ) 45 | ar( i ); 46 | } 47 | 48 | //! Loading for std::deque 49 | template inline 50 | void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::deque & deque ) 51 | { 52 | size_type size; 53 | ar( make_size_tag( size ) ); 54 | 55 | deque.resize( static_cast( size ) ); 56 | 57 | for( auto & i : deque ) 58 | ar( i ); 59 | } 60 | } // namespace cereal 61 | 62 | #endif // CEREAL_TYPES_DEQUE_HPP_ 63 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/forward_list.hpp: -------------------------------------------------------------------------------- 1 | /*! \file forward_list.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_FORWARD_LIST_HPP_ 31 | #define CEREAL_TYPES_FORWARD_LIST_HPP_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Saving for std::forward_list all other types 39 | template inline 40 | void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::forward_list const & forward_list ) 41 | { 42 | // write the size - note that this is slow because we need to traverse 43 | // the entire list. there are ways we could avoid this but this was chosen 44 | // since it works in the most general fashion with any archive type 45 | size_type const size = std::distance( forward_list.begin(), forward_list.end() ); 46 | 47 | ar( make_size_tag( size ) ); 48 | 49 | // write the list 50 | for( const auto & i : forward_list ) 51 | ar( i ); 52 | } 53 | 54 | //! Loading for std::forward_list all other types from 55 | template 56 | void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::forward_list & forward_list ) 57 | { 58 | size_type size; 59 | ar( make_size_tag( size ) ); 60 | 61 | forward_list.resize( static_cast( size ) ); 62 | 63 | for( auto & i : forward_list ) 64 | ar( i ); 65 | } 66 | } // namespace cereal 67 | 68 | #endif // CEREAL_TYPES_FORWARD_LIST_HPP_ 69 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/functional.hpp: -------------------------------------------------------------------------------- 1 | /*! \file functional.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2016, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_FUNCTIONAL_HPP_ 31 | #define CEREAL_TYPES_FUNCTIONAL_HPP_ 32 | 33 | #include 34 | 35 | namespace cereal 36 | { 37 | //! Saving for std::less 38 | template inline 39 | void serialize( Archive &, std::less & ) 40 | { } 41 | } // namespace cereal 42 | 43 | #endif // CEREAL_TYPES_FUNCTIONAL_HPP_ 44 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/list.hpp: -------------------------------------------------------------------------------- 1 | /*! \file list.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_LIST_HPP_ 31 | #define CEREAL_TYPES_LIST_HPP_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Saving for std::list 39 | template inline 40 | void CEREAL_SAVE_FUNCTION_NAME( Archive & ar, std::list const & list ) 41 | { 42 | ar( make_size_tag( static_cast(list.size()) ) ); 43 | 44 | for( auto const & i : list ) 45 | ar( i ); 46 | } 47 | 48 | //! Loading for std::list 49 | template inline 50 | void CEREAL_LOAD_FUNCTION_NAME( Archive & ar, std::list & list ) 51 | { 52 | size_type size; 53 | ar( make_size_tag( size ) ); 54 | 55 | list.resize( static_cast( size ) ); 56 | 57 | for( auto & i : list ) 58 | ar( i ); 59 | } 60 | } // namespace cereal 61 | 62 | #endif // CEREAL_TYPES_LIST_HPP_ 63 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/map.hpp: -------------------------------------------------------------------------------- 1 | /*! \file map.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_MAP_HPP_ 31 | #define CEREAL_TYPES_MAP_HPP_ 32 | 33 | #include "cereal/types/concepts/pair_associative_container.hpp" 34 | #include 35 | 36 | #endif // CEREAL_TYPES_MAP_HPP_ 37 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/optional.hpp: -------------------------------------------------------------------------------- 1 | /*! \file optional.hpp 2 | \brief Support for std::optional 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2017, Juan Pedro Bolivar Puente 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_STD_OPTIONAL_ 31 | #define CEREAL_TYPES_STD_OPTIONAL_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal { 37 | //! Saving for std::optional 38 | template inline 39 | void CEREAL_SAVE_FUNCTION_NAME(Archive& ar, const std::optional& optional) 40 | { 41 | if(!optional) { 42 | ar(CEREAL_NVP_("nullopt", true)); 43 | } else { 44 | ar(CEREAL_NVP_("nullopt", false), 45 | CEREAL_NVP_("data", *optional)); 46 | } 47 | } 48 | 49 | //! Loading for std::optional 50 | template inline 51 | void CEREAL_LOAD_FUNCTION_NAME(Archive& ar, std::optional& optional) 52 | { 53 | bool nullopt; 54 | ar(CEREAL_NVP_("nullopt", nullopt)); 55 | 56 | if (nullopt) { 57 | optional = std::nullopt; 58 | } else { 59 | T value; 60 | ar(CEREAL_NVP_("data", value)); 61 | optional = std::move(value); 62 | } 63 | } 64 | } // namespace cereal 65 | 66 | #endif // CEREAL_TYPES_STD_OPTIONAL_ 67 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/string.hpp: -------------------------------------------------------------------------------- 1 | /*! \file string.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_STRING_HPP_ 31 | #define CEREAL_TYPES_STRING_HPP_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Serialization for basic_string types, if binary data is supported 39 | template inline 40 | typename std::enable_if, Archive>::value, void>::type 41 | CEREAL_SAVE_FUNCTION_NAME(Archive & ar, std::basic_string const & str) 42 | { 43 | // Save number of chars + the data 44 | ar( make_size_tag( static_cast(str.size()) ) ); 45 | ar( binary_data( str.data(), str.size() * sizeof(CharT) ) ); 46 | } 47 | 48 | //! Serialization for basic_string types, if binary data is supported 49 | template inline 50 | typename std::enable_if, Archive>::value, void>::type 51 | CEREAL_LOAD_FUNCTION_NAME(Archive & ar, std::basic_string & str) 52 | { 53 | size_type size; 54 | ar( make_size_tag( size ) ); 55 | str.resize(static_cast(size)); 56 | ar( binary_data( const_cast( str.data() ), static_cast(size) * sizeof(CharT) ) ); 57 | } 58 | } // namespace cereal 59 | 60 | #endif // CEREAL_TYPES_STRING_HPP_ 61 | 62 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | /*! \file unordered_map.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_UNORDERED_MAP_HPP_ 31 | #define CEREAL_TYPES_UNORDERED_MAP_HPP_ 32 | 33 | #include "cereal/types/concepts/pair_associative_container.hpp" 34 | #include 35 | 36 | #endif // CEREAL_TYPES_UNORDERED_MAP_HPP_ 37 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/types/utility.hpp: -------------------------------------------------------------------------------- 1 | /*! \file utility.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_UTILITY_HPP_ 31 | #define CEREAL_TYPES_UTILITY_HPP_ 32 | 33 | #include "cereal/cereal.hpp" 34 | #include 35 | 36 | namespace cereal 37 | { 38 | //! Serializing for std::pair 39 | template inline 40 | void CEREAL_SERIALIZE_FUNCTION_NAME( Archive & ar, std::pair & pair ) 41 | { 42 | ar( CEREAL_NVP_("first", pair.first), 43 | CEREAL_NVP_("second", pair.second) ); 44 | } 45 | } // namespace cereal 46 | 47 | #endif // CEREAL_TYPES_UTILITY_HPP_ 48 | -------------------------------------------------------------------------------- /code/third_party_libs/cereal/include/cereal/version.hpp: -------------------------------------------------------------------------------- 1 | /*! \file version.hpp 2 | \brief Macros to detect cereal version 3 | 4 | These macros can assist in determining the version of cereal. Be 5 | warned that cereal is not guaranteed to be compatible across 6 | different versions. For more information on releases of cereal, 7 | see https://github.com/USCiLab/cereal/releases. 8 | 9 | \ingroup utility */ 10 | /* 11 | Copyright (c) 2018, Shane Grant 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of cereal nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | 37 | #ifndef CEREAL_VERSION_HPP_ 38 | #define CEREAL_VERSION_HPP_ 39 | 40 | //! The major version 41 | #define CEREAL_VERSION_MAJOR 1 42 | //! The minor version 43 | #define CEREAL_VERSION_MINOR 3 44 | //! The patch version 45 | #define CEREAL_VERSION_PATCH 0 46 | 47 | //! The full version as a single number 48 | #define CEREAL_VERSION (CEREAL_VERSION_MAJOR * 10000 \ 49 | + CEREAL_VERSION_MINOR * 100 \ 50 | + CEREAL_VERSION_PATCH) 51 | 52 | #endif // CEREAL_VERSION_HPP_ 53 | -------------------------------------------------------------------------------- /code/third_party_libs/dywapitchtrack/DOCUMENTATION.txt: -------------------------------------------------------------------------------- 1 | 2 | dywapitchtrack pitch tracking library 3 | Documentation 4 | 5 | The dywapitchtrack library computes the pitch of an audio stream in real time. The pitch is the main frequency of the waveform (the 'note' being played or sung). It is expressed as a float in Hz. 6 | 7 | Unlike the human ear, pitch detection is difficult to achieve for computers. Many algorithms have been designed and experimented, but there is no 'best' algorithm. They all depend on the context and the tradeoffs acceptable in terms of speed and latency. The context includes the quality and 'cleanness' of the audio : obviously polyphonic sounds (multiple instruments playing different notes at the same time) are extremely difficult to track, percussive or noisy audio has no pitch, most real-life audio have some noisy moments, some instruments have a lot of harmonics, etc... 8 | 9 | The dywapitchtrack is based on a custom-tailored algorithm which is of very high quality: both very accurate (precision < 0.05 semitones), very low latency (< 23 ms) and very low error rate. It has been thoroughly tested on human voice. 10 | 11 | It can best be described as a dynamic wavelet algorithm (dywa): 12 | 13 | The heart of the algorithm is a very powerful wavelet algorithm, described in a paper by Eric Larson and Ross Maddox : 14 | "Real-Time Time-Domain Pitch Tracking Using Wavelets" https://www.researchgate.net/publication/242155298_REAL-TIME_TIME_DOMAIN_PITCH_TRACKING_USING_WAVELETS 15 | 16 | This central algorithm has been improved by adding dynamic tracking, to reduce the common problems of frequency-halving and voiced/unvoiced errors. This dynamic tracking explains the need for a tracking structure (dywapitchtracker). The dynamic tracking assumes that the main function dywapitch_computepitch is called repeatedly, as it follows the pitch over time and makes assumptions about human voice capabilities and reallife conditions (as documented inside the code). 17 | 18 | Note : The algorithm currently assumes a 44100Hz audio sampling rate. If you use a different samplerate, you can just multiply the resulting pitch by the ratio between your samplerate and 44100. 19 | 20 | See the dywapitchtrack.h file for the library API documentation. 21 | 22 | History : 23 | This algorithm has been designed during a mission for a customer. As I had kept the author's rights on the source code, I eventually decided to make this code public and open source, because it is of really high quality. This algorithms has been extensively tested, especially it has been included in an Adobe Director Xtra (plugin), asPitchDetect Xtra, that has been distributed widely for a few years. 24 | 25 | I hope that it can be used with pleasure and efficiency in your project. 26 | 27 | Thank you 28 | Antoine Schmitt April 2010 29 | 30 | -------------------------------------------------------------------------------- /code/third_party_libs/dywapitchtrack/README.txt: -------------------------------------------------------------------------------- 1 | dywapitchtrack 2 | Dynamic Wavelet Algorithm Pitch Tracking library 3 | 4 | Copyright (c) 2010 Antoine Schmitt as@schmittmachine.com 5 | 6 | -- Documentation 7 | 8 | See the dywapitchtrack.h file for the library API documentation. 9 | 10 | 11 | -- Version history 12 | 13 | Inital release : Antoine Schmitt April 2010 14 | v2 : Antoine Schmitt Nov2016, following fine-tuning remarks by Robin Carduner 15 | 16 | -- Building, Installing 17 | 18 | - the iPhone/dywapitchtrack.xcodeproj builds an iPhone static library, against which one can statically link an iPhone application. 19 | 20 | 21 | -- MIT open source licence 22 | 23 | Copyright (c) 2010 Antoine Schmitt 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining a copy 26 | of this software and associated documentation files (the "Software"), to deal 27 | in the Software without restriction, including without limitation the rights 28 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 29 | copies of the Software, and to permit persons to whom the Software is 30 | furnished to do so, subject to the following conditions: 31 | 32 | The above copyright notice and this permission notice shall be included in 33 | all copies or substantial portions of the Software. 34 | 35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 41 | THE SOFTWARE. 42 | -------------------------------------------------------------------------------- /code/third_party_libs/filesystem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // for some reason apple clang is not defining this dispite having string_view available 4 | #ifdef __APPLE__ 5 | #ifndef __cpp_lib_string_view 6 | #define __cpp_lib_string_view 7 | #endif 8 | #endif 9 | 10 | #ifdef _WIN32 11 | #include 12 | namespace fs = std::filesystem; 13 | #else 14 | #include "filesystem_ghc.hpp" 15 | namespace fs = ghc::filesystem; 16 | #endif 17 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/include/fmt/locale.h: -------------------------------------------------------------------------------- 1 | // Formatting library for C++ - std::locale support 2 | // 3 | // Copyright (c) 2012 - present, Victor Zverovich 4 | // All rights reserved. 5 | // 6 | // For the license information refer to format.h. 7 | 8 | #ifndef FMT_LOCALE_H_ 9 | #define FMT_LOCALE_H_ 10 | 11 | #include 12 | 13 | #include "format.h" 14 | 15 | FMT_BEGIN_NAMESPACE 16 | 17 | namespace detail { 18 | template 19 | std::basic_string vformat( 20 | const std::locale& loc, basic_string_view format_str, 21 | basic_format_args>> args) { 22 | basic_memory_buffer buffer; 23 | detail::vformat_to(buffer, format_str, args, detail::locale_ref(loc)); 24 | return fmt::to_string(buffer); 25 | } 26 | } // namespace detail 27 | 28 | template > 29 | inline std::basic_string vformat( 30 | const std::locale& loc, const S& format_str, 31 | basic_format_args>> args) { 32 | return detail::vformat(loc, to_string_view(format_str), args); 33 | } 34 | 35 | template > 36 | inline std::basic_string format(const std::locale& loc, 37 | const S& format_str, Args&&... args) { 38 | return detail::vformat(loc, to_string_view(format_str), 39 | fmt::make_args_checked(format_str, args...)); 40 | } 41 | 42 | template , 44 | FMT_ENABLE_IF(detail::is_output_iterator::value)> 45 | inline OutputIt vformat_to( 46 | OutputIt out, const std::locale& loc, const S& format_str, 47 | basic_format_args>> args) { 48 | decltype(detail::get_buffer(out)) buf(detail::get_buffer_init(out)); 49 | vformat_to(buf, to_string_view(format_str), args, detail::locale_ref(loc)); 50 | return detail::get_iterator(buf); 51 | } 52 | 53 | template >::value> 55 | inline auto format_to(OutputIt out, const std::locale& loc, 56 | const S& format_str, Args&&... args) -> 57 | typename std::enable_if::type { 58 | const auto& vargs = fmt::make_args_checked(format_str, args...); 59 | return vformat_to(out, loc, to_string_view(format_str), vargs); 60 | } 61 | 62 | FMT_END_NAMESPACE 63 | 64 | #endif // FMT_LOCALE_H_ 65 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/include/fmt/posix.h: -------------------------------------------------------------------------------- 1 | #include "os.h" 2 | #warning "fmt/posix.h is deprecated; use fmt/os.h instead" 3 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE := fmt_static 5 | LOCAL_MODULE_FILENAME := libfmt 6 | 7 | LOCAL_SRC_FILES := ../src/format.cc 8 | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 10 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 11 | 12 | LOCAL_CFLAGS += -std=c++11 -fexceptions 13 | 14 | include $(BUILD_STATIC_LIBRARY) 15 | 16 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/README: -------------------------------------------------------------------------------- 1 | This directory contains build support files such as 2 | 3 | * CMake modules 4 | * Build scripts 5 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # A vagrant config for testing against gcc-4.8. 5 | Vagrant.configure("2") do |config| 6 | config.vm.box = "ubuntu/xenial64" 7 | config.disksize.size = '15GB' 8 | 9 | config.vm.provider "virtualbox" do |vb| 10 | vb.memory = "4096" 11 | end 12 | 13 | config.vm.provision "shell", inline: <<-SHELL 14 | apt-get update 15 | apt-get install -y g++ make wget git 16 | wget -q https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.tar.gz 17 | tar xzf cmake-3.14.4-Linux-x86_64.tar.gz 18 | ln -s `pwd`/cmake-3.14.4-Linux-x86_64/bin/cmake /usr/local/bin 19 | SHELL 20 | end 21 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/appveyor-build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Build the project on AppVeyor. 3 | 4 | import os 5 | from subprocess import check_call 6 | 7 | build = os.environ['BUILD'] 8 | config = os.environ['CONFIGURATION'] 9 | platform = os.environ['PLATFORM'] 10 | path = os.environ['PATH'] 11 | image = os.environ['APPVEYOR_BUILD_WORKER_IMAGE'] 12 | jobid = os.environ['APPVEYOR_JOB_ID'] 13 | cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config, '..'] 14 | if build == 'mingw': 15 | cmake_command.append('-GMinGW Makefiles') 16 | build_command = ['mingw32-make', '-j4'] 17 | test_command = ['mingw32-make', 'test'] 18 | # Remove the path to Git bin directory from $PATH because it breaks 19 | # MinGW config. 20 | path = path.replace(r'C:\Program Files (x86)\Git\bin', '') 21 | os.environ['PATH'] = r'C:\MinGW\bin;' + path 22 | else: 23 | # Add MSBuild 14.0 to PATH as described in 24 | # http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc. 25 | os.environ['PATH'] = r'C:\Program Files (x86)\MSBuild\15.0\Bin;' + path 26 | if image == 'Visual Studio 2019': 27 | generator = 'Visual Studio 16 2019' 28 | if platform == 'x64': 29 | cmake_command.extend(['-A', 'x64']) 30 | else: 31 | if image == 'Visual Studio 2015': 32 | generator = 'Visual Studio 14 2015' 33 | elif image == 'Visual Studio 2017': 34 | generator = 'Visual Studio 15 2017' 35 | if platform == 'x64': 36 | generator += ' Win64' 37 | cmake_command.append('-G' + generator) 38 | build_command = ['cmake', '--build', '.', '--config', config, '--', '/m:4'] 39 | test_command = ['ctest', '-C', config] 40 | 41 | check_call(cmake_command) 42 | check_call(build_command) 43 | check_call(test_command) 44 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/appveyor.yml: -------------------------------------------------------------------------------- 1 | configuration: 2 | - Debug 3 | - Release 4 | 5 | clone_depth: 1 6 | 7 | image: 8 | - Visual Studio 2015 9 | - Visual Studio 2019 10 | - Visual Studio 2017 11 | 12 | platform: 13 | - Win32 14 | - x64 15 | 16 | environment: 17 | CTEST_OUTPUT_ON_FAILURE: 1 18 | MSVC_DEFAULT_OPTIONS: ON 19 | BUILD: msvc 20 | 21 | matrix: 22 | exclude: 23 | - image: Visual Studio 2015 24 | platform: Win32 25 | - image: Visual Studio 2019 26 | platform: Win32 27 | 28 | before_build: 29 | - mkdir build 30 | - cd build 31 | 32 | build_script: 33 | - python ../support/appveyor-build.py 34 | 35 | on_failure: 36 | - appveyor PushArtifact Testing/Temporary/LastTest.log 37 | - appveyor AddTest test 38 | 39 | # Uncomment this to debug AppVeyor failures. 40 | #on_finish: 41 | # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) 42 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/cmake/FindSetEnv.cmake: -------------------------------------------------------------------------------- 1 | # A CMake script to find SetEnv.cmd. 2 | 3 | find_program(WINSDK_SETENV NAMES SetEnv.cmd 4 | PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin") 5 | if (WINSDK_SETENV AND PRINT_PATH) 6 | execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${WINSDK_SETENV}") 7 | endif () 8 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/cmake/JoinPaths.cmake: -------------------------------------------------------------------------------- 1 | # This module provides function for joining paths 2 | # known from from most languages 3 | # 4 | # Original license: 5 | # SPDX-License-Identifier: (MIT OR CC0-1.0) 6 | # Explicit permission given to distribute this module under 7 | # the terms of the project as described in /LICENSE.rst. 8 | # Copyright 2020 Jan Tojnar 9 | # https://github.com/jtojnar/cmake-snips 10 | # 11 | # Modelled after Python’s os.path.join 12 | # https://docs.python.org/3.7/library/os.path.html#os.path.join 13 | # Windows not supported 14 | function(join_paths joined_path first_path_segment) 15 | set(temp_path "${first_path_segment}") 16 | foreach(current_segment IN LISTS ARGN) 17 | if(NOT ("${current_segment}" STREQUAL "")) 18 | if(IS_ABSOLUTE "${current_segment}") 19 | set(temp_path "${current_segment}") 20 | else() 21 | set(temp_path "${temp_path}/${current_segment}") 22 | endif() 23 | endif() 24 | endforeach() 25 | set(${joined_path} "${temp_path}" PARENT_SCOPE) 26 | endfunction() 27 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/cmake/cxx14.cmake: -------------------------------------------------------------------------------- 1 | # C++14 feature support detection 2 | 3 | include(CheckCXXSourceCompiles) 4 | include(CheckCXXCompilerFlag) 5 | 6 | if (NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 11) 8 | endif() 9 | message(STATUS "CXX_STANDARD: ${CMAKE_CXX_STANDARD}") 10 | 11 | if (CMAKE_CXX_STANDARD EQUAL 20) 12 | check_cxx_compiler_flag(-std=c++20 has_std_20_flag) 13 | check_cxx_compiler_flag(-std=c++2a has_std_2a_flag) 14 | 15 | if (has_std_20_flag) 16 | set(CXX_STANDARD_FLAG -std=c++20) 17 | elseif (has_std_2a_flag) 18 | set(CXX_STANDARD_FLAG -std=c++2a) 19 | endif () 20 | elseif (CMAKE_CXX_STANDARD EQUAL 17) 21 | check_cxx_compiler_flag(-std=c++17 has_std_17_flag) 22 | check_cxx_compiler_flag(-std=c++1z has_std_1z_flag) 23 | 24 | if (has_std_17_flag) 25 | set(CXX_STANDARD_FLAG -std=c++17) 26 | elseif (has_std_1z_flag) 27 | set(CXX_STANDARD_FLAG -std=c++1z) 28 | endif () 29 | elseif (CMAKE_CXX_STANDARD EQUAL 14) 30 | check_cxx_compiler_flag(-std=c++14 has_std_14_flag) 31 | check_cxx_compiler_flag(-std=c++1y has_std_1y_flag) 32 | 33 | if (has_std_14_flag) 34 | set(CXX_STANDARD_FLAG -std=c++14) 35 | elseif (has_std_1y_flag) 36 | set(CXX_STANDARD_FLAG -std=c++1y) 37 | endif () 38 | elseif (CMAKE_CXX_STANDARD EQUAL 11) 39 | check_cxx_compiler_flag(-std=c++11 has_std_11_flag) 40 | check_cxx_compiler_flag(-std=c++0x has_std_0x_flag) 41 | 42 | if (has_std_11_flag) 43 | set(CXX_STANDARD_FLAG -std=c++11) 44 | elseif (has_std_0x_flag) 45 | set(CXX_STANDARD_FLAG -std=c++0x) 46 | endif () 47 | endif () 48 | 49 | set(CMAKE_REQUIRED_FLAGS ${CXX_STANDARD_FLAG}) 50 | 51 | # Check if user-defined literals are available 52 | check_cxx_source_compiles(" 53 | void operator\"\" _udl(long double); 54 | int main() {}" 55 | SUPPORTS_USER_DEFINED_LITERALS) 56 | if (NOT SUPPORTS_USER_DEFINED_LITERALS) 57 | set (SUPPORTS_USER_DEFINED_LITERALS OFF) 58 | endif () 59 | 60 | # Check if is available 61 | set(CMAKE_REQUIRED_FLAGS -std=c++1z) 62 | check_cxx_source_compiles(" 63 | #include 64 | int main() {}" 65 | FMT_HAS_VARIANT) 66 | if (NOT FMT_HAS_VARIANT) 67 | set (FMT_HAS_VARIANT OFF) 68 | endif () 69 | 70 | set(CMAKE_REQUIRED_FLAGS ) 71 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/cmake/fmt-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake) 4 | check_required_components(fmt) 5 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/cmake/fmt.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@libdir_for_pc_file@ 4 | includedir=@includedir_for_pc_file@ 5 | 6 | Name: fmt 7 | Description: A modern formatting library 8 | Version: @FMT_VERSION@ 9 | Libs: -L${libdir} -l@FMT_LIB_NAME@ 10 | Cflags: -I${includedir} 11 | 12 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/compute-powers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Compute 10 ** exp with exp in the range [min_exponent, max_exponent] and print 3 | # normalized (with most-significant bit equal to 1) significands in hexadecimal. 4 | 5 | from __future__ import print_function 6 | 7 | min_exponent = -348 8 | max_exponent = 340 9 | step = 8 10 | significand_size = 64 11 | exp_offset = 2000 12 | 13 | class fp: 14 | pass 15 | 16 | powers = [] 17 | for i, exp in enumerate(range(min_exponent, max_exponent + 1, step)): 18 | result = fp() 19 | n = 10 ** exp if exp >= 0 else 2 ** exp_offset / 10 ** -exp 20 | k = significand_size + 1 21 | # Convert to binary and round. 22 | binary = '{:b}'.format(n) 23 | result.f = (int('{:0<{}}'.format(binary[:k], k), 2) + 1) / 2 24 | result.e = len(binary) - (exp_offset if exp < 0 else 0) - significand_size 25 | powers.append(result) 26 | # Sanity check. 27 | exp_offset10 = 400 28 | actual = result.f * 10 ** exp_offset10 29 | if result.e > 0: 30 | actual *= 2 ** result.e 31 | else: 32 | for j in range(-result.e): 33 | actual /= 2 34 | expected = 10 ** (exp_offset10 + exp) 35 | precision = len('{}'.format(expected)) - len('{}'.format(actual - expected)) 36 | if precision < 19: 37 | print('low precision:', precision) 38 | exit(1) 39 | 40 | print('Significands:', end='') 41 | for i, fp in enumerate(powers): 42 | if i % 3 == 0: 43 | print(end='\n ') 44 | print(' {:0<#16x}'.format(fp.f, ), end=',') 45 | 46 | print('\n\nExponents:', end='') 47 | for i, fp in enumerate(powers): 48 | if i % 11 == 0: 49 | print(end='\n ') 50 | print(' {:5}'.format(fp.e), end=',') 51 | 52 | print('\n\nMax exponent difference:', 53 | max([x.e - powers[i - 1].e for i, x in enumerate(powers)][1:])) 54 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/rtd/conf.py: -------------------------------------------------------------------------------- 1 | # Sphinx configuration for readthedocs. 2 | 3 | import os, sys 4 | 5 | master_doc = 'index' 6 | html_theme = 'theme' 7 | html_theme_path = ["."] 8 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/rtd/index.rst: -------------------------------------------------------------------------------- 1 | If you are not redirected automatically, follow the 2 | `link to the fmt documentation `_. 3 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/rtd/theme/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "basic/layout.html" %} 2 | 3 | {% block extrahead %} 4 | 5 | 6 | 9 | Page Redirection 10 | {% endblock %} 11 | 12 | {% block document %} 13 | If you are not redirected automatically, follow the link to the fmt documentation. 14 | {% endblock %} 15 | 16 | {% block footer %} 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /code/third_party_libs/fmt/support/rtd/theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | -------------------------------------------------------------------------------- /code/third_party_libs/r8brain-resampler/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | r8brain-free-src Copyright (c) 2013-2019 Aleksey Vaneev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Please credit the creator of this library in your documentation in the 24 | following way: "Sample rate converter designed by Aleksey Vaneev of Voxengo" 25 | -------------------------------------------------------------------------------- /code/third_party_libs/r8brain-resampler/r8bbase.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file r8bbase.cpp 3 | * 4 | * @brief C++ file that should be compiled and included into your application. 5 | * 6 | * This is a single library file that should be compiled and included into the 7 | * project that uses the "r8brain-free-src" sample rate converter. This file 8 | * defines several global static objects used by the library. 9 | * 10 | * You may also need to include to your project: the "Kernel32" library 11 | * (on Windows) and the "pthread" library on Mac OS X and Linux. 12 | * 13 | * r8brain-free-src Copyright (c) 2013-2019 Aleksey Vaneev 14 | * See the "License.txt" file for license. 15 | */ 16 | 17 | #include "CDSPFIRFilter.h" 18 | #include "CDSPFracInterpolator.h" 19 | 20 | namespace r8b { 21 | 22 | #if R8B_FLTTEST 23 | int InterpFilterFracs = -1; 24 | int InterpFilterFracsThird = -1; 25 | #endif // R8B_FLTTEST 26 | 27 | CSyncObject CDSPRealFFTKeeper :: StateSync; 28 | CDSPRealFFT :: CObjKeeper CDSPRealFFTKeeper :: FFTObjects[ 31 ]; 29 | 30 | CSyncObject CDSPFIRFilterCache :: StateSync; 31 | CPtrKeeper< CDSPFIRFilter* > CDSPFIRFilterCache :: Objects; 32 | int CDSPFIRFilterCache :: ObjCount = 0; 33 | 34 | CSyncObject CDSPFracDelayFilterBankCache :: StateSync; 35 | CPtrKeeper< CDSPFracDelayFilterBank* > CDSPFracDelayFilterBankCache :: Objects; 36 | CPtrKeeper< CDSPFracDelayFilterBank* > CDSPFracDelayFilterBankCache :: StaticObjects; 37 | int CDSPFracDelayFilterBankCache :: ObjCount = 0; 38 | 39 | } // namespace r8b 40 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1710146030, 9 | "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 10 | "owner": "numtide", 11 | "repo": "flake-utils", 12 | "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "numtide", 17 | "repo": "flake-utils", 18 | "type": "github" 19 | } 20 | }, 21 | "nixpkgs": { 22 | "locked": { 23 | "lastModified": 1734875076, 24 | "narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=", 25 | "owner": "nixos", 26 | "repo": "nixpkgs", 27 | "rev": "1807c2b91223227ad5599d7067a61665c52d1295", 28 | "type": "github" 29 | }, 30 | "original": { 31 | "owner": "nixos", 32 | "ref": "nixos-24.11", 33 | "repo": "nixpkgs", 34 | "type": "github" 35 | } 36 | }, 37 | "root": { 38 | "inputs": { 39 | "flake-utils": "flake-utils", 40 | "nixpkgs": "nixpkgs" 41 | } 42 | }, 43 | "systems": { 44 | "locked": { 45 | "lastModified": 1681028828, 46 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 47 | "owner": "nix-systems", 48 | "repo": "default", 49 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 50 | "type": "github" 51 | }, 52 | "original": { 53 | "owner": "nix-systems", 54 | "repo": "default", 55 | "type": "github" 56 | } 57 | } 58 | }, 59 | "root": "root", 60 | "version": 7 61 | } 62 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; 4 | flake-utils.url = "github:numtide/flake-utils"; 5 | }; 6 | outputs = 7 | { 8 | self, 9 | nixpkgs, 10 | flake-utils, 11 | }: 12 | # NOTE: not used for macOS - we need AppleClang (installed via Xcode probably) 13 | flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] ( 14 | system: 15 | let 16 | pkgs = import nixpkgs { inherit system; }; 17 | inherit (pkgs.llvmPackages_18) stdenv; 18 | in 19 | { 20 | devShells.default = pkgs.mkShell.override { inherit stdenv; } { 21 | packages = with pkgs; [ 22 | cmake 23 | ninja 24 | just 25 | llvmPackages_18.clang-tools # for clangd 26 | ]; 27 | }; 28 | } 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | alias default := build 2 | alias pre-debug := build 3 | 4 | configure: 5 | mkdir -p build 6 | cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 7 | 8 | build: 9 | cmake --build build 10 | -------------------------------------------------------------------------------- /signet.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "ClangFormat": { 4 | "format_on_save": true 5 | } 6 | }, 7 | "folders": 8 | [ 9 | { 10 | "folder_exclude_patterns": ["build"], 11 | "path": "." 12 | } 13 | ], 14 | "build_systems": 15 | [ 16 | { 17 | "name": "Build", 18 | "working_dir": "$project_path/build", 19 | "shell_cmd": "ninja", 20 | "windows": { 21 | "file_regex": "^(?:\\x1b\\[[;\\d]*[A-Za-z])*(?:[^\\\\\\/]*\\\\\\/)*([^\\s].*)\\((\\d+),?(?:\\d+)?\\)\\s*:\\s+((?>error|warning|fatal error).+)" 22 | }, 23 | "osx": { 24 | "file_regex": "^(?:\\x1b\\[[;\\d]*[A-Za-z])*([^\\s][\\/\\w -\\\\]+):([0-9]+):([0-9]+): (?>fatal error|error|warning): (.+)$" 25 | }, 26 | "variants": [ 27 | { 28 | "name": "Run Tests", 29 | "windows": { 30 | "shell_cmd": "call ninja && call tests.exe --silent", 31 | "file_regex": "^(?:\\x1b\\[[;\\d]*[A-Za-z])*(?:[^\\\\\\/]*\\\\\\/)*([^\\s].*)\\((\\d+),?(?:\\d+)?\\)\\s*:\\s+((?>error|warning|fatal error).+)" 32 | }, 33 | "osx": { 34 | "shell_cmd": "ninja && ./tests", 35 | "file_regex": "^(?:\\x1b\\[[;\\d]*[A-Za-z])*([^\\s][\\/\\w -\\\\]+):([0-9]+):([0-9]+): (?>fatal error|error|warning): (.+)$" 36 | } 37 | }, 38 | { 39 | "name": "CMake", 40 | "shell_cmd": "cmake ../ -G Ninja -DCMAKE_BUILD_TYPE=Debug" 41 | }, 42 | { 43 | "name": "CMake Generate Debug", 44 | "working_dir": "$project_path", 45 | "shell_cmd": "cmake -B build -DCMAKE_BUILD_TYPE:STRING=Debug -G Ninja" 46 | }, 47 | { 48 | "name": "CMake Generate RelWithDebInfo", 49 | "working_dir": "$project_path", 50 | "shell_cmd": "cmake -B build -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -G Ninja" 51 | } 52 | ] 53 | } 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /signet_win32.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | true 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test_data/flac_with_comments.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/flac_with_comments.flac -------------------------------------------------------------------------------- /test_data/sawtooth_unlooped.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/sawtooth_unlooped.flac -------------------------------------------------------------------------------- /test_data/test.flac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/test.flac -------------------------------------------------------------------------------- /test_data/test.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/test.wav -------------------------------------------------------------------------------- /test_data/test_192khz_24bit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/test_192khz_24bit.wav -------------------------------------------------------------------------------- /test_data/test_96khz_24bit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/test_96khz_24bit.wav -------------------------------------------------------------------------------- /test_data/wav_metadata_80bpm_5-4_time_sig.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/wav_metadata_80bpm_5-4_time_sig.wav -------------------------------------------------------------------------------- /test_data/wav_with_bext.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/wav_with_bext.wav -------------------------------------------------------------------------------- /test_data/wav_with_region_and_marker.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/wav_with_region_and_marker.wav -------------------------------------------------------------------------------- /test_data/wave_with_markers_and_loop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/wave_with_markers_and_loop.wav -------------------------------------------------------------------------------- /test_data/white-noise-16-bit-44100-1ch.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/white-noise-16-bit-44100-1ch.aif -------------------------------------------------------------------------------- /test_data/white-noise-24-bit-44100-2ch.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/white-noise-24-bit-44100-2ch.aif -------------------------------------------------------------------------------- /test_data/white-noise-8-bit-96000-1ch.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/white-noise-8-bit-96000-1ch.aif -------------------------------------------------------------------------------- /test_data/white-noise.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamWindell/Signet/6011a68b5941286ae2b7140f85c73565e3340191/test_data/white-noise.wav --------------------------------------------------------------------------------