diff --git a/src/tag/ApeReplayGain.cxx b/src/tag/ApeReplayGain.cxx index 883885369..bfad3b07d 100644 --- a/src/tag/ApeReplayGain.cxx +++ b/src/tag/ApeReplayGain.cxx @@ -47,6 +47,23 @@ replay_gain_ape_callback(unsigned long flags, const char *key, return ParseReplayGainTag(info, key, value); } +bool +replay_gain_ape_read(InputStream &is, ReplayGainInfo &info) +{ + bool found = false; + + auto callback = [&info, &found] + (unsigned long flags, const char *key, + StringView value) { + found |= replay_gain_ape_callback(flags, key, + value, + info); + return true; + }; + + return tag_ape_scan(is, callback) && found; +} + bool replay_gain_ape_read(Path path_fs, ReplayGainInfo &info) { diff --git a/src/tag/ApeReplayGain.hxx b/src/tag/ApeReplayGain.hxx index faf68f0e3..0150aae3b 100644 --- a/src/tag/ApeReplayGain.hxx +++ b/src/tag/ApeReplayGain.hxx @@ -22,9 +22,13 @@ #include "check.h" +class InputStream; class Path; struct ReplayGainInfo; +bool +replay_gain_ape_read(InputStream &is, ReplayGainInfo &info); + bool replay_gain_ape_read(Path path_fs, ReplayGainInfo &info);