tag/TagId3: add overload with InputStream& parameter
This commit is contained in:
src/tag
@ -343,6 +343,23 @@ tag_id3_import(struct id3_tag *tag)
|
|||||||
: tag_builder.CommitNew();
|
: tag_builder.CommitNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
bool
|
||||||
tag_id3_scan(Path path_fs,
|
tag_id3_scan(Path path_fs,
|
||||||
const TagHandler &handler, void *handler_ctx)
|
const TagHandler &handler, void *handler_ctx)
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "check.h"
|
#include "check.h"
|
||||||
#include "Compiler.h"
|
#include "Compiler.h"
|
||||||
|
|
||||||
|
class InputStream;
|
||||||
class Path;
|
class Path;
|
||||||
struct TagHandler;
|
struct TagHandler;
|
||||||
struct Tag;
|
struct Tag;
|
||||||
@ -30,6 +31,10 @@ struct id3_tag;
|
|||||||
|
|
||||||
#ifdef ENABLE_ID3TAG
|
#ifdef ENABLE_ID3TAG
|
||||||
|
|
||||||
|
bool
|
||||||
|
tag_id3_scan(InputStream &is,
|
||||||
|
const TagHandler &handler, void *handler_ctx);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tag_id3_scan(Path path_fs,
|
tag_id3_scan(Path path_fs,
|
||||||
const TagHandler &handler, void *handler_ctx);
|
const TagHandler &handler, void *handler_ctx);
|
||||||
@ -49,6 +54,14 @@ scan_id3_tag(id3_tag *tag,
|
|||||||
|
|
||||||
#include "fs/Path.hxx"
|
#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
|
static inline bool
|
||||||
tag_id3_scan(gcc_unused Path path_fs,
|
tag_id3_scan(gcc_unused Path path_fs,
|
||||||
gcc_unused const TagHandler &handler,
|
gcc_unused const TagHandler &handler,
|
||||||
|
Reference in New Issue
Block a user