Basic Tuple handling API. More...
#include <libaudcore/core.h>
Go to the source code of this file.
Enumerations | |
enum | { FIELD_ARTIST = 0, FIELD_TITLE, FIELD_ALBUM, FIELD_COMMENT, FIELD_GENRE, FIELD_TRACK_NUMBER, FIELD_LENGTH, FIELD_YEAR, FIELD_QUALITY, FIELD_CODEC, FIELD_FILE_NAME, FIELD_FILE_PATH, FIELD_FILE_EXT, FIELD_SONG_ARTIST, FIELD_COMPOSER, 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, TUPLE_FIELDS } |
Ordered enum for basic Tuple fields. More... | |
enum | TupleValueType { TUPLE_STRING, TUPLE_INT, TUPLE_UNKNOWN } |
Functions | |
int | tuple_field_by_name (const char *name) |
const char * | tuple_field_get_name (int field) |
TupleValueType | tuple_field_get_type (int field) |
Tuple * | tuple_new (void) |
Tuple * | tuple_ref (Tuple *tuple) |
void | tuple_unref (Tuple *tuple) |
Tuple * | tuple_copy (const Tuple *) |
Creates a copy of given Tuple structure, with copied data. | |
void | tuple_set_filename (Tuple *tuple, const char *filename) |
Sets filename/URI related fields of a Tuple structure, based on the given filename argument. | |
Tuple * | tuple_new_from_filename (const char *filename) |
Allocates a new Tuple structure, setting filename/URI related fields based on the given filename argument by calling tuple_set_filename. | |
void | tuple_set_int (Tuple *tuple, int nfield, const char *field, int x) |
void | tuple_set_str (Tuple *tuple, int nfield, const char *field, const char *str) |
void | tuple_unset (Tuple *tuple, int nfield, const char *field) |
TupleValueType | tuple_get_value_type (const Tuple *tuple, int nfield, const char *field) |
Returns TupleValueType of given Tuple field. | |
char * | tuple_get_str (const Tuple *tuple, int nfield, const char *field) |
int | tuple_get_int (const Tuple *tuple, int nfield, const char *field) |
Returns integer associated to Tuple field. | |
void | tuple_set_format (Tuple *tuple, const char *format, int channels, int samplerate, int bitrate) |
void | tuple_set_subtunes (Tuple *tuple, int n_subtunes, const int *subtunes) |
int | tuple_get_n_subtunes (Tuple *tuple) |
int | tuple_get_nth_subtune (Tuple *tuple, int n) |
char * | tuple_format_title (Tuple *tuple, const char *format) |
Basic Tuple handling API.
Definition in file tuple.h.
anonymous enum |
Ordered enum for basic Tuple fields.
enum TupleValueType |
Tuple* tuple_copy | ( | const Tuple * | old | ) |
int tuple_field_by_name | ( | const char * | name | ) |
Definition at line 167 of file tuple.c.
Referenced by tuple_evalctx_add_var(), tuple_get_int(), tuple_get_str(), tuple_get_value_type(), tuple_set_int(), tuple_set_str(), and tuple_unset().
const char* tuple_field_get_name | ( | int | field | ) |
Definition at line 180 of file tuple.c.
Referenced by audacious_rc_get_tuple_fields().
TupleValueType tuple_field_get_type | ( | int | field | ) |
Definition at line 188 of file tuple.c.
Referenced by tuple_evalctx_add_var().
char* tuple_format_title | ( | Tuple * | tuple, | |
const char * | format | |||
) |
Definition at line 599 of file tuple.c.
Referenced by title_from_tuple().
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 508 of file tuple.c.
Referenced by entry_set_tuple_real(), read_gain_from_tuple(), tf_get_fieldval(), tuple_compare_int(), and tuple_value_to_gvalue().
int tuple_get_n_subtunes | ( | Tuple * | tuple | ) |
Definition at line 577 of file tuple.c.
Referenced by add_file().
Definition at line 587 of file tuple.c.
Referenced by add_file().
char* tuple_get_str | ( | const Tuple * | tuple, | |
int | nfield, | |||
const char * | field | |||
) |
Definition at line 477 of file tuple.c.
Referenced by get_nonblank_field(), playlist_select_by_patterns(), tf_get_fieldval(), tuple_compare_string(), tuple_format_title(), and tuple_value_to_gvalue().
TupleValueType tuple_get_value_type | ( | const Tuple * | tuple, | |
int | nfield, | |||
const char * | 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 458 of file tuple.c.
Referenced by entry_set_tuple_real(), tf_get_fieldval(), tuple_compare_int(), and tuple_value_to_gvalue().
Tuple* tuple_new | ( | void | ) |
Definition at line 269 of file tuple.c.
Referenced by tuple_copy(), and tuple_new_from_filename().
Tuple* tuple_new_from_filename | ( | const char * | 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 372 of file tuple.c.
Referenced by entry_set_failed().
Tuple* tuple_ref | ( | Tuple * | tuple | ) |
Definition at line 276 of file tuple.c.
Referenced by playback_entry_get_tuple(), and playlist_entry_get_tuple().
void tuple_set_filename | ( | Tuple * | tuple, | |
const char * | filename | |||
) |
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 304 of file tuple.c.
Referenced by tuple_new_from_filename().
Definition at line 380 of file tuple.c.
Referenced by tuple_set_filename(), and tuple_set_format().
void tuple_set_str | ( | Tuple * | tuple, | |
int | nfield, | |||
const char * | field, | |||
const char * | str | |||
) |
Definition at line 395 of file tuple.c.
Referenced by tuple_set_filename(), and tuple_set_format().
void tuple_unref | ( | Tuple * | tuple | ) |
Definition at line 286 of file tuple.c.
Referenced by add_file(), entry_free(), entry_set_tuple_real(), get_field(), get_mpris_metadata(), index_free_tuples(), mpris_emit_track_change(), playback_thread(), playlist_remove_duplicates_by_scheme(), playlist_save(), playlist_select_by_patterns(), and scanner().
void tuple_unset | ( | Tuple * | tuple, | |
int | nfield, | |||
const char * | field | |||
) |
Definition at line 424 of file tuple.c.
Referenced by tuple_set_str().