tag/Handler: convert to class with virtual methods

This commit is contained in:
Max Kellermann
2018-07-05 19:07:05 +02:00
parent 09d4176210
commit 3d3a1232b1
49 changed files with 414 additions and 496 deletions

View File

@@ -175,20 +175,17 @@ mod_decode(DecoderClient &client, InputStream &is)
}
static bool
modplug_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx) noexcept
modplug_scan_stream(InputStream &is, TagHandler &handler) noexcept
{
ModPlugFile *f = LoadModPlugFile(nullptr, is);
if (f == nullptr)
return false;
tag_handler_invoke_duration(handler, handler_ctx,
SongTime::FromMS(ModPlug_GetLength(f)));
handler.OnDuration(SongTime::FromMS(ModPlug_GetLength(f)));
const char *title = ModPlug_GetName(f);
if (title != nullptr)
tag_handler_invoke_tag(handler, handler_ctx,
TAG_TITLE, title);
handler.OnTag(TAG_TITLE, title);
ModPlug_Unload(f);