Projects
Multimedia
rsgain
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
rsgain.changes
Changed
@@ -1,4 +1,41 @@ ------------------------------------------------------------------- +Mon Jun 10 11:24:03 UTC 2024 - Luigi Baldoni <aloisio@gmx.com> + +- Update to version 3.5.1 + * Fix header gain calculation for multichannel Opus files + * Static builds: Upgrade to FFmpeg 7 + version 3.5: + * Add -p option to preserve file modification times + * In Custom Mode, immediately fail if any file in the list + does not exist or is of unsupported type + * Fix segfault that occurs when attempting to tag corrupted + MP4 files + * Provide static builds for macOS and Linux + * Unix: Include optional manpage with installation + * Windows: Support long paths + * Static builds: Upgrade to TagLib 2 + version 3.4: + * Added support for Tom's lossless Audio Kompressor (TAK) + format + * Added -O option 'a' which sorts the output by filename + alphanumerically + * Added Custom Mode -o option 's' which forces Opus files to + normalize to -23 LUFS regardless of the target loudness + setting + * Support files with .mp4 file extension + + Introduce Easy Mode preset option "SkipMP4" which allows + users to opt out of the new behavior + * When scanning completely silent tracks, the program now + writes "0.00 dB" and "0.000000" as gain and peak tags, + respectively. Previously, the program would completely skip + over these files without writing any tags to them + + Silent tracks are not included in album gain calculations + to keep results consistent with previous versions + * -I 'keep' mode now default in both Custom Mode and Easy Mode + * Fix TagMode 'n' option (regression from v3.2) +- Clean up specfile + +------------------------------------------------------------------- Mon Jul 3 05:37:40 UTC 2023 - Philipp Seiler <p.seiler@linuxmail.org> - removed compiler flags that didn't work for now. Will be properly fixed
View file
rsgain.spec
Changed
@@ -1,6 +1,7 @@ # -# spec file for package +# spec file for package rsgain # +# Copyright (c) 2024 Packman Team <packman@links2linux.de> # Copyright (c) 2023 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties @@ -16,39 +17,46 @@ # Name: rsgain -Version: 3.3 -Release: 1 -License: custom +Version: 3.5.1 +Release: 0 +License: BSD-2-Clause AND BSD-3-Clause Summary: ReplayGain 2.0 loudness normalizer -Url: https://www.archlinux.org/packages/community/x86_64/xbmc/ +URL: https://www.archlinux.org/packages/community/x86_64/xbmc/ Group: System/Base -Source0: %{name}-%{version}-source.tar.xz +Source0: https://github.com/complexlogic/rsgain/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: cmake -BuildRequires: gcc12-c++ +BuildRequires: pkgconfig(fmt) +BuildRequires: pkgconfig(inih) BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) -BuildRequires: libtag-devel -BuildRequires: libebur128-devel -BuildRequires: libinih-devel -BuildRequires: fmt-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: pkgconfig(libebur128) +BuildRequires: pkgconfig(taglib) +%if 0%{?suse_version} > 1500 +BuildRequires: gcc-c++ +%else +BuildRequires: gcc13-c++ +%endif %description A modern ReplayGain 2.0 loudness normalizer utility %prep -%setup -q +%autosetup -p1 %build -%cmake \ - -DCMAKE_CXX_COMPILER='/usr/bin/g++-12' \ - -DCMAKE_BUILD_TYPE=Release +export CXX=g++ +test -x "$(type -p g++-13)" && export CXX=g++-13 +%cmake %cmake_build %install %cmake_install +%check + %files +%license LICENSE LICENSE-CRCpp +%doc CHANGELOG README.md %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/presets %{_bindir}/rsgain
View file
rsgain-3.3-source.tar.xz/.github/workflows/build.yml -> rsgain-3.5.1.tar.gz/.github/workflows/build.yml
Changed
@@ -13,10 +13,6 @@ workflow_dispatch: -defaults: - run: - shell: bash - permissions: actions: none checks: none @@ -28,6 +24,11 @@ repository-projects: none security-events: none statuses: read +defaults: + run: + shell: bash +env: + VCPKG_COMMITTISH: 01f602195983451bc83e72f4214af2cbc495aa94 jobs: build_windows: @@ -35,7 +36,6 @@ runs-on: windows-2022 strategy: fail-fast: false - env: CMAKE_BUILD_TYPE: Release CMAKE_GENERATOR: Visual Studio 17 2022 @@ -46,10 +46,12 @@ uses: actions/checkout@v3 with: submodules: true + fetch-depth: 0 - name: Setup vcpkg uses: friendlyanon/setup-vcpkg@v1 - with: { committish: 4f9d25a7f299db656c376af402637819ee2caba0 } + with: + committish: ${{env.VCPKG_COMMITTISH}} - name: Setup Overlays uses: actions/checkout@v3 @@ -60,8 +62,9 @@ - name: Configure run: cmake -S . -B build - -G "${{env.CMAKE_GENERATOR}}" + -G "${{env.CMAKE_GENERATOR}}" -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" + -DVCPKG_MANIFEST_FEATURES="ffmpeg;libebur128;inih;" -DVCPKG_OVERLAY_PORTS=build/overlays/ports -DVCPKG_OVERLAY_TRIPLETS=config/vcpkg_triplets -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}} @@ -96,50 +99,73 @@ matrix: config: - name: Debian - docker_image: debian:bullseye + docker_image: debian:bookworm package_type: DEB package_ext: .deb + vcpkg_features: fmt; - name: Fedora - docker_image: fedora:38 + docker_image: fedora:39 package_type: RPM package_ext: .rpm + vcpkg_features: fmt; + + - name: Static + docker_image: debian:bullseye + package_type: TXZ + package_ext: .tar.xz + vcpkg_features: fmt;ffmpeg;libebur128;inih; container: image: ${{matrix.config.docker_image}} env: CMAKE_BUILD_TYPE: Release - VCPKG_COMMITISH: 4f9d25a7f299db656c376af402637819ee2caba0 VCPKG_TRIPLET: x64-linux steps: - name: Checkout Git repository uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: "Install dependencies" run: | if "${{matrix.config.name}}" == "Debian" ; then - apt update && apt install -y curl zip unzip tar build-essential git cmake pkg-config libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libebur128-dev libinih-dev + apt update && apt install -y curl zip unzip gzip tar build-essential git cmake pkg-config libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libebur128-dev libinih-dev binutils fi if "${{matrix.config.name}}" == "Fedora" ; then - dnf install -y curl zip unzip tar git make pkg-config gcc-c++ fedora-packager rpmdevtools cmake libavcodec-free-devel libavformat-free-devel libswresample-free-devel libavutil-free-devel libebur128-devel taglib-devel inih-devel + dnf install -y curl zip unzip gzip tar git make pkg-config gcc-c++ fedora-packager rpmdevtools cmake libavcodec-free-devel libavformat-free-devel libswresample-free-devel libavutil-free-devel libebur128-devel inih-devel + fi + if "${{matrix.config.name}}" == "Static" ; then + apt update && apt install -y curl zip unzip tar build-essential git cmake pkg-config python3 nasm binutils fi - name: Setup vcpkg uses: friendlyanon/setup-vcpkg@v1 with: - committish: ${{env.VCPKG_COMMITISH}} + committish: ${{env.VCPKG_COMMITTISH}} cache-key: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}} cache-restore-keys: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}} + - name: Setup Overlays + uses: actions/checkout@v3 + with: + repository: complexlogic/vcpkg + ref: refs/heads/rsgain + path: build/overlays + - name: Configure run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}} + -DVCPKG_MANIFEST_FEATURES="${{matrix.config.vcpkg_features}}" + -DVCPKG_OVERLAY_PORTS=build/overlays/ports -DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DPACKAGE=${{matrix.config.package_type}} + -DSTRIP_BINARY=ON + -DINSTALL_MANPAGE=${{matrix.config.name == 'Debian' && 'ON' || 'OFF'}} - name: Build run: | @@ -168,6 +194,15 @@ packages: write strategy: fail-fast: false + matrix: + config: + - name: Intel + OSX_ARCH: x86_64 + VCPKG_TRIPLET: x64-osx + + - name: Apple Silicon + OSX_ARCH: arm64 + VCPKG_TRIPLET: arm64-osx env: CMAKE_BUILD_TYPE: Release @@ -175,20 +210,57 @@ steps: - name: Checkout Git repository uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: "Install dependencies" - run: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew install libebur128 taglib ffmpeg fmt inih cmake pkg-config || true + - name: Install Dependencies + run: brew install nasm automake autoconf-archive ninja + + - name: Setup vcpkg + uses: friendlyanon/setup-vcpkg@v1 + with: + committish: ${{env.VCPKG_COMMITTISH}} + cache-key: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}} + cache-restore-keys: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}} + + - name: Setup Overlays + uses: actions/checkout@v3 + with: + repository: complexlogic/vcpkg + ref: refs/heads/rsgain + path: build/overlays - name: Configure run: cmake -S . -B build - -DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} - -DCMAKE_INSTALL_PREFIX=/usr + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_OSX_ARCHITECTURES=${{matrix.config.OSX_ARCH}} + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" + -DVCPKG_OVERLAY_PORTS=build/overlays/ports + -DVCPKG_TARGET_TRIPLET=${{matrix.config.VCPKG_TRIPLET}} + -DVCPKG_MANIFEST_FEATURES="fmt;ffmpeg;libebur128;inih;" + -DSTRIP_BINARY=ON + -DPACKAGE=ZIP + -DCPACK_SYSTEM_NAME="macOS-${{matrix.config.OSX_ARCH}}" - name: Build run: | cmake \ --build build \ - --config ${{env.CMAKE_BUILD_TYPE}} - build/rsgain -v
View file
rsgain-3.3-source.tar.xz/CHANGELOG -> rsgain-3.5.1.tar.gz/CHANGELOG
Changed
@@ -1,3 +1,28 @@ +v3.5.1 (2024-06-08) +- Fix header gain calculation for multichannel Opus files +- Static builds: Upgrade to FFmpeg 7 + +v3.5 (2024-02-25) +- Add -p option to preserve file modification times +- In Custom Mode, immediately fail if any file in the list does not exist or is of unsupported type +- Fix segfault that occurs when attempting to tag corrupted MP4 files +- Provide static builds for macOS and Linux +- Unix: Include optional manpage with installation +- Windows: Support long paths +- Static builds: Upgrade to TagLib 2 + +v3.4 (2023-09-11) +- Added support for Tom's lossless Audio Kompressor (TAK) format +- Added -O option 'a' which sorts the output by filename alphanumerically +- Added Custom Mode -o option 's' which forces Opus files to normalize to -23 LUFS regardless of the target loudness setting +- Support files with .mp4 file extension + - Introduce Easy Mode preset option "SkipMP4" which allows users to opt out of the new behavior +- When scanning completely silent tracks, the program now writes "0.00 dB" and "0.000000" as gain and peak tags, respectively. Previously, the program would completely skip over these files without writing any tags to them + - Silent tracks are not included in album gain calculations to keep results consistent with previous versions +- -I 'keep' mode now default in both Custom Mode and Easy Mode +- Fix TagMode 'n' option (regression from v3.2) + + v3.3 (2023-04-23) - New -I mode 'keep' detects the file's existing ID3v2 version, and preserves it - Less disruptive to files, less prone to data loss as TagLib sometimes discards frames when converting between ID3v2 versions.
View file
rsgain-3.3-source.tar.xz/CMakeLists.txt -> rsgain-3.5.1.tar.gz/CMakeLists.txt
Changed
@@ -5,8 +5,13 @@ # This file is released under the 2 clause BSD license, see COPYING cmake_minimum_required(VERSION 3.13) +option(VCPKG "Build dependencies with vcpkg" OFF) +if (VCPKG) + include("${CMAKE_SOURCE_DIR}/config/vcpkg.cmake") +endif () + project(rsgain - VERSION 3.3 + VERSION 3.5.1 DESCRIPTION "ReplayGain 2.0 loudness normalizer" HOMEPAGE_URL "https://github.com/complexlogic/rsgain" LANGUAGES CXX @@ -15,6 +20,7 @@ set(MAXPROGBARWIDTH "0" CACHE STRING "Maximum width of progress bar") option(UCHECKMARKS "Enable use of Unicode checkmarks" ON) option(EXTRA_WARNINGS "Enable extra compiler warnings" OFF) +option(INSTALL_MANPAGE "Install man page (requires gzip)" OFF) if (EXTRA_WARNINGS) if (MSVC) add_compile_options(/W4 /WX) @@ -27,6 +33,23 @@ set(EXECUTABLE_TITLE "rsgain") include_directories(${PROJECT_BINARY_DIR}) add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG>") +if (WIN32) + set (USE_STD_FORMAT true) + if (MSVC_VERSION AND MSVC_VERSION VERSION_LESS 1937) + message(FATAL_ERROR "Visual Studio 17.7 and later supported only") + endif () +endif () +if (USE_STD_FORMAT) + if (UNIX) + include(CheckIncludeFiles) + CHECK_INCLUDE_FILES("format;print" SUPPORT_STD_FORMAT LANGUAGE CXX) + if (NOT SUPPORT_STD_FORMAT) + message(FATAL_ERROR "You do not have the required system headers for std::format and/or std::print") + endif () + endif () + add_compile_definitions(USE_STD_FORMAT) + set(CMAKE_CXX_STANDARD 23) +endif () # GCC 9 and earlier are not supported due to C++20 features if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) @@ -38,6 +61,27 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXECUTABLE_TITLE}) endif () +# Embed Git information +find_package(Git QUIET) +if (Git_FOUND) + execute_process(COMMAND "${GIT_EXECUTABLE}" describe --long --tags + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + OUTPUT_VARIABLE GIT_OUTPUT + RESULT_VARIABLE GIT_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (GIT_RESULT EQUAL 0) + string(REPLACE "-" ";" GIT_LIST "${GIT_OUTPUT}") + list(GET GIT_LIST 1 COMMITS_SINCE_TAG) + if (NOT COMMITS_SINCE_TAG STREQUAL "0") + list(GET GIT_LIST 2 COMMIT_HASH) + string(REPLACE "g" "" COMMIT_HASH "${COMMIT_HASH}") + add_compile_definitions(COMMITS_SINCE_TAG=\"${COMMITS_SINCE_TAG}\") + add_compile_definitions(COMMIT_HASH=\"${COMMIT_HASH}\") + endif () + endif () +endif () + # Find dependencies - Windows if (WIN32) find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h" REQUIRED) @@ -49,8 +93,6 @@ find_library(TAGLIB tag REQUIRED) find_path(LIBEBUR128_INCLUDE_DIR "ebur128.h" REQUIRED) find_library(LIBEBUR128 ebur128 REQUIRED) - find_path(FMT_INCLUDE_DIR "fmt/core.h" REQUIRED) - find_library(FMT fmt REQUIRED) find_path(GETOPT_INCLUDE_DIR "getopt.h" REQUIRED) find_library(GETOPT getopt REQUIRED) find_path(INIH_INCLUDE_DIR "ini.h" REQUIRED) @@ -63,10 +105,6 @@ # Find dependencies - Linux/Mac elseif (UNIX) - if (APPLE) - link_directories(/usr/local/lib) # Fix linking on 10.14+. See https://stackoverflow.com/questions/54068035 - endif (APPLE) - find_package(PkgConfig MODULE REQUIRED) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -77,7 +115,15 @@ pkg_check_modules(TAGLIB REQUIRED IMPORTED_TARGET taglib>=1.11.1) pkg_check_modules(LIBEBUR128 REQUIRED IMPORTED_TARGET libebur128>=1.2.4) pkg_check_modules(INIH REQUIRED IMPORTED_TARGET inih) - pkg_check_modules(FMT REQUIRED IMPORTED_TARGET fmt) + if (STRIP_BINARY) + find_program(STRIP strip REQUIRED) + endif () + if (INSTALL_MANPAGE) + find_program(GZIP gzip REQUIRED) + endif () + if (NOT USE_STD_FORMAT) + pkg_check_modules(FMT REQUIRED IMPORTED_TARGET fmt) + endif () endif() # Generate Windows application manifest and resource file @@ -104,7 +150,7 @@ # Installation - Windows if (WIN32) install(DIRECTORY ${PROJECT_BINARY_DIR}/$<CONFIG>/ DESTINATION .) - foreach(item CHANGELOG LICENSE) + foreach(item CHANGELOG LICENSE LICENSE-CRCpp) configure_file("${PROJECT_SOURCE_DIR}/${item}" "${PROJECT_BINARY_DIR}/${item}.txt") install(FILES "${PROJECT_BINARY_DIR}/${item}.txt" DESTINATION .) endforeach () @@ -137,14 +183,28 @@ # Installation - Linux/Mac elseif (UNIX) install(TARGETS ${EXECUTABLE_TITLE} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") + if (INSTALL_MANPAGE) + install(FILES "${PROJECT_BINARY_DIR}/${EXECUTABLE_TITLE}.1.gz" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1") + endif () install(DIRECTORY "${PROJECT_SOURCE_DIR}/config/presets" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${EXECUTABLE_TITLE}") + if (PACKAGE STREQUAL "TXZ" OR PACKAGE STREQUAL "ZIP") + set(BINARY_PREFIX ".") + set(PRESETS_PREFIX ".") + else () + set(BINARY_PREFIX "${CMAKE_INSTALL_PREFIX}/bin") + set(PRESETS_PREFIX "${CMAKE_INSTALL_PREFIX}/share/${EXECUTABLE_TITLE}") + endif () + install(TARGETS ${EXECUTABLE_TITLE} DESTINATION "${BINARY_PREFIX}") + install(DIRECTORY "${PROJECT_SOURCE_DIR}/config/presets" DESTINATION "${PRESETS_PREFIX}") set(PRESETS_DIR ${CMAKE_INSTALL_PREFIX}/share/${EXECUTABLE_TITLE}/presets) # Build Debian packages if (PACKAGE STREQUAL "DEB") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") - set(CPACK_DEBIAN_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION}) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavcodec58 (>= 4.2.4), libavutil56 (>= 4.2.4), libswresample3 (>= 4.2.4), libavformat58 (>= 4.2.4), libebur128-1 (>=1.2.4), libinih1, libc6 (>=2.29), libstdc++6 (>=10.2), zlib1g") + if (COMMITS_SINCE_TAG AND COMMIT_HASH) + set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}-r${COMMITS_SINCE_TAG}-${COMMIT_HASH}") + endif () + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavcodec59 (>= 5.1), libavutil57 (>= 5.1), libswresample4 (>= 5.1), libavformat59 (>= 5.1), libebur128-1 (>=1.2.4), libinih1, libc6 (>=2.29), libstdc++6 (>=10.2), zlib1g") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "complexlogic") set(CPACK_DEBIAN_PACKAGE_SECTION "utils") set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") @@ -154,10 +214,15 @@ # Build Fedora packages elseif (PACKAGE STREQUAL "RPM") set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + if (COMMITS_SINCE_TAG AND COMMIT_HASH) + set(CPACK_RPM_PACKAGE_VERSION "${PROJECT_VERSION}-r${COMMITS_SINCE_TAG}-${COMMIT_HASH}") + endif () set(CPACK_RPM_PACKAGE_LICENSE "BSD") set(CPACK_RPM_PACKAGE_GROUP "Applications/Multimedia") set(CPACK_RPM_PACKAGE_AUTOREQPROV 0) - set(CPACK_RPM_PACKAGE_REQUIRES "libavcodec-free >= 6, libavformat-free >= 56, libswresample-free >= 6, libavutil-free >= 6, libebur128, zlib, inih") + set(CPACK_RPM_PACKAGE_REQUIRES "libavcodec-free >= 6, libavformat-free >= 6, libswresample-free >= 6, libavutil-free >= 6, libebur128, zlib, inih") + elseif (PACKAGE STREQUAL "TXZ") + set(CPACK_ARCHIVE_FILE_EXTENSION ".tar.xz") endif () if (PACKAGE) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION}) @@ -167,14 +232,11 @@ include(CPack) endif () - # Provide 'uninstall' target - if(NOT TARGET uninstall) - configure_file( - "${PROJECT_SOURCE_DIR}/config/cmake_uninstall.cmake.in" - "${PROJECT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) - add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake) - endif() + configure_file( + "${PROJECT_SOURCE_DIR}/config/cmake_uninstall.cmake.in" + "${PROJECT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/cmake_uninstall.cmake) endif() configure_file("${PROJECT_SOURCE_DIR}/config/config.h.in" "${PROJECT_BINARY_DIR}/config.h")
View file
rsgain-3.3-source.tar.xz/Dockerfile -> rsgain-3.5.1.tar.gz/Dockerfile
Changed
@@ -1,6 +1,6 @@ -FROM debian +FROM debian:bookworm -ARG VERSION=3.3 \ +ARG VERSION=3.5.1 \ ARCH=amd64 RUN apt-get update && \
View file
rsgain-3.5.1.tar.gz/LICENSE-CRCpp
Added
@@ -0,0 +1,28 @@ +CRC++ +Copyright (c) 2022, Daniel Bahr +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of CRC++ nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View file
rsgain-3.3-source.tar.xz/README.md -> rsgain-3.5.1.tar.gz/README.md
Changed
@@ -4,6 +4,12 @@ 1. About(#about) 2. Installation(#installation) + - Windows(#windows) + - macOS(#macos) + - Linux(#linux) + - FreeBSD(#freebsd) + - Android(#android) + - Docker(#docker) 3. Supported File Formats(#supported-file-formats) 4. Usage(#usage) - Easy Mode(#easy-mode) @@ -14,7 +20,7 @@ ## About -**rsgain** (**r**eally **s**imple **gain**) is a ReplayGain 2.0 command line utility for Windows, macOS, Linux, and BSD. rsgain applies loudness metadata tags to your files, while leaving the audio stream untouched. A ReplayGain-compatible player will dynamically adjust the volume of your tagged files during playback. +**rsgain** (**r**eally **s**imple **gain**) is a ReplayGain 2.0 command line utility for Windows, macOS, Linux, BSD, and Android. rsgain applies loudness metadata tags to your files, while leaving the audio stream untouched. A ReplayGain-compatible player will dynamically adjust the volume of your tagged files during playback. rsgain is designed with a "batteries included" philosophy, allowing a user to scan their entire music library without requiring external scripts or other tools. It aims to strike the perfect balance between power and simplicity by providing multiple user interfaces. See Usage(#usage) for more information. @@ -22,12 +28,12 @@ ## Installation -Binary packages are available for some platforms on the Release Page(https://github.com/complexlogic/rsgain/releases). You can also build the program yourself, see BUILDING(docs/BUILDING.md). +Binary packages are available on the Release Page(https://github.com/complexlogic/rsgain/releases) for Windows, macOS, and some Linux distributions. You can also build the program yourself, see BUILDING(docs/BUILDING.md). ### Windows Download the ZIP file from the link below and extract its contents to a folder of your choice: -- rsgain v3.3 portable ZIP (x64)(https://github.com/complexlogic/rsgain/releases/download/v3.3/rsgain-3.3-win64.zip) +- rsgain v3.5.1 portable ZIP (x64)(https://github.com/complexlogic/rsgain/releases/download/v3.5.1/rsgain-3.5.1-win64.zip) rsgain should be run on Windows 10 or later for full compatibility, but it can run on Windows versions as early as Vista with some caveats. See Windows Notes(#windows-notes) for more information. @@ -39,58 +45,101 @@ #### Scoop -rsgain can also be installed from several community Scoop buckets(https://scoop.sh/#/apps?q=rsgain&s=0&d=1&o=false). This installation method enables you to receive automatic upgrades to future versions, unlike the manual installation method described above. +rsgain is available in the Scoop(https://scoop.sh/) extras bucket. Installing via Scoop enables you to receive automatic upgrades to future versions, unlike the manual installation method described above. -### macOS - -There is a Homebrew formula available for macOS users. Make sure you have the latest available Xcode installed, as well as Homebrew. Then, execute the following command: +First, make sure you have enabled the extras bucket. Then, install using the command below: -```bash -brew install complexlogic/tap/rsgain +```powershell +scoop install extras/rsgain ``` -### FreeBSD +### macOS -Available via ports tree or using packages (2023Q1 and later) as listed below: +Separate builds are available for Apple Silicon and Intel based Macs. Both require macOS 12 (Monterey) or later. Download and extract the correct version according to your hardware: +- rsgain v3.5.1 portable ZIP (Apple Silicon)(https://github.com/complexlogic/rsgain/releases/download/v3.5.1/rsgain-3.5.1-macOS-arm64.zip) +- rsgain v3.5.1 portable ZIP (Intel)(https://github.com/complexlogic/rsgain/releases/download/v3.5.1/rsgain-3.5.1-macOS-x86_64.zip) -```bash -cd /usr/ports/audio/rsgain && make install clean +These builds are not codesigned, and the macOS Gatekeeper will most likely block execution. To work around this, you can remove the quarantine bit using the command below: -pkg install rsgain +```bash +xattr -d com.apple.quarantine /path/to/rsgain ``` +Substitute `/path/to/rsgain` with the actual path on your system. + ### Linux #### Debian/Ubuntu -An amd64 .deb package is provided on the release page(https://github.com/complexlogic/rsgain/releases/latest). It is installable on Debian Bullseye and later, Ubuntu 21.04 and later. It can be installed with the following commands: +rsgain is available as an official Debian package starting in Debian 13 (Trixie) and Ubuntu 24.04 (noble). Install via `apt`: + +```bash +sudo apt install rsgain +``` + +There is also a .deb package for Debian Bookworm available on the release page(https://github.com/complexlogic/rsgain/releases/latest). Use the following commands to install: ```bash -wget https://github.com/complexlogic/rsgain/releases/download/v3.3/rsgain_3.3_amd64.deb -sudo apt install ./rsgain_3.3_amd64.deb +wget https://github.com/complexlogic/rsgain/releases/download/v3.5.1/rsgain_3.5.1-1_amd64.deb +sudo apt install ./rsgain_3.5.1-1_amd64.deb ``` +The above package won't work on recent Ubuntu releases due to an FFmpeg ABI break. #### Arch/Manjaro -There is an AUR package rsgain-git(https://aur.archlinux.org/packages/rsgain-git) based on the current `master` (which is relatively stable). You can install it with an AUR helper such as yay: +rsgain is available in the AUR via the packages rsgain(https://aur.archlinux.org/packages/rsgain) and rgsain-git(https://aur.archlinux.org/packages/rsgain-git). You can install with an AUR helper such as `yay`: ```bash -yay -S rsgain-git +yay -S rsgain ``` -There is also a PKGBUILD script based on the latest release source tarball located in the `config` directory of the repo. - #### Fedora -A package is available on the release page(https://github.com/complexlogic/rsgain/releases/latest) that is compatible with Fedora 38. +rsgain is packaged in Fedora's repositories. You can use `dnf` to install: + +```bash +sudo dnf install rsgain +``` + +#### Nix/NixOS + +`rsgain` is in nixpkgs(https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/rs/rsgain/package.nix). Some options: + +- Run it without installing: + ```sh + nix run nixpkgs#rsgain + ``` +- Install it in your Nix environment: + ```sh + nix-env -f '<nixpkgs>' -iA rsgain + ``` +- Add it to your NixOS configuration: + ```nix + environment.systemPackages = with pkgs; rsgain ; + ``` + +#### Static Build + +An x86_64 static build is available that should run on recent releases of most GNU-based Linux distros (any distro shipping GCC 10 or later). Download the archive below and extract it to a directory of your choice: +- rsgain v3.5.1 portable TAR (x86_64)(https://github.com/complexlogic/rsgain/releases/download/v3.5.1/rsgain-3.5.1-Linux.tar.xz) + +### FreeBSD + +Available via ports tree or using packages (2023Q1 and later) as listed below: ```bash -sudo dnf install https://github.com/complexlogic/rsgain/releases/download/v3.3/rsgain-3.3-1.x86_64.rpm +cd /usr/ports/audio/rsgain && make install clean + +pkg install rsgain ``` -#### Others +### Android -Users of other distros will need to build from source. See BUILDING(docs/BUILDING.md). +rsgain can be installed on Android devices via the Termux(https://termux.dev/en/) terminal emulator package manager: + +```bash +pkg install rsgain +``` ### Docker @@ -112,7 +161,7 @@ ## Supported file formats -rsgain supports all popular file formats. See the below table for compatibility. It should be noted that rsgain sorts files internally based on file extension, so it is required that your audio files match one of the extensions in the second column of the table in order to be recognized as valid. +rsgain supports all popular file formats. See the below table for compatibility. rsgain sorts files internally based on file extension, so it is required that your audio files match one of the extensions in the second column of the table in order to be recognized as valid. | Format | Supported File Extension(s) | | ------------------------------------ | --------------------------- | @@ -125,11 +174,12 @@ | Musepack (MPC)² | .mpc | | Ogg (Vorbis, Speex, FLAC) | .ogg, .oga, .spx | | Opus | .opus | +| Tom's lossless Audio Kompressor | .tak | | Waveform Audio File Format (WAV) | .wav | | Wavpack | .wv | | Windows Media Audio (WMA) | .wma | -1. *Support for HE-AAC and xHE-AAC are available via the Fraunhofer AAC library. On Windows, the statically-linked FFmpeg already includes support, so no further action is required. On Unix platforms, you will need to check if your build of FFmpeg was compiled with the '--enable-libfdk-aac' option, and compile it yourself if necessary* +1. *Support for HE-AAC and xHE-AAC are available via the Fraunhofer FDK AAC library. For the static builds, the included FFmpeg was compiled with support, so no further action is required. For the dynamic builds, you will need to check if your build of FFmpeg was compiled with the '--enable-libfdk-aac' option, and compile it yourself if necessary* 2. *Stream Version 8 (SV8) supported only. If you have files in the older SV7 format, you can convert them losslessly to SV8* ## Usage @@ -185,6 +235,12 @@ Microsoft Excel doesn't recognize the tab delimiter in CSV files by default. To enable Excel compatibility, rsgain has an option `-Os` which will add a `sep` header to the CSV file. This is a non-standard Microsoft extension which will enable the outputted CSV files to open in Excel. +##### Sorting + +If you want the output sorted alphanumerically by filename, use the 'a' option, e.g. `-Oa`. + +The options can be chained. For example, if you want both Excel compatibility and alphanumeric sorting, you can pass `-Oas`. + #### Scan Presets Easy Mode scans files with the following settings by default: @@ -194,7 +250,7 @@ - Sample peak calculations for peak tags - Clipping protection enabled for positive gain values only (0 dB max peak)
View file
rsgain-3.3-source.tar.xz/config/PKGBUILD -> rsgain-3.5.1.tar.gz/config/PKGBUILD
Changed
@@ -1,5 +1,5 @@ pkgname=rsgain -pkgver=3.3 +pkgver=3.5.1 pkgrel=1 epoch= pkgdesc="ReplayGain 2.0 loudness normalizer"
View file
rsgain-3.3-source.tar.xz/config/presets/default.ini -> rsgain-3.5.1.tar.gz/config/presets/default.ini
Changed
@@ -6,8 +6,9 @@ MaxPeakLevel=0.0 TruePeak=false Lowercase=false -ID3v2Version=3 +ID3v2Version=keep OpusMode=d +PreserveMtimes=false MP3 #TagMode=i @@ -17,7 +18,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false FLAC #TagMode=i @@ -26,6 +28,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false Ogg #TagMode=i @@ -34,6 +37,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false Opus #TagMode=i @@ -43,6 +47,7 @@ #MaxPeakLevel=0.0 #TruePeak=false #OpusMode=d +#PreserveMtimes=false M4A #TagMode=i @@ -52,6 +57,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false +#SkipMP4=false +#PreserveMtimes=false WMA #TagMode=i @@ -61,6 +68,7 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false +#PreserveMtimes=false MP2 #TagMode=i @@ -70,7 +78,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false WAV #TagMode=i @@ -80,7 +89,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false AIFF #TagMode=i @@ -90,7 +100,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false Wavpack #TagMode=i @@ -99,6 +110,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false APE #TagMode=i @@ -107,6 +119,16 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false + +TAK +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false Musepack #TagMode=i @@ -115,3 +137,4 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false
View file
rsgain-3.3-source.tar.xz/config/presets/ebur128.ini -> rsgain-3.5.1.tar.gz/config/presets/ebur128.ini
Changed
@@ -6,8 +6,9 @@ MaxPeakLevel=-1.0 TruePeak=true Lowercase=false -ID3v2Version=3 +ID3v2Version=keep OpusMode=d +PreserveMtimes=false MP3 #TagMode=i @@ -17,7 +18,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false FLAC #TagMode=i @@ -26,6 +28,7 @@ #ClipMode=p #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false Ogg #TagMode=i @@ -34,6 +37,7 @@ #ClipMode=p #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false Opus #TagMode=i @@ -43,6 +47,7 @@ #MaxPeakLevel=-1.0 #TruePeak=true #OpusMode=d +#PreserveMtimes=false M4A #TagMode=i @@ -52,6 +57,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false +#SkipMP4=false +#PreserveMtimes=false WMA #TagMode=i @@ -61,6 +68,7 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false +#PreserveMtimes=false MP2 #TagMode=i @@ -70,7 +78,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false WAV #TagMode=i @@ -80,7 +89,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false AIFF #TagMode=i @@ -90,7 +100,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false Wavpack #TagMode=i @@ -99,6 +110,7 @@ #ClipMode=p #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false APE #TagMode=i @@ -107,6 +119,16 @@ #ClipMode=p #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false + +TAK +#TagMode=i +#Album=true +#TargetLoudness=-23 +#ClipMode=p +#MaxPeakLevel=-1.0 +#TruePeak=true +#PreserveMtimes=false Musepack #TagMode=i @@ -115,3 +137,4 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false
View file
rsgain-3.3-source.tar.xz/config/presets/loudgain.ini -> rsgain-3.5.1.tar.gz/config/presets/loudgain.ini
Changed
@@ -8,6 +8,7 @@ Lowercase=true ID3v2Version=3 OpusMode=r +PreserveMtimes=false MP3 #TagMode=i @@ -18,6 +19,7 @@ #TruePeak=true #Lowercase=true #ID3v2Version=3 +#PreserveMtimes=false FLAC #TagMode=i @@ -26,6 +28,7 @@ #ClipMode=a #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false Ogg #TagMode=i @@ -34,6 +37,7 @@ #ClipMode=a #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false Opus #TagMode=i @@ -43,6 +47,7 @@ #MaxPeakLevel=-1.0 #TruePeak=true #OpusMode=r +#PreserveMtimes=false M4A #TagMode=i @@ -52,6 +57,8 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=true +#SkipMP4=false +#PreserveMtimes=false WMA #TagMode=i @@ -61,6 +68,7 @@ #MaxPeakLevel=-1.0 #TruePeak=true #Lowercase=true +#PreserveMtimes=false MP2 #TagMode=i @@ -71,6 +79,7 @@ #TruePeak=true #Lowercase=true #ID3v2Version=3 +#PreserveMtimes=false WAV #TagMode=i @@ -81,6 +90,7 @@ #TruePeak=true #Lowercase=true #ID3v2Version=3 +#PreserveMtimes=false AIFF #TagMode=i @@ -91,6 +101,7 @@ #TruePeak=true #Lowercase=true #ID3v2Version=3 +#PreserveMtimes=false Wavpack #TagMode=i @@ -99,6 +110,7 @@ #ClipMode=a #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false APE #TagMode=i @@ -107,6 +119,16 @@ #ClipMode=a #MaxPeakLevel=-1.0 #TruePeak=true +#PreserveMtimes=false + +TAK +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=a +#MaxPeakLevel=-1.0 +#TruePeak=true +#PreserveMtimes=false Musepack #TagMode=i @@ -115,3 +137,4 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false
View file
rsgain-3.3-source.tar.xz/config/presets/no_album.ini -> rsgain-3.5.1.tar.gz/config/presets/no_album.ini
Changed
@@ -6,8 +6,9 @@ MaxPeakLevel=0.0 TruePeak=false Lowercase=false -ID3v2Version=3 +ID3v2Version=keep OpusMode=d +PreserveMtimes=false MP3 #TagMode=i @@ -17,7 +18,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false FLAC #TagMode=i @@ -26,6 +28,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false Ogg #TagMode=i @@ -34,6 +37,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false Opus #TagMode=i @@ -43,6 +47,7 @@ #MaxPeakLevel=0.0 #TruePeak=false #OpusMode=d +#PreserveMtimes=false M4A #TagMode=i @@ -52,6 +57,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false +#SkipMP4=false +#PreserveMtimes=false WMA #TagMode=i @@ -61,6 +68,7 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false +#PreserveMtimes=false MP2 #TagMode=i @@ -70,7 +78,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false WAV #TagMode=i @@ -80,7 +89,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false AIFF #TagMode=i @@ -90,7 +100,8 @@ #MaxPeakLevel=0.0 #TruePeak=false #Lowercase=false -#ID3v2Version=3 +#ID3v2Version=keep +#PreserveMtimes=false Wavpack #TagMode=i @@ -99,6 +110,7 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false APE #TagMode=i @@ -107,6 +119,16 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false + +TAK +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false Musepack #TagMode=i @@ -115,3 +137,4 @@ #ClipMode=p #MaxPeakLevel=0.0 #TruePeak=false +#PreserveMtimes=false
View file
rsgain-3.3-source.tar.xz/config/rsgain.manifest.in -> rsgain-3.5.1.tar.gz/config/rsgain.manifest.in
Changed
@@ -4,6 +4,7 @@ <application> <windowsSettings> <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage> + <longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> </windowsSettings> </application> </assembly>
View file
rsgain-3.5.1.tar.gz/config/vcpkg.cmake
Added
@@ -0,0 +1,31 @@ +message("Setting up vcpkg...") +include(FetchContent) +FetchContent_Declare( + vcpkg + GIT_REPOSITORY https://github.com/microsoft/vcpkg.git + GIT_SHALLOW TRUE + SOURCE_DIR ${PROJECT_BINARY_DIR} +) +FetchContent_Declare( + vcpkg_overlay + GIT_REPOSITORY https://github.com/complexlogic/vcpkg.git + GIT_TAG origin/rsgain + GIT_SHALLOW TRUE + SOURCE_DIR ${PROJECT_BINARY_DIR} +) +FetchContent_MakeAvailable(vcpkg vcpkg_overlay) +set(VCPKG_OVERLAY_PORTS "${CMAKE_BINARY_DIR}/_deps/vcpkg_overlay-src/ports") + +if (WIN32) + if (NOT VCPKG_MANIFEST_FEATURES) + set(VCPKG_MANIFEST_FEATURES ffmpeg libebur128 inih) + endif () + if (NOT VCPKG_OVERLAY_TRIPLETS) + list(APPEND VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/config/vcpkg_triplets") + endif () + if (NOT VCPKG_TARGET_TRIPLET) + set (VCPKG_TARGET_TRIPLET "custom-triplet") + endif () +endif () + +set(CMAKE_TOOLCHAIN_FILE "${CMAKE_BINARY_DIR}/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake")
View file
rsgain-3.3-source.tar.xz/docs/BUILDING.md -> rsgain-3.5.1.tar.gz/docs/BUILDING.md
Changed
@@ -2,22 +2,28 @@ rsgain builds natively on Unix and Windows, and features a cross-platform CMake build system. The following external dependencies are required: -- libebur128 -- taglib +- libebur128(https://github.com/jiixyj/libebur128) or ebur128(https://github.com/sdroege/ebur128) +- TagLib - FFmpeg, specifically the libraries: + libavformat + libavcodec + libswresample + libavutil -- fmt - inih +- Unix only: fmt (see below(#fmt-library)) -The source code is written in C++20, and as such requires a relatively modern compiler to build: +The Windows version uses C++23, and the Unix versions use either C++20 or C++23 depending on the compiler. As such, it requires a relatively modern compiler to build: -- On Windows, use Visual Studio 2022 +- On Windows, Visual Studio 2022 17.7 or later is required - On Linux, use GCC 10 or later - On macOS, the latest available Xcode for your machine should work +### fmt library + +The features that rsgain uses from the fmt library have been integrated into the C++20 and C++23 standards, specifically the `<format>` and `<print>` headers. Currently, neither GCC nor Clang have full support those features, so the fmt libary is required. When they gain support, the fmt dependency will be dropped in favor of the C++ standard library. + +The features have been incorporated into Microsoft's C++ standard library implementation, so the fmt library is no longer required for the Windows version. + ## Unix Before starting, make sure you have the development tools Git, CMake and pkg-config installed. @@ -53,7 +59,7 @@ ### FreeBSD (Packages) ```bash -pkg install libebur128 taglib libfmt inih ffmpeg +pkg install ebur128 taglib libfmt inih ffmpeg ``` ### Building @@ -113,8 +119,7 @@ Build the dependencies and generate the Visual Studio project files: ```bash -git clone https://github.com/microsoft/vcpkg -cmake .. -DCMAKE_TOOLCHAIN_FILE=".\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_OVERLAY_TRIPLETS="..\config\vcpkg_triplets" -DVCPKG_TARGET_TRIPLET="custom-triplet" +cmake .. -DVCPKG=ON ``` Build and test the program:
View file
rsgain-3.5.1.tar.gz/docs/rsgain.1
Added
@@ -0,0 +1,181 @@ +.TH "rsgain" "1" "October 2023" "" "" +. +.SH "NAME" +\fBrsgain\fR \- ReplayGain 2\.0 loudness normalizer +. +.SH "SYNOPSIS" +rsgain OPTIONS <command> \.\.\. +. +.SH "DESCRIPTION" +\fBrsgain\fR (really simple gain) is a ReplayGain 2\.0 command-line utility\. +.P +It applies loudness metadata tags to audio and video files while leaving the audio stream untouched\. +.P +A ReplayGain-compatible player will dynamically adjust the volume of your tagged files during playback\. +.P +\fBrsgain\fR supports writing tags to the following file types: +.br + \- AIFF (\.aiff, \.aif, \.snd) + \- APE (\.ape) + \- FLAC (\.flac) + \- MP2 (\.mp2) + \- MP3 (\.mp3) + \- MP4 (\.m4a) + \- Musepack (\.mpc) + \- Ogg (\.ogg, \.oga, \.spx) + \- Opus (\.opus) + \- TAK (\.tak) + \- WAV (\.wav) + \- WavPack (\.wv) + \- WMA (\.wma)\. +. +.SS "OPTIONS AND COMMANDS" +.TP +\fB\-h\fR, \fB\-\-help\fR +Show help\. +.TP +\fB\-v\fR, \fB\-\-version\fR +Show version number\. +.TP +\fBeasy\fR +Easy Mode: +.br +Recursively scan a directory with recommended settings\. +.TP +\fBcustom\fR +Custom Mode: +.br +Scan individual files with custom settings\. +.P +Run \fBrsgain easy \-\-help\fR or \fBrsgain custom \-\-help\fR for more information\. +. +.SH "EASY MODE" +Usage: rsgain easy OPTIONS DIRECTORY +.P +Easy Mode recursively scans a directory using the recommended settings for each file type\. +.P +Easy Mode assumes that you have your music library organized with each album in its own folder\. +. +.SS "OPTIONS" +.TP +\fB\-h\fR, \fB\-\-help\fR +Show help\. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Don't print scanning status messages\. +.TP +\fB\-S\fR, \fB\-\-skip\-existing\fR +Don't scan files with existing ReplayGain information\. +.TP +\fB\-m n\fR, \fB\-\-multithread=n\fR +Scan files with \fBn\fR parallel threads\. +.TP +\fB\-p s\fR, \fB\-\-preset=s\fR +Load scan preset \fBs\fR\. +.TP +\fB\-O\fR, \fB\-\-output\fR +Output tab\-delimited scan data to CSV file per directory\. +.TP +\fB\-O s\fR, \fB\-\-output=s\fR +Output with sep header (needed for Microsoft Excel compatibility)\. +.TP +\fB\-O a\fR, \fB\-\-output=a\fR +Output with files sorted in alphanumeric order\. +. +.SH "CUSTOM MODE" +Usage: rsgain custom OPTIONS FILES\.\.\. +.P +Custom Mode allows the user to specify the options to scan files with\. +.P +The list of files to scan must be listed explicitly after the options\. +. +.SS "OPTIONS" +.TP +\fB\-h\fR, \fB\-\-help\fR +Show help\. +.TP +\fB\-a\fR, \fB\-\-album\fR +Calculate album gain and peak\. +.TP +\fB\-S\fR, \fB\-\-skip\-existing\fR +Don't scan files with existing ReplayGain information\. +.TP +\fB\-s s\fR, \fB\-\-tagmode=s\fR +Scan files but don't write ReplayGain tags (default)\. +.TP +\fB\-s d\fR, \fB\-\-tagmode=d\fR +Delete ReplayGain tags from files\. +.TP +\fB\-s i\fR, \fB\-\-tagmode=i\fR +Scan and write ReplayGain 2\.0 tags to files\. +.TP +\fB-l n\fR, \fB\-\-loudness=n\fR +Use \fBn\fR LUFS as target loudness (-30 ≤ n ≤ -5)\. +.TP +\fB\-c n\fR, \fB\-\-clip-mode=n\fR +No clipping protection (default)\. +.TP +\fB\-c p\fR, \fB\-\-clip\-mode=p\fR +Clipping protection enabled for positive\-gain values only\. +.TP +\fB\-c a\fR, \fB\-\-clip\-mode=a\fR +Clipping protection always enabled\. +.TP +\fB\-m n\fR, \fB\-\-max\-peak=n\fR +Use max peak level \fBn\fR dB for clipping protection\. +.TP +\fB\-t\fR, \fB\-\-true\-peak\fR +Use true peak for peak calculations\. +.TP +\fB\-L\fR, \fB\-\-lowercase\fR +Write lowercase tags (MP2/MP3/MP4/WMA/WAV/AIFF)\. +.br +This is non\-standard but sometimes needed\. +.TP +\fB\-I keep\fR, \fB\-\-id3v2\-version=keep\fR +Keep file's existing ID3v2 version, 3 if none exists (default)\. +.TP +\fB\-I 3\fR, \fB\-\-id3v2\-version=3\fR +Write ID3v2\.3 tags to MP2/MP3/WAV/AIFF\. +.TP +\fB\-I 4\fR, \fB\-\-id3v2\-version=4\fR +Write ID3v2\.4 tags to MP2/MP3/WAV/AIFF\. +.TP +\fB\-o d\fR, \fB\-\-opus\-mode=d\fR +Write standard ReplayGain tags, clear header output gain (default)\. +.TP +\fB\-o r\fR, \fB\-\-opus\-mode=r\fR +Write R128_*_GAIN tags, clear header output gain\. +.TP +\fB\-o s\fR, \fB\-\-opus\-mode=s\fR +Same as 'r', plus override target loudness to \-23 LUFS\. +.TP +\fB\-o t\fR, \fB\-\-opus\-mode=t\fR +Write track gain to header output gain\. +.TP +\fB\-o a\fR, \fB\-\-opus\-mode=a\fR +Write album gain to header output gain\. +.TP +\fB\-O\fR, \fB\-\-output\fR +Output tab\-delimited scan data to stdout\. +.TP +\fB\-O s\fR, \fB\-\-output=s\fR +Output with sep header (needed for Microsoft Excel compatibility)\. +.TP +\fB\-O a\fR, \fB\-\-output=a\fR +Output with files sorted in alphanumeric order\. +.TP +\fB\-p\fR, \fB\-\-preserve-mtimes\fR +Preserve file mtimes\. +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Don't print scanning status messages\. +. +.SH "BUGS" +\fBrsgain\fR is maintained on GitHub. Please report all bugs to the issue tracker at https://github\.com/complexlogic/rsgain/issues\. +. +.SH "COPYRIGHT" +Copyright (C) 2023 Hugh McMaster +. +.P +\fBrsgain\fR is released under the BSD\-2\-Clause licence\.
View file
rsgain-3.3-source.tar.xz/src/CMakeLists.txt -> rsgain-3.5.1.tar.gz/src/CMakeLists.txt
Changed
@@ -1,9 +1,14 @@ set(SOURCE_FILES rsgain.cpp + rsgain.hpp scan.cpp + scan.hpp output.cpp + output.hpp tag.cpp + tag.hpp easymode.cpp + easymode.hpp ) if (WIN32) add_executable(${EXECUTABLE_TITLE} ${SOURCE_FILES} "${PROJECT_BINARY_DIR}/rsgain.manifest" "${PROJECT_BINARY_DIR}/versioninfo.rc") @@ -23,7 +28,6 @@ ${LIBSWRESAMPLE} ${TAGLIB} ${LIBEBUR128} - ${FMT} ${GETOPT} ${INIH} FDK-AAC::fdk-aac @@ -31,6 +35,7 @@ if (VCPKG_TARGET_TRIPLET STREQUAL "custom-triplet") target_link_libraries(${EXECUTABLE_TITLE} ${STATIC_LIBS}) endif () + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) elseif (UNIX) add_executable(${EXECUTABLE_TITLE} ${SOURCE_FILES}) @@ -45,12 +50,28 @@ PkgConfig::TAGLIB PkgConfig::LIBEBUR128 PkgConfig::INIH - PkgConfig::FMT Threads::Threads ) + if (NOT USE_STD_FORMAT) + target_link_libraries(${EXECUTABLE_TITLE} PkgConfig::FMT) + endif () + if (STRIP) + add_custom_command(TARGET ${EXECUTABLE_TITLE} + POST_BUILD + COMMAND "${STRIP}" "${PROJECT_BINARY_DIR}/${EXECUTABLE_TITLE}" + ) + endif () + if (INSTALL_MANPAGE) + add_custom_command(TARGET ${EXECUTABLE_TITLE} + POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/docs/${EXECUTABLE_TITLE}.1" "${PROJECT_BINARY_DIR}" + COMMAND "${GZIP}" -f "${PROJECT_BINARY_DIR}/${EXECUTABLE_TITLE}.1" + ) + endif () endif() set (EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}") - +string(TIMESTAMP BUILD_DATE "%Y-%m-%d") +add_compile_definitions("BUILD_DATE=\"${BUILD_DATE}\"") if (MAXPROGBARWIDTH GREATER_EQUAL 20) target_compile_definitions(${EXECUTABLE_TITLE} PUBLIC "MAXPROGBARWIDTH=${MAXPROGBARWIDTH}") endif ()
View file
rsgain-3.3-source.tar.xz/src/easymode.cpp -> rsgain-3.5.1.tar.gz/src/easymode.cpp
Changed
@@ -19,8 +19,6 @@ #endif #include <ini.h> #include <getopt.h> -#include <fmt/core.h> -#include <fmt/chrono.h> #include <config.h> #include "rsgain.hpp" @@ -29,7 +27,7 @@ #include "scan.hpp" #define MAX_THREAD_SLEEP 30 -#define HELP_STATS(title, format, ...) fmt::print(COLOR_YELLOW "{:<18} " COLOR_OFF format "\n", title ":" __VA_OPT__(,) __VA_ARGS__) +#define HELP_STATS(title, format, ...) print(COLOR_YELLOW "{:<18} " COLOR_OFF format "\n", title ":" __VA_OPT__(,) __VA_ARGS__) extern "C" { int format_handler(void *user, const char *section, const char *name, const char *value); @@ -52,9 +50,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // MP2 config @@ -68,9 +68,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // MP3 config @@ -84,9 +86,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // FLAC config @@ -100,9 +104,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // OGG config @@ -116,9 +122,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // OPUS config @@ -132,9 +140,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // M4A config @@ -148,9 +158,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // WMA config @@ -164,9 +176,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // WAV config @@ -180,9 +194,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // AIFF config @@ -196,9 +212,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // Wavpack config @@ -212,9 +230,11 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, // APE config @@ -228,11 +248,31 @@ .do_album = true, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false }, + // TAK config + { + .tag_mode = 'i', + .skip_existing = false, + .target_loudness = RG_TARGET_LOUDNESS, + .max_peak_level = 0.0, + .true_peak = false, + .clip_mode = 'p', + .do_album = true, + .tab_output = OutputType::NONE, + .sep_header = false, + .sort_alphanum = false, + .lowercase = false, + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd',
View file
rsgain-3.3-source.tar.xz/src/easymode.hpp -> rsgain-3.5.1.tar.gz/src/easymode.hpp
Changed
@@ -6,7 +6,6 @@ #include <mutex> #include <filesystem> #include <condition_variable> -#include <fmt/core.h> #include "scan.hpp" class WorkerThread { @@ -35,5 +34,5 @@ }; void easy_mode(int argc, char *argv); -void scan_easy(const char *directory, const char *preset, size_t nb_threads); +void scan_easy(const std::filesystem::path &path, const std::filesystem::path &preset, size_t nb_threads); const Config& get_config(FileType type);
View file
rsgain-3.3-source.tar.xz/src/output.cpp -> rsgain-3.5.1.tar.gz/src/output.cpp
Changed
@@ -48,7 +48,6 @@ #include <sys/ioctl.h> #endif -#include <fmt/core.h> #include "output.hpp" #include "config.h" @@ -63,9 +62,6 @@ { this->start = start; this->len = len; - w_prev = -1; - c_prev = -1; - pos_prev = -1; } void ProgressBar::update(int pos) @@ -85,17 +81,17 @@ if (w != w_prev) { delete buffer; - buffer = new char(unsigned long) (w + 3); + buffer = new char(size_t) (w + 3); } - float percent = ((float) pos / (float) len); + float percent = (float) pos / (float) len; c = (int) (percent * (float) w); if (c > w) c = w; // Only output if we've actually made progress since last the call, or the console width changed if (c != c_prev || w != w_prev) { - fmt::print(" {:3.0f}% ", percent * 100.f); + print(" {:3.0f}% ", percent * 100.f); memset(buffer, '=', (size_t) c); memset(buffer + c, ' ', (size_t) (w - c)); bufferw = ''; @@ -121,7 +117,7 @@ delete buffer; buffer = nullptr; - fmt::print("\n"); + print("\n"); } inline int ProgressBar::get_console_width() @@ -148,7 +144,7 @@ if (w_path + w_message >= w_console) w_path = w_console - w_message; - fmt::print("\332K " COLOR_GREEN "{:5.1f}%" COLOR_OFF MT_MESSAGE "{:.{}}\r", + print("\332K " COLOR_GREEN "{:5.1f}%" COLOR_OFF MT_MESSAGE "{:.{}}\r", 100.f * ((float) (cur) / (float) (total)), path, w_path < 0 ? 0 : w_path
View file
rsgain-3.3-source.tar.xz/src/output.hpp -> rsgain-3.5.1.tar.gz/src/output.hpp
Changed
@@ -49,7 +49,18 @@ #include <string> #include <string_view> + +#ifdef USE_STD_FORMAT +#include <format> +#include <print> +#define format std::format +#define print std::print +#else #include <fmt/core.h> +#include <fmt/chrono.h> +#define format fmt::format +#define print fmt::print +#endif #define COLOR_GREEN "1;32m" #define COLOR_YELLOW "1;33m" @@ -76,16 +87,16 @@ #define FAIL_PREFIX "" COLOR_RED FAIL_CHAR COLOR_OFF " " extern int quiet; -#define output_ok(format, ...) if (!quiet) fmt::print(OK_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) -#define output_warn(format, ...) if (!quiet) fmt::print(WARN_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) -#define output_error(format, ...) fmt::print(stderr, ERROR_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) -#define output_fail(format, ...) fmt::print(stderr, FAIL_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) +#define output_ok(format, ...) if (!quiet) print(OK_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) +#define output_warn(format, ...) if (!quiet) print(WARN_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) +#define output_error(format, ...) print(stderr, ERROR_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) +#define output_fail(format, ...) print(stderr, FAIL_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__) class ProgressBar { private: - int c_prev; - int w_prev; - int pos_prev; + int c_prev = -1; + int w_prev = -1; + int pos_prev = -1; int start; int len = 0; char *buffer = nullptr; @@ -103,7 +114,7 @@ void update(int pos); void complete(); #ifdef _WIN32 - static void set_console(HANDLE c) { console = c; } + static void set_console(HANDLE c) { console = c; } #endif };
View file
rsgain-3.3-source.tar.xz/src/rsgain.cpp -> rsgain-3.5.1.tar.gz/src/rsgain.cpp
Changed
@@ -45,8 +45,11 @@ #include <libavutil/avutil.h> } #include <taglib/taglib.h> +#define HAS_TAGLIB2 TAGLIB_MAJOR_VERSION > 1 +#if HAS_TAGLIB2 +#include <taglib/tversionnumber.h> +#endif #include <ebur128.h> -#include <fmt/core.h> #include "rsgain.hpp" #include "tag.hpp" @@ -55,10 +58,10 @@ #include "output.hpp" #include "easymode.hpp" -#define PRINT_LIB(lib, version) fmt::print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n", lib, version) +#define PRINT_LIB(lib, version) print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n", lib, version) #define PRINT_LIB_FFMPEG(name, fn) \ ffver = fn(); \ - PRINT_LIB(name, fmt::format("{}.{}.{}", AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver))) + PRINT_LIB(name, format("{}.{}.{}", AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver))) #ifdef _WIN32 #include <windows.h> @@ -156,6 +159,22 @@ return true; } +std::pair<bool, bool> parse_output_mode(const std::string_view arg) +{ + std::pair<bool, bool> ret(false, false); + for (char c : arg) { + if (c == 's') + ret.first = true; + else if (c == 'a') + ret.second = true; + else { + output_fail("Unrecognized output argument '{}'", c); + quit(EXIT_FAILURE); + } + } + return ret; +} + // Parse Custom Mode command line arguments static void custom_mode(int argc, char *argv) { @@ -163,25 +182,26 @@ unsigned int nb_files = 0; opterr = 0; - const char *short_opts = "+ac:m:tl:O::qs:LSI:o:h?"; + const char *short_opts = "+ac:m:tl:O::qps:LSI:o:h?"; static struct option long_opts = { - { "album", no_argument, nullptr, 'a' }, - { "skip-existing", no_argument, nullptr, 'S' }, + { "album", no_argument, nullptr, 'a' }, + { "skip-existing", no_argument, nullptr, 'S' }, - { "clip-mode", required_argument, nullptr, 'c' }, - { "max-peak", required_argument, nullptr, 'm' }, - { "true-peak", no_argument, nullptr, 't' }, + { "clip-mode", required_argument, nullptr, 'c' }, + { "max-peak", required_argument, nullptr, 'm' }, + { "true-peak", no_argument, nullptr, 't' }, - { "loudness", required_argument, nullptr, 'l' }, + { "loudness", required_argument, nullptr, 'l' }, - { "output", optional_argument, nullptr, 'O' }, - { "quiet", no_argument, nullptr, 'q' }, + { "output", optional_argument, nullptr, 'O' }, + { "quiet", no_argument, nullptr, 'q' }, + { "preserve-mtimes", no_argument, nullptr, 'p' }, - { "tagmode", required_argument, nullptr, 's' }, - { "lowercase", no_argument, nullptr, 'L' }, - { "id3v2-version", required_argument, nullptr, 'I' }, - { "opus-mode", required_argument, nullptr, 'o' }, - { "help", no_argument, nullptr, 'h' }, + { "tagmode", required_argument, nullptr, 's' }, + { "lowercase", no_argument, nullptr, 'L' }, + { "id3v2-version", required_argument, nullptr, 'I' }, + { "opus-mode", required_argument, nullptr, 'o' }, + { "help", no_argument, nullptr, 'h' }, { 0, 0, 0, 0 } }; @@ -195,9 +215,12 @@ .do_album = false, .tab_output = OutputType::NONE, .sep_header = false, + .sort_alphanum = false, .lowercase = false, - .id3v2version = 3, - .opus_mode = 'd' + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false, + .preserve_mtimes = false }; while ((rc = getopt_long(argc, argv, short_opts, long_opts, &i)) != -1) { @@ -235,12 +258,9 @@ case 'O': config.tab_output = OutputType::STDOUT; if (optarg) { - if (*optarg == 's') - config.sep_header = true; - else { - output_fail("Unrecognized output argument '{}'", optarg); - quit(EXIT_FAILURE); - } + const auto& sep_header, sort_alphanum = parse_output_mode(optarg); + config.sep_header = sep_header; + config.sort_alphanum = sort_alphanum; } quiet = 1; break; @@ -249,6 +269,10 @@ quiet = 1; break; + case 'p': + config.preserve_mtimes = true; + break; + case 's': { if (!parse_tag_mode_custom(optarg, config.tag_mode)) quit(EXIT_FAILURE); @@ -291,7 +315,7 @@ std::unique_ptr<ScanJob> job(ScanJob::factory(argv + optind, nb_files, config)); if (!job) { - output_fail("No valid files were specified"); + output_fail("File list is not valid"); quit(EXIT_FAILURE); } job->scan(); @@ -307,8 +331,8 @@ const char *short_opts = "+hv?"; static struct option long_opts = { - { "help", no_argument, nullptr, 'h' }, - { "version", no_argument, nullptr, 'v' }, + { "help", no_argument, nullptr, 'h' }, + { "version", no_argument, nullptr, 'v' }, { 0, 0, 0, 0 } }; std::locale::global(std::locale("")); @@ -362,53 +386,53 @@ } static void help_main() { - fmt::print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} OPTIONS <command> ...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF); + print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} OPTIONS <command> ...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF); - fmt::print("{} {} supports writing tags to the following file types:\n", PROJECT_NAME, PROJECT_VERSION); - fmt::print(" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n"); - fmt::print(" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n"); - fmt::print(" WAV (.wav), and AIFF (.aiff, .aif, .snd).\n"); + print("{} {} supports writing tags to the following file types:\n", PROJECT_NAME, PROJECT_VERSION); + print(" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n"); + print(" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n"); + print(" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n"); - fmt::print("\n"); - fmt::print(COLOR_RED "Options:\n" COLOR_OFF); + print("\n"); + print(COLOR_RED "Options:\n" COLOR_OFF); CMD_HELP("--help", "-h", "Show this help"); CMD_HELP("--version", "-v", "Show version number"); - fmt::print("\n"); - fmt::print(COLOR_RED "Commands:\n" COLOR_OFF); + print("\n"); + print(COLOR_RED "Commands:\n" COLOR_OFF); CMD_CMD("easy", "Easy Mode: Recursively scan a directory with recommended settings"); CMD_CMD("custom", "Custom Mode: Scan individual files with custom settings"); - fmt::print("\n"); - fmt::print("Run '{} easy --help' or '{} custom --help' for more information.", EXECUTABLE_TITLE, EXECUTABLE_TITLE); + print("\n"); + print("Run '{} easy --help' or '{} custom --help' for more information.", EXECUTABLE_TITLE, EXECUTABLE_TITLE); - fmt::print("\n\n"); - fmt::print("Please report any issues to " PROJECT_URL "/issues\n\n"); + print("\n\n"); + print("Please report any issues to " PROJECT_URL "/issues\n\n"); } static inline void help_custom() { - fmt::print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} custom OPTIONS FILES...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF); + print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} custom OPTIONS FILES...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF); - fmt::print(" Custom Mode allows the user to specify the options to scan the files with. The\n"); - fmt::print(" list of files to scan must be listed explicitly after the options.\n");
View file
rsgain-3.3-source.tar.xz/src/rsgain.hpp -> rsgain-3.5.1.tar.gz/src/rsgain.hpp
Changed
@@ -1,8 +1,8 @@ #pragma once -#define CMD_HELP(CMDL, CMDS, MSG) fmt::print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, CMDS ",", CMDL, COLOR_OFF, MSG); -#define CMD_CMD(CMD, MSG) fmt::print(" {}{:<22}{} {}.\n", COLOR_YELLOW, CMD, COLOR_OFF, MSG); -#define CMD_CONT(MSG) fmt::print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, "", "", COLOR_OFF, MSG); +#define CMD_HELP(CMDL, CMDS, MSG) print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, CMDS ",", CMDL, COLOR_OFF, MSG); +#define CMD_CMD(CMD, MSG) print(" {}{:<22}{} {}.\n", COLOR_YELLOW, CMD, COLOR_OFF, MSG); +#define CMD_CONT(MSG) print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, "", "", COLOR_OFF, MSG); #define MATCH(x,y) !strcmp(x,y) #define STR_CAT(a) #a #define STR(a) STR_CAT(a) @@ -29,9 +29,12 @@ bool do_album; OutputType tab_output; bool sep_header; + bool sort_alphanum; bool lowercase; unsigned int id3v2version; char opus_mode; + bool skip_mp4; + bool preserve_mtimes; }; @@ -40,7 +43,8 @@ #define parse_tag_mode_easy(value, mode) parse_mode("tag", "disn", value, mode) #define parse_tag_mode_custom(value, mode) parse_mode("tag", "dis", value, mode) #define parse_clip_mode(value, mode) parse_mode("clip", "npa", value, mode) -#define parse_opus_mode(value, mode) parse_mode("Opus", "drta", value, mode) +#define parse_opus_mode(value, mode) parse_mode("Opus", "drtas", value, mode) bool parse_target_loudness(const char *value, double &target_loudness); bool parse_id3v2_version(const char *value, unsigned int &version); bool parse_max_peak_level(const char *value, double &peak); +std::pair<bool, bool> parse_output_mode(const std::string_view arg);
View file
rsgain-3.3-source.tar.xz/src/scan.cpp -> rsgain-3.5.1.tar.gz/src/scan.cpp
Changed
@@ -73,6 +73,7 @@ {".spx", FileType::OGG}, {".opus", FileType::OPUS}, {".m4a", FileType::M4A}, + {".mp4", FileType::M4A}, {".wma", FileType::WMA}, {".wav", FileType::WAV}, {".aiff", FileType::AIFF}, @@ -80,6 +81,7 @@ {".snd", FileType::AIFF}, {".wv", FileType::WAVPACK}, {".ape", FileType::APE}, + {".tak", FileType::TAK}, {".mpc", FileType::MPC} }; std::string extensionlower = extension; @@ -95,16 +97,20 @@ std::vector<Track> tracks; for (const std::filesystem::directory_entry &entry : std::filesystem::directory_iterator(path)) { - if (entry.is_regular_file() && entry.path().has_extension() && - (file_type = determine_filetype(entry.path().extension().string())) != FileType::INVALID) { - tracks.emplace_back(entry.path().string(), file_type); + if (entry.is_regular_file() && entry.path().has_extension() + && ((file_type = determine_filetype(entry.path().extension().string())) != FileType::INVALID) + && !(file_type == FileType::M4A && get_config(file_type).skip_mp4 && entry.path().extension().string() == ".mp4")) { + tracks.emplace_back(entry.path(), file_type); extensions.insert(file_type); } } if (tracks.empty()) return nullptr; file_type = extensions.size() > 1 ? FileType::DEFAULT : *extensions.begin(); - return new ScanJob(path.string(), std::move(tracks), get_config(file_type)); + const Config &config = get_config(file_type); + if (config.tag_mode == 'n') + return nullptr; + return new ScanJob(path, tracks, config, file_type); } ScanJob* ScanJob::factory(char **files, size_t nb_files, const Config &config) @@ -112,16 +118,25 @@ FileType file_type; std::filesystem::path path; std::vector<Track> tracks; + std::unordered_set<FileType> types; for (size_t i = 0; i < nb_files; i++) { path = filesi; - if ((file_type = determine_filetype(path.extension().string())) == FileType::INVALID) + if (!std::filesystem::exists(path)) { + output_error("File '{}' does not exist", path.string()); + return nullptr; + } + else if ((file_type = determine_filetype(path.extension().string())) == FileType::INVALID) { output_error("File '{}' is not of a supported type", filesi); - else - tracks.emplace_back(path.string(), file_type); + return nullptr; + } + else { + tracks.emplace_back(path, file_type); + types.insert(file_type); + } } if (tracks.empty()) return nullptr; - return new ScanJob("", std::move(tracks), config); + return new ScanJob(tracks, config, types.size() > 1 ? FileType::DEFAULT : *types.begin()); } void free_ebur128(ebur128_state *ebur128_state) @@ -171,11 +186,11 @@ { ProgressBar progress_bar; int rc, stream_id = -1; - int start = 0, len = 0, pos = 0; uint8_t *swr_out_data1; bool ret = false; bool repeat = false; int peak_mode; + double time_base; bool output_progress = !quiet && !multithread && config.tag_mode != 'd'; std::unique_lock<std::mutex> *lk = nullptr; ebur128_state *ebur128 = nullptr; @@ -190,21 +205,22 @@ AVFrame *frame = nullptr; SwrContext *swr = nullptr; AVFormatContext *format_ctx = nullptr; + const AVStream *stream = nullptr; // For Opus files, FFmpeg always adjusts the decoded audio samples by the header output // gain with no way to disable. To get the actual loudness of the audio signal, // we need to set the header output gain to 0 dB before decoding if (type == FileType::OPUS && config.tag_mode != 's') - set_opus_header_gain(path.c_str(), 0); + set_opus_header_gain(path.string().c_str(), 0); if (m) lk = new std::unique_lock<std::mutex>(*m, std::defer_lock); if (output_progress) - output_ok("Scanning '{}'", path); + output_ok("Scanning '{}'", path.string()); if (lk) lk->lock(); - rc = avformat_open_input(&format_ctx, path.c_str(), nullptr, nullptr); + rc = avformat_open_input(&format_ctx, format("file:{}", path.string()).c_str(), nullptr, nullptr); if (rc < 0) { output_fferror(rc, "Could not open input"); goto end; @@ -226,6 +242,8 @@ output_error("Could not find audio stream"); goto end; } + stream = format_ctx->streamsstream_id; + time_base = av_q2d(stream->time_base); // Initialize the decoder do { @@ -234,7 +252,7 @@ output_error("Could not allocate audio codec context"); goto end; } - avcodec_parameters_to_context(codec_ctx, format_ctx->streamsstream_id->codecpar); + avcodec_parameters_to_context(codec_ctx, stream->codecpar); rc = avcodec_open2(codec_ctx, codec, nullptr); if (rc < 0) { if (!repeat) { @@ -272,7 +290,7 @@ output_ok("Stream #{}: {}, {}{:L} Hz, {} ch", stream_id, codec->long_name, - codec_ctx->bits_per_raw_sample > 0 ? fmt::format("{} bit, ", codec_ctx->bits_per_raw_sample) : "", + codec_ctx->bits_per_raw_sample > 0 ? format("{} bit, ", codec_ctx->bits_per_raw_sample) : "", codec_ctx->sample_rate, nb_channels ); @@ -322,7 +340,7 @@ // Initialize libebur128 peak_mode = config.true_peak ? EBUR128_MODE_TRUE_PEAK : EBUR128_MODE_SAMPLE_PEAK; ebur128 = ebur128_init((unsigned int) nb_channels, - (unsigned long) codec_ctx->sample_rate, + (size_t) codec_ctx->sample_rate, EBUR128_MODE_I | peak_mode ); if (!ebur128) { @@ -345,16 +363,13 @@ } if (output_progress) { - if (format_ctx->streamsstream_id->duration == AV_NOPTS_VALUE) + if (stream->duration == AV_NOPTS_VALUE) output_progress = false; else { - if (format_ctx->streamsstream_id->start_time != AV_NOPTS_VALUE) - start = (int) std::round((double) (format_ctx->streamsstream_id->start_time) - * av_q2d(format_ctx->streamsstream_id->time_base)); - len = (int) std::round((double) (format_ctx->streamsstream_id->duration) - * av_q2d(format_ctx->streamsstream_id->time_base)); - if (len > 0) - progress_bar.begin(start, len); + int start = 0; + if (stream->start_time != AV_NOPTS_VALUE) + start = (int) std::round((double) stream->start_time * time_base); + progress_bar.begin(start, (int) std::round((double) stream->duration * time_base)); } } @@ -362,8 +377,6 @@ if (packet->stream_index == stream_id) { if ((rc = avcodec_send_packet(codec_ctx, packet)) == 0) { while ((rc = avcodec_receive_frame(codec_ctx, frame)) >= 0) { - pos = (int) std::round((double) (frame->pkt_dts) - * av_q2d(format_ctx->streamsstream_id->time_base)); #if OLD_CHANNEL_LAYOUT if (frame->channels == nb_channels) { #else @@ -394,8 +407,11 @@ else ebur128_add_frames_short(ebur128, (short*) frame->data0, static_cast<size_t>(frame->nb_samples)); - if (output_progress && pos >= 0) - progress_bar.update(pos); + if (output_progress) { + int pos = (int) std::round((double) frame->pts * time_base); + if (pos >= 0) + progress_bar.update(pos); + } } av_frame_unref(frame); } @@ -429,15 +445,12 @@ void ScanJob::calculate_loudness() { + if (tracks.empty()) + return; + // Track loudness calculations - for (auto track = tracks.begin(); track != tracks.end();) {
View file
rsgain-3.3-source.tar.xz/src/scan.hpp -> rsgain-3.5.1.tar.gz/src/scan.hpp
Changed
@@ -21,6 +21,7 @@ AIFF, WAVPACK, APE, + TAK, MPC }; @@ -49,7 +50,7 @@ class ScanJob { public: struct Track { - std::string path; + std::filesystem::path path; FileType type; std::unique_ptr<ebur128_state, decltype(&free_ebur128)> ebur128; std::string container; @@ -58,12 +59,12 @@ bool tclip = false; bool aclip = false; - Track(const std::string &path, FileType type) : path(path), type(type), ebur128(nullptr, free_ebur128) {}; + Track(const std::filesystem::path &path, FileType type) : path(path), type(type), ebur128(nullptr, free_ebur128) {}; bool scan(const Config &config, std::mutex *ffmpeg_mutex); - bool calculate_loudness(const Config &config); + void calculate_loudness(const Config &config); }; - std::string path; + std::filesystem::path path; size_t nb_files; const Config &config; FileType type; @@ -71,7 +72,8 @@ size_t clipping_adjustments = 0; size_t skipped = 0; - ScanJob(const std::string &path, std::vector<Track> &&tracks, const Config &config) : path(path), nb_files(tracks.size()), config(config), tracks(std::move(tracks)) {} + ScanJob(const std::filesystem::path &path, std::vector<Track> &tracks, const Config &config, FileType &type) : path(path), nb_files(tracks.size()), config(config), type(type), tracks(std::move(tracks)) {} + ScanJob(std::vector<Track> &tracks, const Config &config, FileType type) : nb_files(tracks.size()), config(config), type(type), tracks(std::move(tracks)) {} static ScanJob* factory(char **files, size_t nb_files, const Config &config); static ScanJob* factory(const std::filesystem::path &path); bool scan(std::mutex *ffmpeg_mutex = nullptr);
View file
rsgain-3.3-source.tar.xz/src/tag.cpp -> rsgain-3.5.1.tar.gz/src/tag.cpp
Changed
@@ -65,12 +65,13 @@ #include "output.hpp" #define TAGLIB_VERSION (TAGLIB_MAJOR_VERSION * 10000 + TAGLIB_MINOR_VERSION * 100 + TAGLIB_PATCH_VERSION) -#define FORMAT_GAIN(gain) fmt::format("{:.2f} dB", gain) -#define FORMAT_PEAK(peak) fmt::format("{:.6f}", peak) +#define FORMAT_GAIN(gain) format("{:.2f} dB", gain) +#define FORMAT_PEAK(peak) format("{:.6f}", peak) #define OPUS_HEADER_SIZE 47 #define OGG_ROW_SIZE 4 #define OPUS_HEAD_OFFSET 7 * OGG_ROW_SIZE #define OGG_CRC_OFFSET 5 * OGG_ROW_SIZE + 2 +#define OGG_SEGMENT_TABLE_OFFSET 27 #define OPUS_GAIN_OFFSET 11 * OGG_ROW_SIZE #define RG_TAGS_UPPERCASE 1 #define RG_TAGS_LOWERCASE 2 @@ -78,7 +79,7 @@ #define MP4_ATOM_STRING "----:com.apple.iTunes:" #define FORMAT_MP4_TAG(s, tag) s.append(MP4_ATOM_STRING).append(tag) -#define tag_error(t) output_error("Couldn't write to: {}", t.path) +#define tag_error(t) output_error("Couldn't write to: {}", t.path.string()) using RGTagsArray = std::array<TagLib::String, 7>; @@ -105,8 +106,8 @@ static void tag_write(TagLib::Ogg::XiphComment *tag, const ScanResult &result, const Config &config); static void tag_clear(TagLib::MP4::Tag *tag); static void tag_write(TagLib::MP4::Tag *tag, const ScanResult &result, const Config &config); -static void tag_clearv2(TagLib::APE::Tag *tag); -static void tag_writev2(TagLib::APE::Tag *tag, const ScanResult &result, const Config &config); +static void tag_clear(TagLib::APE::Tag *tag); +static void tag_write(TagLib::APE::Tag *tag, const ScanResult &result, const Config &config); static void tag_clear(TagLib::ASF::Tag *tag); static void tag_write(TagLib::ASF::Tag *tag, const ScanResult &result, const Config &config); @@ -167,6 +168,10 @@ void tag_track(ScanJob::Track &track, const Config &config) { + std::filesystem::file_time_type mtime; + if (config.preserve_mtimes) + mtime = std::filesystem::last_write_time(track.path); + switch (track.type) { case FileType::MP2: case FileType::MP3: @@ -237,8 +242,9 @@ if (!tag_apev2<TagLib::WavPack::File>(track, config)) tag_error(track); break; - + case FileType::APE: + case FileType::TAK: if (!tag_apev2<TagLib::APE::File>(track, config)) tag_error(track); break; @@ -251,6 +257,8 @@ default: break; } + if (config.preserve_mtimes) + std::filesystem::last_write_time(track.path, mtime); } bool tag_exists(const ScanJob::Track &track) @@ -283,8 +291,9 @@ case FileType::WAVPACK: return tag_exists_ape<TagLib::WavPack::File>(track); - + case FileType::APE: + case FileType::TAK: return tag_exists_ape<TagLib::APE::File>(track); case FileType::MPC: @@ -300,7 +309,7 @@ static bool tag_exists_id3(const ScanJob::Track &track) { const TagLib::ID3v2::Tag *tag = nullptr; - T file(track.path.c_str(), false); + T file(track.path.string().c_str(), false); if constexpr (std::is_same_v<T, TagLib::RIFF::AIFF::File>) tag = file.tag(); else @@ -327,7 +336,7 @@ { bool ret = false; const TagLib::Ogg::XiphComment *tag = nullptr; - T file(track.path.c_str(), false); + T file(track.path.string().c_str(), false); if constexpr(std::is_same_v<T, TagLib::FLAC::File>) tag = file.xiphComment(); else @@ -358,7 +367,7 @@ } } - TagLib::MP4::File file(track.path.c_str(), false); + TagLib::MP4::File file(track.path.string().c_str(), false); const TagLib::MP4::Tag *tag = file.tag(); if (tag) { for (const auto &key : keys) { @@ -372,7 +381,7 @@ template<typename T> static bool tag_exists_ape(const ScanJob::Track &track) { - T file(track.path.c_str(), false); + T file(track.path.string().c_str(), false); const TagLib::APE::Tag *tag = file.APETag(); if (tag) { const auto &map = tag->itemListMap(); @@ -383,7 +392,7 @@ static bool tag_exists_asf(const ScanJob::Track &track) { - TagLib::ASF::File file(track.path.c_str(), false); + TagLib::ASF::File file(track.path.string().c_str(), false); const TagLib::ASF::Tag *tag = file.tag(); return tag->contains(RG_STRING_UPPERstatic_cast<int>(RGTag::TRACK_GAIN)) || tag->contains(RG_STRING_LOWERstatic_cast<int>(RGTag::TRACK_GAIN)); @@ -402,8 +411,10 @@ static bool tag_mp3(ScanJob::Track &track, const Config &config) { - TagLib::MPEG::File file(track.path.c_str()); + TagLib::MPEG::File file(track.path.string().c_str()); TagLib::ID3v2::Tag *tag = file.ID3v2Tag(true); + if (!tag) + return false; unsigned int id3v2version = config.id3v2version; if (id3v2version == ID3V2_KEEP) id3v2version = tag->isEmpty() ? 3: tag->header()->majorVersion(); @@ -423,8 +434,10 @@ static bool tag_flac(ScanJob::Track &track, const Config &config) { - TagLib::FLAC::File file(track.path.c_str()); + TagLib::FLAC::File file(track.path.string().c_str()); TagLib::Ogg::XiphComment *tag = file.xiphComment(true); + if (!tag) + return false; tag_clear<TagLib::FLAC::File>(tag); if (config.tag_mode == 'i') tag_write<TagLib::FLAC::File>(tag, track.result, config); @@ -433,15 +446,14 @@ template<typename T> static bool tag_ogg(ScanJob::Track &track, const Config &config) { - T file(track.path.c_str()); + T file(track.path.string().c_str()); TagLib::Ogg::XiphComment *tag = nullptr; - if constexpr(std::is_same_v<T, TagLib::FileRef>) { + if constexpr(std::is_same_v<T, TagLib::FileRef>) tag = dynamic_cast<TagLib::Ogg::XiphComment*>(file.tag()); - if (!tag) - return false; - } else tag = file.tag(); + if (!tag) + return false; tag_clear<T>(tag); if (config.tag_mode == 'i' && (!std::is_same_v<T, TagLib::Ogg::Opus::File> || (config.opus_mode != 't' && config.opus_mode != 'a'))) @@ -449,18 +461,20 @@ bool ret = file.save(); if (!std::is_same_v<T, TagLib::Ogg::Opus::File> || config.tag_mode == 's' || - config.opus_mode == 'd' || config.opus_mode == 'r' || !ret) + !(config.opus_mode == 't' || config.opus_mode == 'a') || !ret) return ret; int16_t gain = config.opus_mode == 'a' && config.do_album ? GAIN_TO_Q78(track.result.album_gain) : GAIN_TO_Q78(track.result.track_gain); - return set_opus_header_gain(track.path.c_str(), gain); + return set_opus_header_gain(track.path.string().c_str(), gain); } static bool tag_mp4(ScanJob::Track &track, const Config &config) { - TagLib::MP4::File file(track.path.c_str()); + TagLib::MP4::File file(track.path.string().c_str()); TagLib::MP4::Tag *tag = file.tag(); + if (!tag) + return false; tag_clear(tag); if (config.tag_mode == 'i') tag_write(tag, track.result, config); @@ -471,25 +485,29 @@ template <typename T> static bool tag_apev2(ScanJob::Track &track, const Config &config) { - T file(track.path.c_str()); + T file(track.path.string().c_str()); TagLib::APE::Tag *tag = file.APETag(true); - tag_clearv2(tag); + if (!tag)
View file
rsgain-3.3-source.tar.xz/vcpkg.json -> rsgain-3.5.1.tar.gz/vcpkg.json
Changed
@@ -1,29 +1,37 @@ { "dependencies": - { - "name": "libebur128", - "platform": "windows" - }, "taglib", { - "name": "ffmpeg", - "platform": "windows", - "default-features": false, - "features": "avcodec", "avformat", "swresample", "fdk-aac" - }, - { - "name": "fdk-aac", - "platform": "windows", - "features": "he-aac" - }, - "fmt", - { - "name": "inih", - "platform": "windows" - }, - { "name": "getopt", "platform": "windows" } - + , + "features": { + "fmt": { + "description": "Use the fmtlib library for formatting", + "dependencies": "fmt" + }, + "ffmpeg": { + "description": "Build FFmpeg", + "dependencies": + { + "name": "ffmpeg", + "default-features": false, + "features": "avcodec", "avformat", "swresample", "fdk-aac" + }, + { + "name": "fdk-aac", + "features": "he-aac" + } + + }, + "libebur128": { + "description": "Build libebur128", + "dependencies": "libebur128" + }, + "inih": { + "description": "Build inih", + "dependencies": "inih" + } + } }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.