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 bf792eb..0e43189 100644 --- a/src/scan.cpp +++ b/src/scan.cpp @@ -63,7 +63,7 @@ constexpr void output_fferror(int error, T&& msg) output_error("{}: {}", msg, errbuf); } #define OLD_CHANNEL_LAYOUT LIBAVUTIL_VERSION_MAJOR < 57 || (LIBAVUTIL_VERSION_MAJOR == 57 && LIBAVUTIL_VERSION_MINOR < 18) -#define OUTPUT_FORMAT AV_SAMPLE_FMT_S16 +#define OUTPUT_FORMAT AV_SAMPLE_FMT_FLT extern bool multithread; @@ -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); @@ -434,13 +435,13 @@ ScanReturn ScanJob::Track::scan(const Config &config, std::mutex *m) goto end; } - ebur128_add_frames_short(ebur128, (short*) swr_out_data[0], static_cast(frame->nb_samples)); + ebur128_add_frames_float(ebur128, (float*) swr_out_data[0], static_cast(frame->nb_samples)); av_free(swr_out_data[0]); } // Audio is already in correct format else - ebur128_add_frames_short(ebur128, (short*) frame->data[0], static_cast(frame->nb_samples)); + ebur128_add_frames_float(ebur128, (float*) frame->data[0], static_cast(frame->nb_samples)); if (output_progress) { int pos = (int) std::round((double) frame->pts * time_base); 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(); }