tag_handler: add new handler that updates has_playlist
This commit is contained in:
parent
4b36af4a34
commit
686d8bbe69
@ -20,6 +20,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "tag_handler.h"
|
#include "tag_handler.h"
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_tag_duration(unsigned seconds, void *ctx)
|
add_tag_duration(unsigned seconds, void *ctx)
|
||||||
{
|
{
|
||||||
@ -41,3 +43,18 @@ const struct tag_handler add_tag_handler = {
|
|||||||
.tag = add_tag_tag,
|
.tag = add_tag_tag,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
full_tag_pair(const char *name, G_GNUC_UNUSED const char *value, void *ctx)
|
||||||
|
{
|
||||||
|
struct tag *tag = ctx;
|
||||||
|
|
||||||
|
if (g_ascii_strcasecmp(name, "cuesheet") == 0)
|
||||||
|
tag->has_playlist = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const struct tag_handler full_tag_handler = {
|
||||||
|
.duration = add_tag_duration,
|
||||||
|
.tag = add_tag_tag,
|
||||||
|
.pair = full_tag_pair,
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -91,4 +91,11 @@ tag_handler_invoke_pair(const struct tag_handler *handler, void *ctx,
|
|||||||
*/
|
*/
|
||||||
extern const struct tag_handler add_tag_handler;
|
extern const struct tag_handler add_tag_handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This #tag_handler implementation adds tag values to a #tag object
|
||||||
|
* (casted from the context pointer), and supports the has_playlist
|
||||||
|
* attribute.
|
||||||
|
*/
|
||||||
|
extern const struct tag_handler full_tag_handler;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user