tag/ReplayGain: add VorbisComment parser
Move code from the Vorbis and FLAC decoder plugins.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "ReplayGain.hxx"
|
||||
#include "VorbisComment.hxx"
|
||||
#include "ReplayGainInfo.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
@@ -68,3 +69,18 @@ ParseReplayGainTag(ReplayGainInfo &info, const char *name, const char *value)
|
||||
|
||||
return ParseReplayGainTagTemplate(info, NameValue{name, value});
|
||||
}
|
||||
|
||||
bool
|
||||
ParseReplayGainVorbis(ReplayGainInfo &info, const char *entry)
|
||||
{
|
||||
struct VorbisCommentEntry {
|
||||
const char *entry;
|
||||
|
||||
gcc_pure
|
||||
const char *operator[](const char *n) const {
|
||||
return vorbis_comment_value(entry, n);
|
||||
}
|
||||
};
|
||||
|
||||
return ParseReplayGainTagTemplate(info, VorbisCommentEntry{entry});
|
||||
}
|
||||
|
@@ -27,4 +27,7 @@ struct ReplayGainInfo;
|
||||
bool
|
||||
ParseReplayGainTag(ReplayGainInfo &info, const char *name, const char *value);
|
||||
|
||||
bool
|
||||
ParseReplayGainVorbis(ReplayGainInfo &info, const char *entry);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user