Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
Basic Tuple handling API. More...
#include <glib.h>
#include <mowgli.h>
Go to the source code of this file.
Classes | |
struct | TupleBasicType |
struct | TupleValue |
struct | Tuple |
Structure for holding and passing around miscellaneous track metadata. More... | |
Defines | |
#define | TUPLE_NAME_MAX 20 |
#define | tuple_free(x) mowgli_object_unref(x); |
Enumerations | |
enum | { FIELD_ARTIST = 0, FIELD_TITLE, FIELD_ALBUM, FIELD_COMMENT, FIELD_GENRE, FIELD_TRACK, FIELD_TRACK_NUMBER, FIELD_LENGTH, FIELD_YEAR, FIELD_QUALITY, FIELD_CODEC, FIELD_FILE_NAME, FIELD_FILE_PATH, FIELD_FILE_EXT, FIELD_SONG_ARTIST, FIELD_MTIME, FIELD_FORMATTER, FIELD_PERFORMER, FIELD_COPYRIGHT, FIELD_DATE, FIELD_SUBSONG_ID, FIELD_SUBSONG_NUM, FIELD_MIMETYPE, FIELD_BITRATE, FIELD_SEGMENT_START, FIELD_SEGMENT_END, FIELD_GAIN_ALBUM_GAIN, FIELD_GAIN_ALBUM_PEAK, FIELD_GAIN_TRACK_GAIN, FIELD_GAIN_TRACK_PEAK, FIELD_GAIN_GAIN_UNIT, FIELD_GAIN_PEAK_UNIT, FIELD_COMPOSER, FIELD_LAST } |
Ordered enum for basic Tuple fields. More... | |
enum | TupleValueType { TUPLE_STRING, TUPLE_INT, TUPLE_UNKNOWN } |
Functions | |
Tuple * | tuple_new (void) |
Allocates a new empty Tuple structure. | |
Tuple * | tuple_copy (const Tuple *) |
Creates a copy of given Tuple structure, with copied data. | |
void | tuple_set_filename (Tuple *tuple, const gchar *filename) |
Sets filename/URI related fields of a Tuple structure, based on the given filename argument. | |
Tuple * | tuple_new_from_filename (const gchar *filename) |
Allocates a new Tuple structure, setting filename/URI related fields based on the given filename argument by calling tuple_set_filename. | |
gboolean | tuple_associate_string_rel (Tuple *tuple, const gint nfield, const gchar *field, gchar *string) |
Associates given string to a field in specified Tuple. | |
gboolean | tuple_associate_string (Tuple *tuple, const gint nfield, const gchar *field, const gchar *string) |
Associates copy of given string to a field in specified Tuple. | |
gboolean | tuple_associate_int (Tuple *tuple, const gint nfield, const gchar *field, gint integer) |
Associates given integer to a field in specified Tuple. | |
void | tuple_disassociate (Tuple *tuple, const gint nfield, const gchar *field) |
Disassociates given field from specified Tuple structure. | |
void | tuple_disassociate_now (TupleValue *value) |
TupleValueType | tuple_get_value_type (const Tuple *tuple, gint nfield, const gchar *field) |
Returns TupleValueType of given Tuple field. | |
const gchar * | tuple_get_string (const Tuple *tuple, gint nfield, const gchar *field) |
Returns pointer to a string associated to Tuple field. | |
gint | tuple_get_int (const Tuple *tuple, gint nfield, const gchar *field) |
Returns integer associated to Tuple field. | |
void | tuple_set_format (Tuple *tuple, const gchar *format, gint channels, gint samplerate, gint bitrate) |
Variables | |
const TupleBasicType | tuple_fields [FIELD_LAST] |
Ordered table of basic Tuple field names and their TupleValueType. |
#define tuple_free | ( | x | ) | mowgli_object_unref(x); |
Definition at line 144 of file tuple.h.
Referenced by cancel_set_tuple(), entry_free(), entry_set_tuple_real(), and make_entries().
#define TUPLE_NAME_MAX 20 |
Definition at line 102 of file tuple.h.
Referenced by tuple_associate_data(), and tuple_copy_value().
anonymous enum |
Ordered enum for basic Tuple fields.
FIELD_ARTIST | |
FIELD_TITLE |
Song title. |
FIELD_ALBUM |
Album name. |
FIELD_COMMENT |
Freeform comment. |
FIELD_GENRE |
Song's genre. |
FIELD_TRACK | |
FIELD_TRACK_NUMBER | |
FIELD_LENGTH |
Track length in seconds. |
FIELD_YEAR |
Year of production/performance/etc. |
FIELD_QUALITY |
String representing quality, such as "lossy", "lossless", "sequenced". |
FIELD_CODEC |
Codec name or similar. |
FIELD_FILE_NAME |
File name part of the location URI. |
FIELD_FILE_PATH |
Path part of the location URI. |
FIELD_FILE_EXT |
Filename extension part of the location URI. |
FIELD_SONG_ARTIST | |
FIELD_MTIME |
Playlist entry modification time for internal use. |
FIELD_FORMATTER |
Playlist entry Tuplez formatting string. |
FIELD_PERFORMER | |
FIELD_COPYRIGHT | |
FIELD_DATE | |
FIELD_SUBSONG_ID |
Index number of subsong/tune. |
FIELD_SUBSONG_NUM |
Total number of subsongs in the file. |
FIELD_MIMETYPE | |
FIELD_BITRATE |
Bitrate in kbps. |
FIELD_SEGMENT_START | |
FIELD_SEGMENT_END | |
FIELD_GAIN_ALBUM_GAIN | |
FIELD_GAIN_ALBUM_PEAK | |
FIELD_GAIN_TRACK_GAIN | |
FIELD_GAIN_TRACK_PEAK | |
FIELD_GAIN_GAIN_UNIT | |
FIELD_GAIN_PEAK_UNIT | |
FIELD_COMPOSER |
Composer of song, if different than artist. |
FIELD_LAST |
enum TupleValueType |
gboolean tuple_associate_int | ( | Tuple * | tuple, |
const gint | nfield, | ||
const gchar * | field, | ||
gint | integer | ||
) |
Associates given integer to a field in specified Tuple.
If field already exists, old value is freed and replaced.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | nfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
[in] | integer | Integer to be associated to given field in Tuple. |
Definition at line 502 of file tuple.c.
Referenced by tuple_set_filename(), and tuple_set_format().
gboolean tuple_associate_string | ( | Tuple * | tuple, |
const gint | nfield, | ||
const gchar * | field, | ||
const gchar * | string | ||
) |
Associates copy of given string to a field in specified Tuple.
If field already exists, old value is freed and replaced.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | nfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
[in] | string | String to be associated to given field in Tuple. |
Definition at line 446 of file tuple.c.
Referenced by tuple_set_format().
gboolean tuple_associate_string_rel | ( | Tuple * | tuple, |
const gint | nfield, | ||
const gchar * | field, | ||
gchar * | string | ||
) |
Associates given string to a field in specified Tuple.
The caller gives up ownership of the string. If field already exists, old value is freed and replaced.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | nfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
[in] | string | String to be associated to given field in Tuple. |
Disassociates given field from specified Tuple structure.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | cnfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
void tuple_disassociate_now | ( | TupleValue * | value | ) |
Returns integer associated to Tuple field.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | cnfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
Definition at line 641 of file tuple.c.
Referenced by entry_set_tuple_real(), read_gain_from_tuple(), tuple_compare_int(), tuple_formatter_expression_empty(), tuple_formatter_expression_match(), tuple_formatter_process_expr(), and tuple_value_to_gvalue().
Returns pointer to a string associated to Tuple field.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | cnfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
Definition at line 599 of file tuple.c.
Referenced by describe_song(), playlist_select_by_patterns(), title_from_tuple(), tuple_compare_string(), tuple_formatter_expression_empty(), tuple_formatter_expression_match(), tuple_formatter_make_title_string(), tuple_formatter_process_expr(), and tuple_value_to_gvalue().
TupleValueType tuple_get_value_type | ( | const Tuple * | tuple, |
gint | cnfield, | ||
const gchar * | field | ||
) |
Returns TupleValueType of given Tuple field.
Desired field can be specified either by key name or if it is one of basic fields, by TupleBasicType index.
[in] | tuple | Tuple structure pointer. |
[in] | cnfield | TupleBasicType index or -1 if key name is to be used instead. |
[in] | field | String acting as key name or NULL if nfield is used. |
Definition at line 562 of file tuple.c.
Referenced by entry_set_tuple_real(), tuple_compare_int(), tuple_formatter_expression_empty(), tuple_formatter_expression_match(), tuple_formatter_process_expr(), and tuple_value_to_gvalue().
Tuple* tuple_new | ( | void | ) |
Allocates a new empty Tuple structure.
Must be freed via tuple_free().
Definition at line 171 of file tuple.c.
Referenced by tuple_new_from_filename().
Tuple* tuple_new_from_filename | ( | const gchar * | filename | ) |
Allocates a new Tuple structure, setting filename/URI related fields based on the given filename argument by calling tuple_set_filename.
[in] | filename | Filename URI. |
Definition at line 312 of file tuple.c.
Referenced by entry_set_failed().
void tuple_set_filename | ( | Tuple * | tuple, |
const gchar * | name | ||
) |
Sets filename/URI related fields of a Tuple structure, based on the given filename argument.
The fields set are: FIELD_FILE_PATH, FIELD_FILE_NAME and FIELD_FILE_EXT.
[in] | filename | Filename URI. |
[in,out] | tuple | Tuple structure to manipulate. |
Definition at line 195 of file tuple.c.
Referenced by tuple_new_from_filename().
const TupleBasicType tuple_fields[FIELD_LAST] |
Ordered table of basic Tuple field names and their TupleValueType.
Definition at line 40 of file tuple.c.
Referenced by audacious_rc_get_tuple_fields(), and tuple_evalctx_add_var().