Commit 222b7775 authored by Max Kellermann's avatar Max Kellermann

tag/ApeReplayGain: add overload with InputStream& parameter

parent b5c206d3
...@@ -48,6 +48,23 @@ replay_gain_ape_callback(unsigned long flags, const char *key, ...@@ -48,6 +48,23 @@ replay_gain_ape_callback(unsigned long flags, const char *key,
} }
bool 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) replay_gain_ape_read(Path path_fs, ReplayGainInfo &info)
{ {
bool found = false; bool found = false;
......
...@@ -22,10 +22,14 @@ ...@@ -22,10 +22,14 @@
#include "check.h" #include "check.h"
class InputStream;
class Path; class Path;
struct ReplayGainInfo; struct ReplayGainInfo;
bool bool
replay_gain_ape_read(InputStream &is, ReplayGainInfo &info);
bool
replay_gain_ape_read(Path path_fs, ReplayGainInfo &info); replay_gain_ape_read(Path path_fs, ReplayGainInfo &info);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment