diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..90dfd01 --- /dev/null +++ b/.clang-format @@ -0,0 +1,121 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: true +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: true + AfterControlStatement: true + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: false + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Merge +# Try and group includes by 'locality' +# We use "" with rel paths for headers in same repo +# Headers in quotes wiht no relative path at top +# Group ../ and ../../ with different priorities, so they get sorted separately +# <> headers *with a folder break* likely not to be STL -> STL / systems headers last +IncludeCategories: + - Regex: '<.+/' + Priority: 4 + - Regex: '"../../' + Priority: 3 + - Regex: '../' # + Priority: 2 + - Regex: '".+hpp"' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: false +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 8 +UseTab: Never +... diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..01a04e6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +* text=auto + +*.yml text +*.gitignore text +*.maxpat text +*.hpp text +*.cmake text +*.md text +*.txt text +*.yaml text + +*.png binary diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index ff7f132..3ffb76a 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -90,22 +90,23 @@ jobs: with: name: winbuild - - uses: dev-drprasad/delete-tag-and-release@v0.2.0 + - uses: dev-drprasad/delete-tag-and-release@v0.2.1 with: delete_release: true # default: false tag_name: nightly # tag name to delete env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: package and upload - uses: softprops/action-gh-release@v1 + - name: create release + uses: ncipollo/release-action@v1 with: name: FluCoMa CLI Nightly Release + artifacts: "FluCoMa*" body: "This is a nightly build of the FluCoMa CLI tools. As such, be warned there may be bugs or other unexpected behaviour. The build hash is ${{ github.sha }}" - files: FluCoMa* + tag: nightly prerelease: true - tag_name: nightly draft: false + allowUpdates: true diff --git a/.gitignore b/.gitignore index f77c605..54ee037 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ winbuild **/.DS_Store release-packaging/ docs +.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index ac534df..4a110a2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) -# Copyright 2017-2019 University of Huddersfield. +# Copyright University of Huddersfield. # Licensed under the BSD-3 License. # See license.md file in the project root for full license information. # This project has received funding from the European Research Council (ERC) diff --git a/LICENSE.md b/LICENSE.md index e0c0ffc..3b3d13c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2017-2020 University of Huddersfield +Copyright University of Huddersfield All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/include/FluidCLIWrapper.hpp b/include/FluidCLIWrapper.hpp index 564acb3..5a19865 100644 --- a/include/FluidCLIWrapper.hpp +++ b/include/FluidCLIWrapper.hpp @@ -1,6 +1,6 @@ /* Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) -Copyright 2017-2019 University of Huddersfield. +Copyright University of Huddersfield. Licensed under the BSD-3 License. See license.md file in the project root for full license information. This project has received funding from the European Research Council (ERC) @@ -10,8 +10,8 @@ under the European Union’s Horizon 2020 research and innovation programme #pragma once -#include -#include +#include +#include #include #include #include @@ -41,15 +41,15 @@ class CLIBufferAdaptor : public BufferAdaptor { // TODO: only read if needed!... - HISSTools::IAudioFile file(mPath); + htl::in_audio_file file(mPath); - mReadError = file.getErrorFlags(); + mReadError = file.error_flags(); - if (file.isOpen()) + if (file.is_open()) { - resize(file.getFrames(), file.getChannels(), file.getSamplingRate()); + resize(file.frames(), file.channels(), file.sampling_rate()); file.seek(); - file.readInterleaved(mData.data(),file.getFrames()); + file.read_interleaved(mData.data(),file.frames()); } } @@ -82,25 +82,25 @@ class CLIBufferAdaptor : public BufferAdaptor { // TODO: file extensions/paths - constexpr auto fileType = HISSTools::BaseAudioFile::kAudioFileWAVE; - constexpr auto depthType = HISSTools::BaseAudioFile::kAudioFileFloat32; + constexpr auto fileType = htl::audio_file_format::file_type::wave; + constexpr auto depthType = htl::audio_file_format::pcm_format::float32; uint16_t chans = static_cast( std::min(asSigned(std::numeric_limits::max()), numChans())); - HISSTools::OAudioFile file(mPath, fileType, depthType, chans, + htl::out_audio_file file(mPath, fileType, depthType, chans, mSamplingRate); - if (file.isOpen()) + if (file.is_open()) { std::cout << "Writing " << mPath << '\n'; file.seek(); - file.writeInterleaved(mData.data(), static_cast(numFrames())); + file.write_interleaved(mData.data(), static_cast(numFrames())); - if(file.getIsError()) + if(file.is_error()) { result = false; - for(auto&& e:file.getErrors()) std::cerr << HISSTools::BaseAudioFile::getErrorString(e) << '\n'; + for(auto&& e:file.get_errors()) std::cerr << file.error_string(e) << '\n'; } } else @@ -385,10 +385,10 @@ class CLIWrapper if(ifile->readError()) { std::cout << ifile->readError() << '\n'; - using Audio = HISSTools::BaseAudioFile; + using AudioFile = htl::base_audio_file; result = false; - std::vector errors = Audio::extractErrorsFromFlags(ifile->readError()); - for(auto&& e:errors) std::cerr << Audio::getErrorString(e) << '\n'; + std::vector errors = AudioFile::extract_errors_from_flags(ifile->readError()); + for(auto&& e:errors) std::cerr << AudioFile::error_string(e) << '\n'; } } } diff --git a/scripts/MakeCLIStub.cmake b/scripts/MakeCLIStub.cmake index 9210b67..70baa1a 100644 --- a/scripts/MakeCLIStub.cmake +++ b/scripts/MakeCLIStub.cmake @@ -1,5 +1,5 @@ # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) -# Copyright 2017-2019 University of Huddersfield. +# Copyright University of Huddersfield. # Licensed under the BSD-3 License. # See license.md file in the project root for full license information. # This project has received funding from the European Research Council (ERC) @@ -34,7 +34,6 @@ function (add_cli_binary name source) PRIVATE FLUID_DECOMPOSITION FLUID_CLI_WRAPPER - HISSTools_AudioFile ) target_include_directories( diff --git a/scripts/target_post.cmake b/scripts/target_post.cmake index 647b75a..1c9d3ef 100644 --- a/scripts/target_post.cmake +++ b/scripts/target_post.cmake @@ -1,5 +1,5 @@ # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) -# Copyright 2017-2019 University of Huddersfield. +# Copyright University of Huddersfield. # Licensed under the BSD-3 License. # See license.md file in the project root for full license information. # This project has received funding from the European Research Council (ERC) @@ -21,7 +21,6 @@ target_link_libraries(${PROG} PRIVATE FLUID_DECOMPOSITION FLUID_CLI_WRAPPER - HISSTools_AudioFile ) target_include_directories(