Audacious $Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
Basic Tuple handling API. More...
#include <glib.h>
#include <pthread.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <audacious/i18n.h>
#include "audstrings.h"
#include "config.h"
#include "tuple.h"
#include "tuple_formatter.h"
Go to the source code of this file.
Classes | |
struct | TupleBasicType |
union | TupleVal |
struct | TupleBlock |
struct | Tuple |
Structure for holding and passing around miscellaneous track metadata. More... | |
struct | FieldDictEntry |
Defines | |
#define | BLOCK_VALS 4 |
#define | BIT(i) ((int64_t) 1 << (i)) |
#define | APPEND(b,...) |
Functions | |
static int | field_dict_compare (const void *a, const void *b) |
EXPORT int | tuple_field_by_name (const char *name) |
EXPORT const char * | tuple_field_get_name (int field) |
EXPORT TupleValueType | tuple_field_get_type (int field) |
static TupleVal * | lookup_val (Tuple *tuple, int field, bool_t add, bool_t remove) |
static void | tuple_destroy_unlocked (Tuple *tuple) |
EXPORT Tuple * | tuple_new (void) |
EXPORT Tuple * | tuple_ref (Tuple *tuple) |
EXPORT void | tuple_unref (Tuple *tuple) |
EXPORT void | tuple_set_filename (Tuple *tuple, const char *filename) |
Sets filename/URI related fields of a #Tuple structure, based on the given filename argument. | |
EXPORT Tuple * | tuple_copy (const Tuple *old) |
Creates a copy of given Tuple structure, with copied data. | |
EXPORT 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. | |
EXPORT void | tuple_set_int (Tuple *tuple, int nfield, const char *field, int x) |
EXPORT void | tuple_set_str (Tuple *tuple, int nfield, const char *field, const char *str) |
EXPORT void | tuple_unset (Tuple *tuple, int nfield, const char *field) |
EXPORT TupleValueType | tuple_get_value_type (const Tuple *tuple, int nfield, const char *field) |
Returns TupleValueType of given #Tuple field. | |
EXPORT char * | tuple_get_str (const Tuple *tuple, int nfield, const char *field) |
EXPORT int | tuple_get_int (const Tuple *tuple, int nfield, const char *field) |
Returns integer associated to #Tuple field. | |
EXPORT void | tuple_set_format (Tuple *t, const char *format, int chans, int rate, int brate) |
EXPORT void | tuple_set_subtunes (Tuple *tuple, int n_subtunes, const int *subtunes) |
EXPORT int | tuple_get_n_subtunes (Tuple *tuple) |
EXPORT int | tuple_get_nth_subtune (Tuple *tuple, int n) |
EXPORT char * | tuple_format_title (Tuple *tuple, const char *format) |
Variables | |
static const TupleBasicType | tuple_fields [TUPLE_FIELDS] |
Ordered table of basic #Tuple field names and their TupleValueType. | |
static const FieldDictEntry | field_dict [TUPLE_FIELDS] |
static pthread_mutex_t | mutex = PTHREAD_MUTEX_INITIALIZER |
Basic Tuple handling API.
Definition in file tuple.c.
#define APPEND | ( | b, | |
... | |||
) |
#define BIT | ( | i | ) | ((int64_t) 1 << (i)) |
Definition at line 78 of file tuple.c.
Referenced by lookup_val().
#define BLOCK_VALS 4 |
Definition at line 41 of file tuple.c.
Referenced by lookup_val(), and tuple_destroy_unlocked().
static int field_dict_compare | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 162 of file tuple.c.
Referenced by tuple_field_by_name().
Definition at line 196 of file tuple.c.
Referenced by tuple_copy(), tuple_get_int(), tuple_get_str(), tuple_get_value_type(), tuple_set_int(), tuple_set_str(), and tuple_unset().
EXPORT Tuple* tuple_copy | ( | const Tuple * | old | ) |
static void tuple_destroy_unlocked | ( | Tuple * | tuple | ) | [static] |
Definition at line 245 of file tuple.c.
Referenced by tuple_unref().
EXPORT 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().
EXPORT const char* tuple_field_get_name | ( | int | field | ) |
Definition at line 180 of file tuple.c.
Referenced by audacious_rc_get_tuple_fields().
EXPORT TupleValueType tuple_field_get_type | ( | int | field | ) |
Definition at line 188 of file tuple.c.
Referenced by tuple_evalctx_add_var().
EXPORT 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().
EXPORT 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().
EXPORT 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().
EXPORT 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().
EXPORT Tuple* tuple_new | ( | void | ) |
Definition at line 269 of file tuple.c.
Referenced by tuple_copy(), and tuple_new_from_filename().
EXPORT 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().
EXPORT Tuple* tuple_ref | ( | Tuple * | tuple | ) |
Definition at line 276 of file tuple.c.
Referenced by playback_entry_get_tuple(), and playlist_entry_get_tuple().
EXPORT 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().
EXPORT 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().
EXPORT 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().
EXPORT void tuple_unset | ( | Tuple * | tuple, |
int | nfield, | ||
const char * | field | ||
) |
Definition at line 424 of file tuple.c.
Referenced by tuple_set_str().
const FieldDictEntry field_dict[TUPLE_FIELDS] [static] |
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER [static] |
Definition at line 159 of file tuple.c.
Referenced by tuple_copy(), tuple_get_int(), tuple_get_n_subtunes(), tuple_get_nth_subtune(), tuple_get_str(), tuple_get_value_type(), tuple_ref(), tuple_set_int(), tuple_set_str(), tuple_set_subtunes(), tuple_unref(), and tuple_unset().
const TupleBasicType tuple_fields[TUPLE_FIELDS] [static] |
Ordered table of basic #Tuple field names and their TupleValueType.