1 /*
2  * Copyright (C) 2010, 2011 Igalia S.L.
3  *
4  * Contact: Iago Toral Quiroga <itoral@igalia.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation; version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  *
21  */
22 
23 #if !defined (_GRILO_H_INSIDE_) && !defined (GRILO_COMPILATION)
24 #error "Only <grilo.h> can be included directly."
25 #endif
26 
27 #ifndef _GRL_METADATA_KEY_H_
28 #define _GRL_METADATA_KEY_H_
29 
30 #include <glib.h>
31 #include <glib-object.h>
32 
33 #define GRL_METADATA_KEY_GET_ID(key)   (key)
34 #define GRL_METADATA_KEY_GET_NAME(key) (grl_metadata_key_get_name (key))
35 #define GRL_METADATA_KEY_GET_DESC(key) (grl_metadata_key_get_desc (key))
36 #define GRL_METADATA_KEY_GET_TYPE(key) (grl_metadata_key_get_type (key))
37 
38 #define GRL_KEYID_FORMAT "u"
39 
40 #define GRLPOINTER_TO_KEYID(p) (GPOINTER_TO_UINT(p))
41 #define GRLKEYID_TO_POINTER(k) (GUINT_TO_POINTER(k))
42 
43 typedef guint32 GrlKeyID;
44 
45 /**
46  * GrlMediaType:
47  * @GRL_MEDIA_TYPE_UNKNOWN: unknown media
48  * @GRL_MEDIA_TYPE_AUDIO: audio media
49  * @GRL_MEDIA_TYPE_VIDEO: video media
50  * @GRL_MEDIA_TYPE_IMAGE: image media
51  * @GRL_MEDIA_TYPE_CONTAINER: container media
52  */
53 typedef enum {
54   GRL_MEDIA_TYPE_UNKNOWN,
55   GRL_MEDIA_TYPE_AUDIO,
56   GRL_MEDIA_TYPE_VIDEO,
57   GRL_MEDIA_TYPE_IMAGE,
58   GRL_MEDIA_TYPE_CONTAINER
59 } GrlMediaType;
60 
61 #define g_value_get_grl_key_id(value) ((GrlKeyID) g_value_get_uint(value))
62 #define g_value_set_grl_key_id(value,key) g_value_set_uint(value,(guint)key)
63 
64 #define GRL_METADATA_KEY_INVALID              0
65 
66 /* BEGIN CORE KEYS */
67 
68 #define GRL_METADATA_KEY_ALBUM                1
69 #define GRL_METADATA_KEY_ARTIST               2
70 #define GRL_METADATA_KEY_AUTHOR               3
71 #define GRL_METADATA_KEY_BITRATE              4
72 #define GRL_METADATA_KEY_CERTIFICATE          5
73 #define GRL_METADATA_KEY_CHILDCOUNT           6
74 #define GRL_METADATA_KEY_PUBLICATION_DATE     7
75 #define GRL_METADATA_KEY_DESCRIPTION          8
76 #define GRL_METADATA_KEY_DURATION             9
77 #define GRL_METADATA_KEY_EXTERNAL_PLAYER      10
78 #define GRL_METADATA_KEY_EXTERNAL_URL         11
79 #define GRL_METADATA_KEY_FRAMERATE            12
80 #define GRL_METADATA_KEY_GENRE                13
81 #define GRL_METADATA_KEY_HEIGHT               14
82 #define GRL_METADATA_KEY_ID                   15
83 #define GRL_METADATA_KEY_LAST_PLAYED          16
84 #define GRL_METADATA_KEY_LAST_POSITION        17
85 #define GRL_METADATA_KEY_LICENSE              18
86 #define GRL_METADATA_KEY_LYRICS               19
87 #define GRL_METADATA_KEY_MIME                 20
88 #define GRL_METADATA_KEY_PLAY_COUNT           21
89 #define GRL_METADATA_KEY_RATING               22
90 #define GRL_METADATA_KEY_SITE                 23
91 #define GRL_METADATA_KEY_SOURCE               24
92 #define GRL_METADATA_KEY_STUDIO               25
93 #define GRL_METADATA_KEY_THUMBNAIL            26
94 #define GRL_METADATA_KEY_THUMBNAIL_BINARY     27
95 #define GRL_METADATA_KEY_TITLE                28
96 #define GRL_METADATA_KEY_URL                  29
97 #define GRL_METADATA_KEY_WIDTH                30
98 #define GRL_METADATA_KEY_SEASON               31
99 #define GRL_METADATA_KEY_EPISODE              32
100 #define GRL_METADATA_KEY_SHOW                 33
101 #define GRL_METADATA_KEY_CREATION_DATE        34
102 #define GRL_METADATA_KEY_CAMERA_MODEL         35
103 #define GRL_METADATA_KEY_ORIENTATION          36
104 #define GRL_METADATA_KEY_FLASH_USED           37
105 #define GRL_METADATA_KEY_EXPOSURE_TIME        38
106 #define GRL_METADATA_KEY_ISO_SPEED            39
107 #define GRL_METADATA_KEY_TRACK_NUMBER         40
108 #define GRL_METADATA_KEY_MODIFICATION_DATE    41
109 #define GRL_METADATA_KEY_START_TIME           42
110 #define GRL_METADATA_KEY_FAVOURITE            43
111 #define GRL_METADATA_KEY_REGION               44
112 #define GRL_METADATA_KEY_KEYWORD              45
113 #define GRL_METADATA_KEY_PERFORMER            46
114 #define GRL_METADATA_KEY_PRODUCER             47
115 #define GRL_METADATA_KEY_DIRECTOR             48
116 #define GRL_METADATA_KEY_ORIGINAL_TITLE       49
117 #define GRL_METADATA_KEY_SIZE                 50
118 #define GRL_METADATA_KEY_TITLE_FROM_FILENAME  51
119 #define GRL_METADATA_KEY_MB_ALBUM_ID          52 /* Deprecated: use GRL_METADATA_KEY_MB_RELEASE_ID or GRL_METADATA_KEY_MB_RELEASE_GROUP_ID */
120 #define GRL_METADATA_KEY_MB_TRACK_ID          53
121 #define GRL_METADATA_KEY_MB_ARTIST_ID         54
122 #define GRL_METADATA_KEY_MB_RECORDING_ID      55
123 #define GRL_METADATA_KEY_EPISODE_TITLE        56
124 #define GRL_METADATA_KEY_AUDIO_TRACK          57
125 #define GRL_METADATA_KEY_ALBUM_DISC_NUMBER    58
126 #define GRL_METADATA_KEY_COMPOSER             59
127 #define GRL_METADATA_KEY_ALBUM_ARTIST         60
128 #define GRL_METADATA_KEY_MB_RELEASE_ID        61
129 #define GRL_METADATA_KEY_MB_RELEASE_GROUP_ID  62
130 
131 /* END CORE KEYS */
132 
133 G_BEGIN_DECLS
134 
135 const gchar *grl_metadata_key_get_name (GrlKeyID key);
136 
137 const gchar *grl_metadata_key_get_desc (GrlKeyID key);
138 
139 GType grl_metadata_key_get_type (GrlKeyID key);
140 
141 GList *grl_metadata_key_list_new(GrlKeyID first_key, ...);
142 
143 G_END_DECLS
144 
145 #endif /* _GRL_METADATA_KEY_H_ */
146