|
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 "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 |
Macros | |
| #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. More... | |
| EXPORT Tuple * | tuple_copy (const Tuple *old) |
| Creates a copy of given Tuple structure, with copied data. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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 76 of file tuple.c.
Referenced by lookup_val().
| #define BLOCK_VALS 4 |
Definition at line 39 of file tuple.c.
Referenced by lookup_val(), and tuple_destroy_unlocked().
|
static |
Definition at line 160 of file tuple.c.
Referenced by tuple_field_by_name().
Definition at line 194 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 |
Definition at line 243 of file tuple.c.
Referenced by tuple_unref().
| EXPORT int tuple_field_by_name | ( | const char * | name | ) |
Definition at line 165 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 178 of file tuple.c.
Referenced by audacious_rc_get_tuple_fields().
| EXPORT TupleValueType tuple_field_get_type | ( | int | field | ) |
Definition at line 186 of file tuple.c.
Referenced by tuple_evalctx_add_var().
| EXPORT char* tuple_format_title | ( | Tuple * | tuple, |
| const char * | format | ||
| ) |
Definition at line 600 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 509 of file tuple.c.
Referenced by entry_set_tuple_real(), playback_thread(), 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 578 of file tuple.c.
Referenced by add_file().
Definition at line 588 of file tuple.c.
Referenced by add_file().
| EXPORT char* tuple_get_str | ( | const Tuple * | tuple, |
| int | nfield, | ||
| const char * | field | ||
| ) |
Definition at line 478 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 459 of file tuple.c.
Referenced by entry_set_tuple_real(), playback_thread(), tf_get_fieldval(), tuple_compare_int(), and tuple_value_to_gvalue().
| EXPORT Tuple* tuple_new | ( | void | ) |
Definition at line 267 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 373 of file tuple.c.
Referenced by entry_set_failed().
| EXPORT Tuple* tuple_ref | ( | Tuple * | tuple | ) |
Definition at line 274 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 305 of file tuple.c.
Referenced by tuple_new_from_filename().
Definition at line 381 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 396 of file tuple.c.
Referenced by tuple_set_filename(), and tuple_set_format().
| EXPORT void tuple_unref | ( | Tuple * | tuple | ) |
Definition at line 284 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 scan_request_free().
| EXPORT void tuple_unset | ( | Tuple * | tuple, |
| int | nfield, | ||
| const char * | field | ||
| ) |
Definition at line 425 of file tuple.c.
Referenced by tuple_set_str().
|
static |
|
static |
Definition at line 157 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().
|
static |
Ordered table of basic #Tuple field names and their TupleValueType.
1.8.5