annotate src/audacious/tuple.h @ 4557:2eee464379dc

Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 May 2008 01:29:46 +0300
parents 5a0f5ef1de61
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3278
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
1 /*
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
2 * Audacious
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
3 * Copyright (c) 2006-2007 Audacious team
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
4 *
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
7 * the Free Software Foundation; under version 3 of the License.
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
8 *
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
12 * GNU General Public License for more details.
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
13 *
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses>.
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
16 *
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
17 * The Audacious team does not consider modular code linking to
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
18 * Audacious or using our public API to be a derived work.
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
19 */
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
20
4557
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 4407
diff changeset
21 #ifndef AUDACIOUS_TUPLE_H
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 4407
diff changeset
22 #define AUDACIOUS_TUPLE_H
3278
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
23
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
24 #include <glib.h>
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
25 #include <mowgli.h>
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
26
4407
5a0f5ef1de61 Some stupid header cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 4089
diff changeset
27 G_BEGIN_DECLS
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
28
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
29 enum {
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
30 FIELD_ARTIST = 0,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
31 FIELD_TITLE,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
32 FIELD_ALBUM,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
33 FIELD_COMMENT,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
34 FIELD_GENRE,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
35
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
36 FIELD_TRACK,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
37 FIELD_TRACK_NUMBER,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
38 FIELD_LENGTH,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
39 FIELD_YEAR,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
40 FIELD_QUALITY,
3409
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
41
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
42 FIELD_CODEC,
4089
9e24c8746d99 - introduce new API functions uri_to_display_basename() and uri_to_display_dirname(). each function derives utf8 encoded basename or dirname from given uri respectively.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 4061
diff changeset
43 FIELD_FILE_NAME, /* This is always in UTF-8 */
9e24c8746d99 - introduce new API functions uri_to_display_basename() and uri_to_display_dirname(). each function derives utf8 encoded basename or dirname from given uri respectively.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 4061
diff changeset
44 FIELD_FILE_PATH, /* This is always in UTF-8 */
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
45 FIELD_FILE_EXT,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
46 FIELD_SONG_ARTIST,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
47
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
48 FIELD_MTIME,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
49 FIELD_FORMATTER,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
50 FIELD_PERFORMER,
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
51 FIELD_COPYRIGHT,
3497
6f34cc4217b9 Added "date" field to basic fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3489
diff changeset
52 FIELD_DATE,
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
53
3550
6b0be1d088e6 - subtune handling is now done in playlist core, using tuple fields subsong-id and subsong-num (requires subtune-able plugins to be updated)
Giacomo Lozito <james@develia.org>
parents: 3498
diff changeset
54 FIELD_SUBSONG_ID,
6b0be1d088e6 - subtune handling is now done in playlist core, using tuple fields subsong-id and subsong-num (requires subtune-able plugins to be updated)
Giacomo Lozito <james@develia.org>
parents: 3498
diff changeset
55 FIELD_SUBSONG_NUM,
4009
ba6258a39662 icon, codec and quality info added to file info box. Added new tuple field FIELD_MIMETYPE used for icon resolving
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 3633
diff changeset
56 FIELD_MIMETYPE,
4061
450581e58761 added new tuple field FIELD_BITRATE
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4009
diff changeset
57 FIELD_BITRATE,
3550
6b0be1d088e6 - subtune handling is now done in playlist core, using tuple fields subsong-id and subsong-num (requires subtune-able plugins to be updated)
Giacomo Lozito <james@develia.org>
parents: 3498
diff changeset
58
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
59 /* special field, must always be last */
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
60 FIELD_LAST
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
61 };
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
62
3278
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
63 typedef enum {
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
64 TUPLE_STRING,
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
65 TUPLE_INT,
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
66 TUPLE_UNKNOWN
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
67 } TupleValueType;
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
68
3409
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
69 typedef struct {
3498
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
70 gchar *name;
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
71 TupleValueType type;
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
72 } TupleBasicType;
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
73
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
74 extern const TupleBasicType tuple_fields[FIELD_LAST];
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
75
9fcb90613e4f Added types to base tuples.
Matti Hamalainen <ccr@tnsp.org>
parents: 3497
diff changeset
76 typedef struct {
3409
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
77 TupleValueType type;
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
78 union {
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
79 gchar *string;
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
80 gint integer;
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
81 } value;
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
82 } TupleValue;
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
83
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
84 typedef struct _Tuple {
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
85 mowgli_object_t parent;
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
86 mowgli_dictionary_t *dict;
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
87 TupleValue *values[FIELD_LAST];
3633
8c4633438785 Implement selective adding of subtunes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3568
diff changeset
88 gint nsubtunes;
8c4633438785 Implement selective adding of subtunes.
Matti Hamalainen <ccr@tnsp.org>
parents: 3568
diff changeset
89 gint *subtunes;
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
90 } Tuple;
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
91
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
92
3278
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
93 Tuple *tuple_new(void);
3304
00286cde2485 Make filename a const
Christian Birchinger <joker@netswarm.net>
parents: 3301
diff changeset
94 Tuple *tuple_new_from_filename(const gchar *filename);
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
95 gboolean tuple_associate_string(Tuple *tuple, const gint nfield, const gchar *field, const gchar *string);
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
96 gboolean tuple_associate_int(Tuple *tuple, const gint nfield, const gchar *field, gint integer);
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
97 void tuple_disassociate(Tuple *tuple, const gint nfield, const gchar *field);
3409
86dafe2300f7 Added Tuplez compiler (not used yet, though) and some related changes in
Matti Hamalainen <ccr@tnsp.org>
parents: 3328
diff changeset
98 void tuple_disassociate_now(TupleValue *value);
3489
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
99 TupleValueType tuple_get_value_type(Tuple *tuple, const gint nfield, const gchar *field);
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
100 const gchar *tuple_get_string(Tuple *tuple, const gint nfield, const gchar *field);
9580bb3e58fa Tuple handling API changed to include support for "hardcoded" fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 3409
diff changeset
101 gint tuple_get_int(Tuple *tuple, const gint nfield, const gchar *field);
3328
e20c1f720153 defined a tuple_free for tuple namespace consistency
Giacomo Lozito <james@develia.org>
parents: 3304
diff changeset
102 #define tuple_free(x) mowgli_object_unref(x);
3278
04df6bd984ad Tuple API try 1.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
103
4407
5a0f5ef1de61 Some stupid header cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 4089
diff changeset
104 G_END_DECLS
5a0f5ef1de61 Some stupid header cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 4089
diff changeset
105
4557
2eee464379dc Clean up header multiple inclusion guards (e.g. #ifndef FOO_H/#define FOO_H)
Matti Hamalainen <ccr@tnsp.org>
parents: 4407
diff changeset
106 #endif /* AUDACIOUS_TUPLE_H */