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

@@ -30,9 +30,9 @@
#include <exception>
bool
ScanGenericTags(InputStream &is, const TagHandler &handler, void *ctx)
ScanGenericTags(InputStream &is, TagHandler &handler) noexcept
{
if (tag_ape_scan2(is, handler, ctx))
if (tag_ape_scan2(is, handler))
return true;
#ifdef ENABLE_ID3TAG
@@ -42,19 +42,19 @@ ScanGenericTags(InputStream &is, const TagHandler &handler, void *ctx)
return false;
}
return tag_id3_scan(is, handler, ctx);
return tag_id3_scan(is, handler);
#else
return false;
#endif
}
bool
ScanGenericTags(Path path, const TagHandler &handler, void *ctx)
ScanGenericTags(Path path, TagHandler &handler) noexcept
try {
Mutex mutex;
auto is = OpenLocalInputStream(path, mutex);
return ScanGenericTags(*is, handler, ctx);
return ScanGenericTags(*is, handler);
} catch (...) {
LogError(std::current_exception());
return false;