Tag Processor

Tag Processor — Process tags

Synopsis

#include <rclib-tag.h>

struct              RCLibTagMetadata;
RCLibTagMetadata *  rclib_tag_copy_data                 (const RCLibTagMetadata *mmd);
void                rclib_tag_free                      (RCLibTagMetadata *mmd);
const gchar *       rclib_tag_get_fallback_encoding     ();
gchar *             rclib_tag_get_name_from_fpath       (const gchar *filename);
gchar *             rclib_tag_get_name_from_uri         (const gchar *uri);
RCLibTagMetadata *  rclib_tag_read_metadata             (const gchar *uri);
void                rclib_tag_set_fallback_encoding     (const gchar *encoding);

Object Hierarchy

  GBoxed
   +----RCLibTagMetadata

Description

Process the tags (metadata) of music, and provide some data structures and functions for tag processing.

Details

struct RCLibTagMetadata

struct RCLibTagMetadata {
    gint64 length;
    gchar *uri;
    guint tracknum;
    guint bitrate;
    gint samplerate;
    gint channels;
    gint year;
    gchar *title;
    gchar *artist;
    gchar *album;
    gchar *comment;
    gchar *ftype;
    gchar *genre;
    gchar *emb_cue;
    GstBuffer *image;
    gboolean eos;
    gboolean audio_flag;
    gboolean video_flag;
    gpointer user_data;
};

The structure for storing the music metadata.

gint64 length;

the length of the music

gchar *uri;

the URI of the music

guint tracknum;

the track number of the music

guint bitrate;

the bitrate of the music

gint samplerate;

the sample rate of the music

gint channels;

the channel number of the music

gint year;

the year of the music

gchar *title;

the title text of the music

gchar *artist;

the artist text of the music

gchar *album;

the album text of the music

gchar *comment;

the comment text of the music

gchar *ftype;

the file type of the music

gchar *genre;

the genre of the music

gchar *emb_cue;

the embedded CUE data of the music

GstBuffer *image;

the GstBuffer which contains the cover image

gboolean eos;

the EOS signal

gboolean audio_flag;

whether this file has audio

gboolean video_flag;

whether this file has video

gpointer user_data;

the user data

rclib_tag_copy_data ()

RCLibTagMetadata *  rclib_tag_copy_data                 (const RCLibTagMetadata *mmd);

Copy the RCLibTagMetadata data from the given parameter.

mmd :

the RCLibTagMetadata data to copy

Returns :

The copied data. [transfer full]

rclib_tag_free ()

void                rclib_tag_free                      (RCLibTagMetadata *mmd);

Free the memory allocated for metadata struct (RCLibTagMetadata).

mmd :

the metadata

rclib_tag_get_fallback_encoding ()

const gchar *       rclib_tag_get_fallback_encoding     ();

Get the fallback encoding for the tag reading.

Returns :

The fallback encoding.

rclib_tag_get_name_from_fpath ()

gchar *             rclib_tag_get_name_from_fpath       (const gchar *filename);

Return the base-name without extension from a full path or file name.

filename :

the full path or file name

Returns :

The base-name without extension.

rclib_tag_get_name_from_uri ()

gchar *             rclib_tag_get_name_from_uri         (const gchar *uri);

Return the base-name without extension from a URI.

uri :

the URI

Returns :

The base-name without extension.

rclib_tag_read_metadata ()

RCLibTagMetadata *  rclib_tag_read_metadata             (const gchar *uri);

Read tag (metadata) from given URI.

uri :

the URI of the music file

Returns :

The Metadata of the music, NULL if the file is not a music file, free after usage.

rclib_tag_set_fallback_encoding ()

void                rclib_tag_set_fallback_encoding     (const gchar *encoding);

Set the fallback encoding for tag (metadata) reading, notice that this setting will also affect the tag reading in the Core module.

encoding :

the fallback encoding to set