From 6546f81a97836acfe563a14a32d2c483817e1038 Mon Sep 17 00:00:00 2001 From: Evan Champion <110177090+evan314159@users.noreply.github.com> Date: Sun, 8 Mar 2026 07:43:05 +0800 Subject: [PATCH 1/2] Add DSD (DSF format) support --- src/easymode.cpp | 24 +++++++++++++++++++++++- src/scan.cpp | 5 +++-- src/scan.hpp | 3 ++- src/tag.cpp | 14 +++++++++++--- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/easymode.cpp b/src/easymode.cpp index e3bf16c..7bf5508 100644 --- a/src/easymode.cpp +++ b/src/easymode.cpp @@ -313,6 +313,27 @@ static Config configs[] = { }, // Musepack 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, + .album_as_aes77 = false, + .tab_output = OutputType::NONE, + .sep_header = false, + .sort_alphanum = false, + .lowercase = false, + .id3v2version = ID3V2_KEEP, + .opus_mode = 'd', + .skip_mp4 = false, + .preserve_mtimes = false, + .dual_mono = false + }, + + // DSF config { .tag_mode = 'i', .skip_existing = false, @@ -460,7 +481,8 @@ static FileType determine_section_type(const std::string §ion) {"Wavpack", FileType::WAVPACK}, {"APE", FileType::APE}, {"TAK", FileType::TAK}, - {"Musepack", FileType::MPC} + {"Musepack", FileType::MPC}, + {"DSF", FileType::DSF} }; auto it = map.find(section); return it == map.end() ? FileType::INVALID : it->second; diff --git a/src/scan.cpp b/src/scan.cpp index a0110bd..6d0de43 100644 --- a/src/scan.cpp +++ b/src/scan.cpp @@ -79,7 +79,7 @@ static FileType determine_filetype(const std::string &extension) {".spx", FileType::OGG}, {".opus", FileType::OPUS}, {".m4a", FileType::M4A}, - {".mp4", FileType::M4A}, + {".mp4", FileType::M4A}, {".wma", FileType::WMA}, {".wav", FileType::WAV}, {".aiff", FileType::AIFF}, @@ -88,7 +88,8 @@ static FileType determine_filetype(const std::string &extension) {".wv", FileType::WAVPACK}, {".ape", FileType::APE}, {".tak", FileType::TAK}, - {".mpc", FileType::MPC} + {".mpc", FileType::MPC}, + {".dsf", FileType::DSF} }; std::string extensionlower = extension; std::transform(extensionlower.begin(), extensionlower.end(), extensionlower.begin(), ::tolower); diff --git a/src/scan.hpp b/src/scan.hpp index bc17afb..22c47da 100644 --- a/src/scan.hpp +++ b/src/scan.hpp @@ -22,7 +22,8 @@ enum class FileType { WAVPACK, APE, TAK, - MPC + MPC, + DSF }; struct ScanResult { diff --git a/src/tag.cpp b/src/tag.cpp index 226d1ef..8aee295 100644 --- a/src/tag.cpp +++ b/src/tag.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #define CRCPP_USE_CPP11 @@ -236,6 +237,10 @@ bool tag_track(ScanJob::Track &track, const Config &config) ret = tag_apev2(track, config); break; + case FileType::DSF: + ret = tag_riff(track, config); + break; + default: break; } @@ -285,6 +290,9 @@ bool tag_exists(const ScanJob::Track &track) case FileType::MPC: return tag_exists_ape(track); + case FileType::DSF: + return tag_exists_id3(track); + default: return false; } @@ -296,7 +304,7 @@ static bool tag_exists_id3(const ScanJob::Track &track) { const TagLib::ID3v2::Tag *tag = nullptr; T file(track.path.string().c_str(), false); - if constexpr (std::is_same_v) + if constexpr (std::is_same_v || std::is_same_v) tag = file.tag(); else tag = file.ID3v2Tag(); @@ -510,7 +518,7 @@ static bool tag_riff(ScanJob::Track &track, const Config &config) TagLib::ID3v2::Tag *tag = nullptr; if constexpr (std::is_same_v) tag = file.ID3v2Tag(); - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v || std::is_same_v) tag = file.tag(); if (!tag) return false; @@ -530,7 +538,7 @@ static bool tag_riff(ScanJob::Track &track, const Config &config) id3v2version == 3 ? TagLib::ID3v2::Version::v3 : TagLib::ID3v2::Version::v4 ); #endif - else if constexpr (std::is_same_v) + else if constexpr (std::is_same_v || std::is_same_v) return file.save(); } From 21208dd27ec9f46ae0e274d2eb5a812287efe108 Mon Sep 17 00:00:00 2001 From: complexlogic Date: Sat, 21 Mar 2026 16:05:05 -0700 Subject: [PATCH 2/2] Add info to help screen and DSF sections to scan presets --- config/presets/default.ini | 10 ++++++++++ config/presets/ebur128.ini | 10 ++++++++++ config/presets/loudgain.ini | 10 ++++++++++ config/presets/no_album.ini | 10 ++++++++++ src/rsgain.cpp | 2 +- 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/config/presets/default.ini b/config/presets/default.ini index df0247c..7f66604 100644 --- a/config/presets/default.ini +++ b/config/presets/default.ini @@ -152,3 +152,13 @@ DualMono=false #TruePeak=false #PreserveMtimes=false #DualMono=false + +[DSF] +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false +#DualMono=false \ No newline at end of file diff --git a/config/presets/ebur128.ini b/config/presets/ebur128.ini index 7cf0fa9..b31f15c 100644 --- a/config/presets/ebur128.ini +++ b/config/presets/ebur128.ini @@ -152,3 +152,13 @@ DualMono=false #TruePeak=false #PreserveMtimes=false #DualMono=false + +[DSF] +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false +#DualMono=false diff --git a/config/presets/loudgain.ini b/config/presets/loudgain.ini index 23a0ca3..e61727c 100644 --- a/config/presets/loudgain.ini +++ b/config/presets/loudgain.ini @@ -153,3 +153,13 @@ TargetLoudness=-23 #TruePeak=false #PreserveMtimes=false #DualMono=false + +[DSF] +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false +#DualMono=false \ No newline at end of file diff --git a/config/presets/no_album.ini b/config/presets/no_album.ini index d8ccaf0..9afb913 100644 --- a/config/presets/no_album.ini +++ b/config/presets/no_album.ini @@ -152,3 +152,13 @@ DualMono=false #TruePeak=false #PreserveMtimes=false #DualMono=false + +[DSF] +#TagMode=i +#Album=true +#TargetLoudness=-18 +#ClipMode=p +#MaxPeakLevel=0.0 +#TruePeak=false +#PreserveMtimes=false +#DualMono=false diff --git a/src/rsgain.cpp b/src/rsgain.cpp index c851012..704cea0 100644 --- a/src/rsgain.cpp +++ b/src/rsgain.cpp @@ -405,7 +405,7 @@ static void help_main() { rsgain::print("{} {} supports writing tags to the following file types:\n", PROJECT_NAME, PROJECT_VERSION); rsgain::print(" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n"); rsgain::print(" MP3 (.mp3), MP4 (.mp4, .m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n"); - rsgain::print(" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n"); + rsgain::print(" WAV (.wav), AIFF (.aiff, .aif, .snd), TAK (.tak), and DSF (.dsf).\n"); rsgain::print("\n"); rsgain::print(COLOR_RED "Options:\n" COLOR_OFF);