tag/handler: use CamelCase
This commit is contained in:
@@ -77,7 +77,7 @@ ForEachValue(const char *value, const char *end, C &&callback)
|
||||
static bool
|
||||
tag_ape_import_item(unsigned long flags,
|
||||
const char *key, StringView value,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
/* we only care about utf-8 text tags */
|
||||
if ((flags & (0x3 << 1)) != 0)
|
||||
@@ -107,7 +107,7 @@ tag_ape_import_item(unsigned long flags,
|
||||
|
||||
bool
|
||||
tag_ape_scan2(InputStream &is,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
bool recognized = false;
|
||||
|
||||
@@ -124,7 +124,7 @@ tag_ape_scan2(InputStream &is,
|
||||
|
||||
bool
|
||||
tag_ape_scan2(Path path_fs,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
bool recognized = false;
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
class Path;
|
||||
class InputStream;
|
||||
struct tag_handler;
|
||||
struct TagHandler;
|
||||
|
||||
extern const struct tag_table ape_tags[];
|
||||
|
||||
@@ -35,7 +35,7 @@ extern const struct tag_table ape_tags[];
|
||||
*/
|
||||
bool
|
||||
tag_ape_scan2(InputStream &is,
|
||||
const tag_handler *handler, void *handler_ctx);
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
|
||||
/**
|
||||
* Scan the APE tags of a file.
|
||||
@@ -44,6 +44,6 @@ tag_ape_scan2(InputStream &is,
|
||||
*/
|
||||
bool
|
||||
tag_ape_scan2(Path path_fs,
|
||||
const tag_handler *handler, void *handler_ctx);
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -51,7 +51,7 @@ add_tag_tag(TagType type, const char *value, void *ctx)
|
||||
tag.AddItem(type, value);
|
||||
}
|
||||
|
||||
const struct tag_handler add_tag_handler = {
|
||||
const TagHandler add_tag_handler = {
|
||||
add_tag_duration,
|
||||
add_tag_tag,
|
||||
nullptr,
|
||||
@@ -66,7 +66,7 @@ full_tag_pair(const char *name, gcc_unused const char *value, void *ctx)
|
||||
tag.SetHasPlaylist(true);
|
||||
}
|
||||
|
||||
const struct tag_handler full_tag_handler = {
|
||||
const TagHandler full_tag_handler = {
|
||||
add_tag_duration,
|
||||
add_tag_tag,
|
||||
full_tag_pair,
|
||||
|
@@ -29,7 +29,7 @@
|
||||
/**
|
||||
* A callback table for receiving metadata of a song.
|
||||
*/
|
||||
struct tag_handler {
|
||||
struct TagHandler {
|
||||
/**
|
||||
* Declare the duration of a song. Do not call
|
||||
* this when the duration could not be determined, because
|
||||
@@ -53,7 +53,7 @@ struct tag_handler {
|
||||
};
|
||||
|
||||
static inline void
|
||||
tag_handler_invoke_duration(const struct tag_handler *handler, void *ctx,
|
||||
tag_handler_invoke_duration(const TagHandler *handler, void *ctx,
|
||||
SongTime duration)
|
||||
{
|
||||
assert(handler != nullptr);
|
||||
@@ -63,7 +63,7 @@ tag_handler_invoke_duration(const struct tag_handler *handler, void *ctx,
|
||||
}
|
||||
|
||||
static inline void
|
||||
tag_handler_invoke_tag(const struct tag_handler *handler, void *ctx,
|
||||
tag_handler_invoke_tag(const TagHandler *handler, void *ctx,
|
||||
TagType type, const char *value)
|
||||
{
|
||||
assert(handler != nullptr);
|
||||
@@ -75,7 +75,7 @@ tag_handler_invoke_tag(const struct tag_handler *handler, void *ctx,
|
||||
}
|
||||
|
||||
static inline void
|
||||
tag_handler_invoke_pair(const struct tag_handler *handler, void *ctx,
|
||||
tag_handler_invoke_pair(const TagHandler *handler, void *ctx,
|
||||
const char *name, const char *value)
|
||||
{
|
||||
assert(handler != nullptr);
|
||||
@@ -87,16 +87,16 @@ tag_handler_invoke_pair(const struct tag_handler *handler, void *ctx,
|
||||
}
|
||||
|
||||
/**
|
||||
* This #tag_handler implementation adds tag values to a #TagBuilder object
|
||||
* This #TagHandler implementation adds tag values to a #TagBuilder object
|
||||
* (casted from the context pointer).
|
||||
*/
|
||||
extern const struct tag_handler add_tag_handler;
|
||||
extern const TagHandler add_tag_handler;
|
||||
|
||||
/**
|
||||
* This #tag_handler implementation adds tag values to a #TagBuilder object
|
||||
* This #TagHandler implementation adds tag values to a #TagBuilder object
|
||||
* (casted from the context pointer), and supports the has_playlist
|
||||
* attribute.
|
||||
*/
|
||||
extern const struct tag_handler full_tag_handler;
|
||||
extern const TagHandler full_tag_handler;
|
||||
|
||||
#endif
|
||||
|
@@ -97,7 +97,7 @@ import_id3_string(const id3_ucs4_t *ucs4)
|
||||
static void
|
||||
tag_id3_import_text_frame(const struct id3_frame *frame,
|
||||
TagType type,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
if (frame->nfields != 2)
|
||||
return;
|
||||
@@ -140,7 +140,7 @@ tag_id3_import_text_frame(const struct id3_frame *frame,
|
||||
*/
|
||||
static void
|
||||
tag_id3_import_text(struct id3_tag *tag, const char *id, TagType type,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
const struct id3_frame *frame;
|
||||
for (unsigned i = 0;
|
||||
@@ -160,7 +160,7 @@ tag_id3_import_text(struct id3_tag *tag, const char *id, TagType type,
|
||||
*/
|
||||
static void
|
||||
tag_id3_import_comment_frame(const struct id3_frame *frame, TagType type,
|
||||
const struct tag_handler *handler,
|
||||
const TagHandler *handler,
|
||||
void *handler_ctx)
|
||||
{
|
||||
if (frame->nfields != 4)
|
||||
@@ -189,7 +189,7 @@ tag_id3_import_comment_frame(const struct id3_frame *frame, TagType type,
|
||||
*/
|
||||
static void
|
||||
tag_id3_import_comment(struct id3_tag *tag, const char *id, TagType type,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
const struct id3_frame *frame;
|
||||
for (unsigned i = 0;
|
||||
@@ -226,7 +226,7 @@ tag_id3_parse_txxx_name(const char *name)
|
||||
*/
|
||||
static void
|
||||
tag_id3_import_musicbrainz(struct id3_tag *id3_tag,
|
||||
const struct tag_handler *handler,
|
||||
const TagHandler *handler,
|
||||
void *handler_ctx)
|
||||
{
|
||||
for (unsigned i = 0;; ++i) {
|
||||
@@ -262,7 +262,7 @@ tag_id3_import_musicbrainz(struct id3_tag *id3_tag,
|
||||
*/
|
||||
static void
|
||||
tag_id3_import_ufid(struct id3_tag *id3_tag,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
for (unsigned i = 0;; ++i) {
|
||||
const id3_frame *frame = id3_tag_findframe(id3_tag, "UFID", i);
|
||||
@@ -296,7 +296,7 @@ tag_id3_import_ufid(struct id3_tag *id3_tag,
|
||||
|
||||
void
|
||||
scan_id3_tag(struct id3_tag *tag,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
tag_id3_import_text(tag, ID3_FRAME_ARTIST, TAG_ARTIST,
|
||||
handler, handler_ctx);
|
||||
@@ -345,7 +345,7 @@ tag_id3_import(struct id3_tag *tag)
|
||||
|
||||
bool
|
||||
tag_id3_scan(Path path_fs,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
const TagHandler *handler, void *handler_ctx)
|
||||
{
|
||||
UniqueId3Tag tag;
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "Compiler.h"
|
||||
|
||||
class Path;
|
||||
struct tag_handler;
|
||||
struct TagHandler;
|
||||
struct Tag;
|
||||
struct id3_tag;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct id3_tag;
|
||||
|
||||
bool
|
||||
tag_id3_scan(Path path_fs,
|
||||
const tag_handler *handler, void *handler_ctx);
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
|
||||
Tag *
|
||||
tag_id3_import(id3_tag *);
|
||||
@@ -43,7 +43,7 @@ tag_id3_import(id3_tag *);
|
||||
*/
|
||||
void
|
||||
scan_id3_tag(id3_tag *tag,
|
||||
const tag_handler *handler, void *handler_ctx);
|
||||
const TagHandler *handler, void *handler_ctx);
|
||||
|
||||
#else
|
||||
|
||||
@@ -51,7 +51,7 @@ scan_id3_tag(id3_tag *tag,
|
||||
|
||||
static inline bool
|
||||
tag_id3_scan(gcc_unused Path path_fs,
|
||||
gcc_unused const tag_handler *handler,
|
||||
gcc_unused const TagHandler *handler,
|
||||
gcc_unused void *handler_ctx)
|
||||
{
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user