Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/presets/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions config/presets/ebur128.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions config/presets/loudgain.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions config/presets/no_album.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 23 additions & 1 deletion src/easymode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -460,7 +481,8 @@ static FileType determine_section_type(const std::string &section)
{"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;
Expand Down
2 changes: 1 addition & 1 deletion src/rsgain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ enum class FileType {
WAVPACK,
APE,
TAK,
MPC
MPC,
DSF
};

struct ScanResult {
Expand Down
14 changes: 11 additions & 3 deletions src/tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <taglib/wavpackfile.h>
#include <taglib/apefile.h>
#include <taglib/mpcfile.h>
#include <taglib/dsffile.h>
#include <libavcodec/avcodec.h>

#define CRCPP_USE_CPP11
Expand Down Expand Up @@ -236,6 +237,10 @@ bool tag_track(ScanJob::Track &track, const Config &config)
ret = tag_apev2<TagLib::MPC::File>(track, config);
break;

case FileType::DSF:
ret = tag_riff<TagLib::DSF::File>(track, config);
break;

default:
break;
}
Expand Down Expand Up @@ -285,6 +290,9 @@ bool tag_exists(const ScanJob::Track &track)
case FileType::MPC:
return tag_exists_ape<TagLib::MPC::File>(track);

case FileType::DSF:
return tag_exists_id3<TagLib::DSF::File>(track);

default:
return false;
}
Expand All @@ -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<T, TagLib::RIFF::AIFF::File>)
if constexpr (std::is_same_v<T, TagLib::RIFF::AIFF::File> || std::is_same_v<T, TagLib::DSF::File>)
tag = file.tag();
else
tag = file.ID3v2Tag();
Expand Down Expand Up @@ -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<T, TagLib::RIFF::WAV::File>)
tag = file.ID3v2Tag();
else if constexpr (std::is_same_v<T, TagLib::RIFF::AIFF::File>)
else if constexpr (std::is_same_v<T, TagLib::RIFF::AIFF::File> || std::is_same_v<T, TagLib::DSF::File>)
tag = file.tag();
if (!tag)
return false;
Expand All @@ -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<T, TagLib::RIFF::AIFF::File>)
else if constexpr (std::is_same_v<T, TagLib::RIFF::AIFF::File> || std::is_same_v<T, TagLib::DSF::File>)
return file.save();
}

Expand Down
Loading