diff options
author | Max Kellermann <max@duempel.org> | 2016-02-23 10:15:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-02-23 10:15:38 +0100 |
commit | 779d73f94b3dba3e5c8124e8994e4c8a8fb6ece6 (patch) | |
tree | 215235e2e18ccb155ddf6fc25f90667692744b83 /src/tag | |
parent | 73307bf2e79b36df4939ef14771dd14e17d73cc5 (diff) |
tag/TagId3: add overload with InputStream& parameter
Diffstat (limited to 'src/tag')
-rw-r--r-- | src/tag/TagId3.cxx | 17 | ||||
-rw-r--r-- | src/tag/TagId3.hxx | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/tag/TagId3.cxx b/src/tag/TagId3.cxx index 6c46d1764..14d109391 100644 --- a/src/tag/TagId3.cxx +++ b/src/tag/TagId3.cxx @@ -344,6 +344,23 @@ tag_id3_import(struct id3_tag *tag) } bool +tag_id3_scan(InputStream &is, + const TagHandler &handler, void *handler_ctx) +{ + UniqueId3Tag tag; + + try { + tag = tag_id3_load(is); + } catch (const std::runtime_error &e) { + LogError(e); + return false; + } + + scan_id3_tag(tag.get(), handler, handler_ctx); + return true; +} + +bool tag_id3_scan(Path path_fs, const TagHandler &handler, void *handler_ctx) { diff --git a/src/tag/TagId3.hxx b/src/tag/TagId3.hxx index fb2668c3b..b1146efe2 100644 --- a/src/tag/TagId3.hxx +++ b/src/tag/TagId3.hxx @@ -23,6 +23,7 @@ #include "check.h" #include "Compiler.h" +class InputStream; class Path; struct TagHandler; struct Tag; @@ -31,6 +32,10 @@ struct id3_tag; #ifdef ENABLE_ID3TAG bool +tag_id3_scan(InputStream &is, + const TagHandler &handler, void *handler_ctx); + +bool tag_id3_scan(Path path_fs, const TagHandler &handler, void *handler_ctx); @@ -50,6 +55,14 @@ scan_id3_tag(id3_tag *tag, #include "fs/Path.hxx" static inline bool +tag_id3_scan(gcc_unused InputStream &is, + gcc_unused const TagHandler &handler, + gcc_unused void *handler_ctx) +{ + return false; +} + +static inline bool tag_id3_scan(gcc_unused Path path_fs, gcc_unused const TagHandler &handler, gcc_unused void *handler_ctx) |