tag/TagHandler: pass by reference
This commit is contained in:
@@ -89,7 +89,7 @@ adplug_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static void
|
||||
adplug_scan_tag(TagType type, const std::string &value,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
if (!value.empty())
|
||||
tag_handler_invoke_tag(handler, handler_ctx,
|
||||
@@ -98,7 +98,7 @@ adplug_scan_tag(TagType type, const std::string &value,
|
||||
|
||||
static bool
|
||||
adplug_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
CEmuopl opl(sample_rate, true, true);
|
||||
opl.init();
|
||||
@@ -110,7 +110,7 @@ adplug_scan_file(Path path_fs,
|
||||
tag_handler_invoke_duration(handler, handler_ctx,
|
||||
SongTime::FromMS(player->songlength()));
|
||||
|
||||
if (handler->tag != nullptr) {
|
||||
if (handler.tag != nullptr) {
|
||||
adplug_scan_tag(TAG_TITLE, player->gettitle(),
|
||||
handler, handler_ctx);
|
||||
adplug_scan_tag(TAG_ARTIST, player->getauthor(),
|
||||
|
@@ -263,7 +263,7 @@ audiofile_get_duration(InputStream &is)
|
||||
|
||||
static bool
|
||||
audiofile_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const auto duration = audiofile_get_duration(is);
|
||||
if (duration.IsNegative())
|
||||
|
@@ -106,7 +106,7 @@ dsdlib_valid_freq(uint32_t samplefreq)
|
||||
#ifdef ENABLE_ID3TAG
|
||||
void
|
||||
dsdlib_tag_id3(InputStream &is,
|
||||
const TagHandler *handler,
|
||||
const TagHandler &handler,
|
||||
void *handler_ctx, offset_type tagoffset)
|
||||
{
|
||||
if (tagoffset == 0 || !is.KnownSize())
|
||||
|
@@ -81,7 +81,7 @@ dsdlib_valid_freq(uint32_t samplefreq);
|
||||
*/
|
||||
void
|
||||
dsdlib_tag_id3(InputStream &is,
|
||||
const TagHandler *handler,
|
||||
const TagHandler &handler,
|
||||
void *handler_ctx, offset_type tagoffset);
|
||||
|
||||
#endif
|
||||
|
@@ -187,7 +187,7 @@ dsdiff_read_prop(Decoder *decoder, InputStream &is,
|
||||
|
||||
static void
|
||||
dsdiff_handle_native_tag(InputStream &is,
|
||||
const TagHandler *handler,
|
||||
const TagHandler &handler,
|
||||
void *handler_ctx, offset_type tagoffset,
|
||||
TagType type)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ static bool
|
||||
dsdiff_read_metadata_extra(Decoder *decoder, InputStream &is,
|
||||
DsdiffMetaData *metadata,
|
||||
DsdiffChunkHeader *chunk_header,
|
||||
const TagHandler *handler,
|
||||
const TagHandler &handler,
|
||||
void *handler_ctx)
|
||||
{
|
||||
|
||||
@@ -456,7 +456,7 @@ dsdiff_stream_decode(Decoder &decoder, InputStream &is)
|
||||
|
||||
static bool
|
||||
dsdiff_scan_stream(InputStream &is,
|
||||
gcc_unused const TagHandler *handler,
|
||||
gcc_unused const TagHandler &handler,
|
||||
gcc_unused void *handler_ctx)
|
||||
{
|
||||
DsdiffMetaData metadata;
|
||||
|
@@ -331,7 +331,7 @@ dsf_stream_decode(Decoder &decoder, InputStream &is)
|
||||
|
||||
static bool
|
||||
dsf_scan_stream(InputStream &is,
|
||||
gcc_unused const TagHandler *handler,
|
||||
gcc_unused const TagHandler &handler,
|
||||
gcc_unused void *handler_ctx)
|
||||
{
|
||||
/* check DSF metadata */
|
||||
|
@@ -419,7 +419,7 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
|
||||
|
||||
static bool
|
||||
faad_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
auto result = faad_get_file_time(is);
|
||||
if (!result.first)
|
||||
|
@@ -392,7 +392,7 @@ static void
|
||||
FfmpegScanMetadata(const AVStream &stream,
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FfmpegScanDictionary(stream.metadata, &handler, handler_ctx);
|
||||
FfmpegScanDictionary(stream.metadata, handler, handler_ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -401,7 +401,7 @@ FfmpegScanMetadata(const AVFormatContext &format_context, int audio_stream,
|
||||
{
|
||||
assert(audio_stream >= 0);
|
||||
|
||||
FfmpegScanDictionary(format_context.metadata, &handler, handler_ctx);
|
||||
FfmpegScanDictionary(format_context.metadata, handler, handler_ctx);
|
||||
FfmpegScanMetadata(*format_context.streams[audio_stream],
|
||||
handler, handler_ctx);
|
||||
}
|
||||
@@ -627,7 +627,7 @@ FfmpegScanStream(AVFormatContext &format_context,
|
||||
|
||||
const AVStream &stream = *format_context.streams[audio_stream];
|
||||
if (stream.duration != (int64_t)AV_NOPTS_VALUE)
|
||||
tag_handler_invoke_duration(&handler, handler_ctx,
|
||||
tag_handler_invoke_duration(handler, handler_ctx,
|
||||
FromFfmpegTime(stream.duration,
|
||||
stream.time_base));
|
||||
|
||||
@@ -638,7 +638,7 @@ FfmpegScanStream(AVFormatContext &format_context,
|
||||
|
||||
static bool
|
||||
ffmpeg_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
AVInputFormat *input_format = ffmpeg_probe(nullptr, is);
|
||||
if (input_format == nullptr)
|
||||
@@ -653,7 +653,7 @@ ffmpeg_scan_stream(InputStream &is,
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
|
||||
bool result = FfmpegScanStream(*f, *handler, handler_ctx);
|
||||
bool result = FfmpegScanStream(*f, handler, handler_ctx);
|
||||
avformat_close_input(&f);
|
||||
return result;
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ static constexpr struct tag_table ffmpeg_tags[] = {
|
||||
static void
|
||||
FfmpegScanTag(TagType type,
|
||||
AVDictionary *m, const char *name,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
AVDictionaryEntry *mt = nullptr;
|
||||
|
||||
@@ -53,7 +53,7 @@ FfmpegScanTag(TagType type,
|
||||
|
||||
static void
|
||||
FfmpegScanPairs(AVDictionary *dict,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
AVDictionaryEntry *i = nullptr;
|
||||
|
||||
@@ -64,9 +64,9 @@ FfmpegScanPairs(AVDictionary *dict,
|
||||
|
||||
void
|
||||
FfmpegScanDictionary(AVDictionary *dict,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
if (handler->tag != nullptr) {
|
||||
if (handler.tag != nullptr) {
|
||||
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
|
||||
FfmpegScanTag(TagType(i), dict, tag_item_names[i],
|
||||
handler, handler_ctx);
|
||||
@@ -77,6 +77,6 @@ FfmpegScanDictionary(AVDictionary *dict,
|
||||
handler, handler_ctx);
|
||||
}
|
||||
|
||||
if (handler->pair != nullptr)
|
||||
if (handler.pair != nullptr)
|
||||
FfmpegScanPairs(dict, handler, handler_ctx);
|
||||
}
|
||||
|
@@ -25,6 +25,6 @@ struct TagHandler;
|
||||
|
||||
void
|
||||
FfmpegScanDictionary(AVDictionary *dict,
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
const TagHandler &handler, void *handler_ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -82,7 +82,7 @@ flac_write_cb(const FLAC__StreamDecoder *dec, const FLAC__Frame *frame,
|
||||
|
||||
static bool
|
||||
flac_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FlacMetadataChain chain;
|
||||
if (!chain.Read(NarrowPath(path_fs))) {
|
||||
@@ -98,7 +98,7 @@ flac_scan_file(Path path_fs,
|
||||
|
||||
static bool
|
||||
flac_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FlacMetadataChain chain;
|
||||
if (!chain.Read(is)) {
|
||||
@@ -299,7 +299,7 @@ oggflac_init(gcc_unused const ConfigBlock &block)
|
||||
|
||||
static bool
|
||||
oggflac_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FlacMetadataChain chain;
|
||||
if (!chain.ReadOgg(NarrowPath(path_fs))) {
|
||||
@@ -315,7 +315,7 @@ oggflac_scan_file(Path path_fs,
|
||||
|
||||
static bool
|
||||
oggflac_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FlacMetadataChain chain;
|
||||
if (!chain.ReadOgg(is)) {
|
||||
|
@@ -80,7 +80,7 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
static bool
|
||||
flac_copy_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
const char *name, TagType tag_type,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const char *value = flac_comment_value(entry, name);
|
||||
if (value != nullptr) {
|
||||
@@ -93,9 +93,9 @@ flac_copy_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
|
||||
static void
|
||||
flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
if (handler->pair != nullptr) {
|
||||
if (handler.pair != nullptr) {
|
||||
const char *comment = (const char *)entry->entry;
|
||||
const DivideString split(comment, '=');
|
||||
if (split.IsDefined() && !split.IsEmpty())
|
||||
@@ -118,7 +118,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
|
||||
static void
|
||||
flac_scan_comments(const FLAC__StreamMetadata_VorbisComment *comment,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
for (unsigned i = 0; i < comment->num_comments; ++i)
|
||||
flac_scan_comment(&comment->comments[i],
|
||||
@@ -137,7 +137,7 @@ flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info)
|
||||
|
||||
void
|
||||
flac_scan_metadata(const FLAC__StreamMetadata *block,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
switch (block->type) {
|
||||
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
|
||||
@@ -160,12 +160,12 @@ Tag
|
||||
flac_vorbis_comments_to_tag(const FLAC__StreamMetadata_VorbisComment *comment)
|
||||
{
|
||||
TagBuilder tag_builder;
|
||||
flac_scan_comments(comment, &add_tag_handler, &tag_builder);
|
||||
flac_scan_comments(comment, add_tag_handler, &tag_builder);
|
||||
return tag_builder.Commit();
|
||||
}
|
||||
|
||||
void
|
||||
FlacMetadataChain::Scan(const TagHandler *handler, void *handler_ctx)
|
||||
FlacMetadataChain::Scan(const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
FLACMetadataIterator iterator(*this);
|
||||
|
||||
|
@@ -82,7 +82,7 @@ public:
|
||||
return FLAC__Metadata_ChainStatusString[GetStatus()];
|
||||
}
|
||||
|
||||
void Scan(const TagHandler *handler, void *handler_ctx);
|
||||
void Scan(const TagHandler &handler, void *handler_ctx);
|
||||
};
|
||||
|
||||
class FLACMetadataIterator {
|
||||
@@ -126,6 +126,6 @@ flac_vorbis_comments_to_tag(const FLAC__StreamMetadata_VorbisComment *comment);
|
||||
|
||||
void
|
||||
flac_scan_metadata(const FLAC__StreamMetadata *block,
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
const TagHandler &handler, void *handler_ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -201,7 +201,7 @@ fluidsynth_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static bool
|
||||
fluidsynth_scan_file(Path path_fs,
|
||||
gcc_unused const TagHandler *handler,
|
||||
gcc_unused const TagHandler &handler,
|
||||
gcc_unused void *handler_ctx)
|
||||
{
|
||||
return fluid_is_midifile(path_fs.c_str());
|
||||
|
@@ -215,7 +215,7 @@ gme_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static void
|
||||
ScanGmeInfo(const gme_info_t &info, unsigned song_num, int track_count,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
if (info.play_length > 0)
|
||||
tag_handler_invoke_duration(handler, handler_ctx,
|
||||
@@ -255,7 +255,7 @@ ScanGmeInfo(const gme_info_t &info, unsigned song_num, int track_count,
|
||||
|
||||
static bool
|
||||
ScanMusicEmu(Music_Emu *emu, unsigned song_num,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
gme_info_t *ti;
|
||||
const char *gme_err = gme_track_info(emu, &ti, song_num);
|
||||
@@ -275,7 +275,7 @@ ScanMusicEmu(Music_Emu *emu, unsigned song_num,
|
||||
|
||||
static bool
|
||||
gme_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const auto container = ParseContainerPath(path_fs);
|
||||
|
||||
|
@@ -1083,7 +1083,7 @@ mp3_decode(Decoder &decoder, InputStream &input_stream)
|
||||
|
||||
static bool
|
||||
mad_decoder_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const auto result = mad_decoder_total_file_time(is);
|
||||
if (!result.first)
|
||||
|
@@ -187,7 +187,7 @@ mikmod_decoder_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static bool
|
||||
mikmod_decoder_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
/* deconstify the path because libmikmod wants a non-const
|
||||
string pointer */
|
||||
|
@@ -177,7 +177,7 @@ mod_decode(Decoder &decoder, InputStream &is)
|
||||
|
||||
static bool
|
||||
modplug_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
ModPlugFile *f = LoadModPlugFile(nullptr, is);
|
||||
if (f == nullptr)
|
||||
|
@@ -249,7 +249,7 @@ mpcdec_get_file_duration(InputStream &is)
|
||||
|
||||
static bool
|
||||
mpcdec_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const auto duration = mpcdec_get_file_duration(is);
|
||||
if (duration.IsNegative())
|
||||
|
@@ -287,7 +287,7 @@ mpd_mpg123_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static bool
|
||||
mpd_mpg123_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
int error;
|
||||
mpg123_handle *const handle = mpg123_new(nullptr, &error);
|
||||
|
@@ -332,7 +332,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
|
||||
DecoderCommand cmd;
|
||||
if (ScanOpusTags(packet.packet, packet.bytes,
|
||||
&rgi,
|
||||
&add_tag_handler, &tag_builder) &&
|
||||
add_tag_handler, &tag_builder) &&
|
||||
!tag_builder.IsEmpty()) {
|
||||
decoder_replay_gain(decoder, &rgi);
|
||||
|
||||
@@ -433,7 +433,7 @@ mpd_opus_stream_decode(Decoder &decoder,
|
||||
|
||||
static bool
|
||||
mpd_opus_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
OggSyncState oy(is);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ ParseOpusTagName(const char *name)
|
||||
static void
|
||||
ScanOneOpusTag(const char *name, const char *value,
|
||||
ReplayGainInfo *rgi,
|
||||
const TagHandler *handler, void *ctx)
|
||||
const TagHandler &handler, void *ctx)
|
||||
{
|
||||
if (rgi != nullptr && strcmp(name, "R128_TRACK_GAIN") == 0) {
|
||||
/* R128_TRACK_GAIN is a Q7.8 fixed point number in
|
||||
@@ -57,7 +57,7 @@ ScanOneOpusTag(const char *name, const char *value,
|
||||
|
||||
tag_handler_invoke_pair(handler, ctx, name, value);
|
||||
|
||||
if (handler->tag != nullptr) {
|
||||
if (handler.tag != nullptr) {
|
||||
TagType t = ParseOpusTagName(name);
|
||||
if (t != TAG_NUM_OF_ITEM_TYPES)
|
||||
tag_handler_invoke_tag(handler, ctx, t, value);
|
||||
@@ -67,13 +67,13 @@ ScanOneOpusTag(const char *name, const char *value,
|
||||
bool
|
||||
ScanOpusTags(const void *data, size_t size,
|
||||
ReplayGainInfo *rgi,
|
||||
const TagHandler *handler, void *ctx)
|
||||
const TagHandler &handler, void *ctx)
|
||||
{
|
||||
OpusReader r(data, size);
|
||||
if (!r.Expect("OpusTags", 8))
|
||||
return false;
|
||||
|
||||
if (handler->pair == nullptr && handler->tag == nullptr)
|
||||
if (handler.pair == nullptr && handler.tag == nullptr)
|
||||
return true;
|
||||
|
||||
if (!r.SkipString())
|
||||
|
@@ -30,6 +30,6 @@ struct TagHandler;
|
||||
bool
|
||||
ScanOpusTags(const void *data, size_t size,
|
||||
ReplayGainInfo *rgi,
|
||||
const TagHandler *handler, void *ctx);
|
||||
const TagHandler &handler, void *ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -286,7 +286,7 @@ sidplay_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static bool
|
||||
sidplay_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const auto container = ParseContainerPath(path_fs);
|
||||
const unsigned song_num = container.track;
|
||||
|
@@ -244,7 +244,7 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
|
||||
|
||||
static void
|
||||
sndfile_handle_tag(SNDFILE *sf, int str, TagType tag,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const char *value = sf_get_string(sf, str);
|
||||
if (value != nullptr)
|
||||
@@ -266,7 +266,7 @@ static constexpr struct {
|
||||
|
||||
static bool
|
||||
sndfile_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
SF_INFO info;
|
||||
|
||||
|
@@ -56,7 +56,7 @@ vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments)
|
||||
static bool
|
||||
vorbis_copy_comment(const char *comment,
|
||||
const char *name, TagType tag_type,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
const char *value;
|
||||
|
||||
@@ -71,9 +71,9 @@ vorbis_copy_comment(const char *comment,
|
||||
|
||||
static void
|
||||
vorbis_scan_comment(const char *comment,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
if (handler->pair != nullptr) {
|
||||
if (handler.pair != nullptr) {
|
||||
const DivideString split(comment, '=');
|
||||
if (split.IsDefined() && !split.IsEmpty())
|
||||
tag_handler_invoke_pair(handler, handler_ctx,
|
||||
@@ -95,7 +95,7 @@ vorbis_scan_comment(const char *comment,
|
||||
|
||||
void
|
||||
vorbis_comments_scan(char **comments,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
while (*comments)
|
||||
vorbis_scan_comment(*comments++,
|
||||
@@ -107,7 +107,7 @@ Tag *
|
||||
vorbis_comments_to_tag(char **comments)
|
||||
{
|
||||
TagBuilder tag_builder;
|
||||
vorbis_comments_scan(comments, &add_tag_handler, &tag_builder);
|
||||
vorbis_comments_scan(comments, add_tag_handler, &tag_builder);
|
||||
return tag_builder.IsEmpty()
|
||||
? nullptr
|
||||
: tag_builder.CommitNew();
|
||||
|
@@ -31,7 +31,7 @@ vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments);
|
||||
|
||||
void
|
||||
vorbis_comments_scan(char **comments,
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
const TagHandler &handler, void *handler_ctx);
|
||||
|
||||
Tag *
|
||||
vorbis_comments_to_tag(char **comments);
|
||||
|
@@ -335,7 +335,7 @@ vorbis_stream_decode(Decoder &decoder,
|
||||
|
||||
static bool
|
||||
vorbis_scan_stream(InputStream &is,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
VorbisInputStream vis(nullptr, is);
|
||||
OggVorbis_File vf;
|
||||
|
@@ -243,7 +243,7 @@ wavpack_replaygain(ReplayGainInfo &rgi,
|
||||
static void
|
||||
wavpack_scan_tag_item(WavpackContext *wpc, const char *name,
|
||||
TagType type,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
char buffer[1024];
|
||||
int len = WavpackGetTagItem(wpc, name, buffer, sizeof(buffer));
|
||||
@@ -256,7 +256,7 @@ wavpack_scan_tag_item(WavpackContext *wpc, const char *name,
|
||||
|
||||
static void
|
||||
wavpack_scan_pair(WavpackContext *wpc, const char *name,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
char buffer[8192];
|
||||
int len = WavpackGetTagItem(wpc, name, buffer, sizeof(buffer));
|
||||
@@ -271,7 +271,7 @@ wavpack_scan_pair(WavpackContext *wpc, const char *name,
|
||||
*/
|
||||
static bool
|
||||
wavpack_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
char error[ERRORLEN];
|
||||
WavpackContext *wpc = WavpackOpenFileInput(path_fs.c_str(), error,
|
||||
@@ -302,7 +302,7 @@ wavpack_scan_file(Path path_fs,
|
||||
wavpack_scan_tag_item(wpc, i->name, i->type,
|
||||
handler, handler_ctx);
|
||||
|
||||
if (handler->pair != nullptr) {
|
||||
if (handler.pair != nullptr) {
|
||||
char name[64];
|
||||
|
||||
for (int i = 0, n = WavpackGetNumTagItems(wpc);
|
||||
|
@@ -123,7 +123,7 @@ wildmidi_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
static bool
|
||||
wildmidi_scan_file(Path path_fs,
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
const TagHandler &handler, void *handler_ctx)
|
||||
{
|
||||
midi *wm = WildMidi_Open(path_fs.c_str());
|
||||
if (wm == nullptr)
|
||||
|
Reference in New Issue
Block a user