[grilo] keys: Add extra system metadata keys
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] keys: Add extra system metadata keys
- Date: Mon, 5 Jul 2010 12:26:30 +0000 (UTC)
commit 9fa85828fa5cc4f6041fabbc0b231d173ad1c4c6
Author: iain <iain linux intel com>
Date: Mon Jul 5 14:16:49 2010 +0200
keys: Add extra system metadata keys
Add certificate, studio and license metadata keys.
src/data/grl-media.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
src/grl-metadata-key.c | 28 +++++++++++++++++++++
src/grl-metadata-key.h | 41 ++++++++++++++++--------------
3 files changed, 113 insertions(+), 19 deletions(-)
---
diff --git a/src/data/grl-media.h b/src/data/grl-media.h
index ddd67b9..805d95e 100644
--- a/src/data/grl-media.h
+++ b/src/data/grl-media.h
@@ -273,6 +273,42 @@ struct _GrlMedia
GRL_METADATA_KEY_EXTERNAL_URL, \
(url))
+/**
+ * grl_media_set_studio:
+ * @data: the media
+ * @studio: The studio the media is from
+ *
+ * Set the media studio
+ */
+#define grl_media_set_studio(data, studio) \
+ grl_data_set_string(GRL_DATA((data)), \
+ GRL_METADATA_KEY_STUDIO, \
+ (studio));
+
+/**
+ * grl_media_set_certificate:
+ * @data: the media
+ * @certificate: The rating certificate of the media
+ *
+ * Set the media certificate
+ */
+#define grl_media_set_certificate(data, certificate) \
+ grl_data_set_string(GRL_DATA((data)), \
+ GRL_METADATA_KEY_CERTIFICATE, \
+ (certificate));
+
+/**
+ * grl_media_set_license:
+ * @data: the media
+ * @certificate: The license of the media
+ *
+ * Set the media license
+ */
+#define grl_media_set_license(data, license) \
+ grl_data_set_string(GRL_DATA((data)), \
+ GRL_METADATA_KEY_LICENSE, \
+ (license));
+
void grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max);
/**
@@ -430,6 +466,33 @@ void grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max);
#define grl_media_get_external_url(data) \
grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_EXTERNAL_URL)
+/**
+ * grl_media_get_studio:
+ * @data: the media object
+ *
+ * Returns: (type utf8) (transfer none): the studio the media is from
+ */
+#define grl_media_get_studio(data) \
+ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_STUDIO)
+
+/**
+ * grl_media_get_certificate:
+ * @data: the media object
+ *
+ * Returns: (type utf8) (transfer none): the media's certificate
+ */
+#define grl_media_get_certificate(data) \
+ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_CERTIFICATE)
+
+/**
+ * grl_media_get_license:
+ * @data: the media object
+ *
+ * Returns: (type utf8) (transfer none): the license the media is under
+ */
+#define grl_media_get_license(data) \
+ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_LICENSE)
+
GType grl_media_get_type (void) G_GNUC_CONST;
GrlMedia *grl_media_new (void);
diff --git a/src/grl-metadata-key.c b/src/grl-metadata-key.c
index 54f972a..9051563 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -55,6 +55,10 @@ GrlKeyID GRL_METADATA_KEY_WIDTH = NULL;
GrlKeyID GRL_METADATA_KEY_FRAMERATE = NULL;
GrlKeyID GRL_METADATA_KEY_RATING = NULL;
+GrlKeyID GRL_METADATA_KEY_STUDIO = NULL;
+GrlKeyID GRL_METADATA_KEY_CERTIFICATE = NULL;
+GrlKeyID GRL_METADATA_KEY_LICENSE = NULL;
+
void
grl_metadata_key_setup_system_keys (GrlPluginRegistry *registry)
{
@@ -180,6 +184,30 @@ grl_metadata_key_setup_system_keys (GrlPluginRegistry *registry)
NULL,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+GRL_METADATA_KEY_STUDIO =
+ grl_plugin_registry_register_metadata_key (registry,
+ g_param_spec_string ("studio",
+ "Studio",
+ "Studio the media is from",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+
+ GRL_METADATA_KEY_CERTIFICATE =
+ grl_plugin_registry_register_metadata_key (registry,
+ g_param_spec_string ("certificate",
+ "Certificate",
+ "Age certificate of the media",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+
+ GRL_METADATA_KEY_LICENSE =
+ grl_plugin_registry_register_metadata_key (registry,
+ g_param_spec_string ("license",
+ "License",
+ "The license of the media",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+
GRL_METADATA_KEY_BITRATE =
grl_plugin_registry_register_metadata_key (registry,
g_param_spec_int ("bitrate",
diff --git a/src/grl-metadata-key.h b/src/grl-metadata-key.h
index b991809..34ec822 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -45,31 +45,34 @@
typedef GParamSpec* GrlKeyID;
-extern GrlKeyID GRL_METADATA_KEY_TITLE;
-extern GrlKeyID GRL_METADATA_KEY_URL;
-extern GrlKeyID GRL_METADATA_KEY_EXTERNAL_URL;
-extern GrlKeyID GRL_METADATA_KEY_EXTERNAL_PLAYER;
-extern GrlKeyID GRL_METADATA_KEY_ARTIST;
extern GrlKeyID GRL_METADATA_KEY_ALBUM;
-extern GrlKeyID GRL_METADATA_KEY_GENRE;
-extern GrlKeyID GRL_METADATA_KEY_THUMBNAIL;
-extern GrlKeyID GRL_METADATA_KEY_ID;
+extern GrlKeyID GRL_METADATA_KEY_ARTIST;
extern GrlKeyID GRL_METADATA_KEY_AUTHOR;
+extern GrlKeyID GRL_METADATA_KEY_BITRATE;
+extern GrlKeyID GRL_METADATA_KEY_CERTIFICATE;
+extern GrlKeyID GRL_METADATA_KEY_CHILDCOUNT;
+extern GrlKeyID GRL_METADATA_KEY_DATE;
extern GrlKeyID GRL_METADATA_KEY_DESCRIPTION;
-extern GrlKeyID GRL_METADATA_KEY_SOURCE;
-extern GrlKeyID GRL_METADATA_KEY_LYRICS;
-extern GrlKeyID GRL_METADATA_KEY_SITE;
extern GrlKeyID GRL_METADATA_KEY_DURATION;
-extern GrlKeyID GRL_METADATA_KEY_DATE;
-extern GrlKeyID GRL_METADATA_KEY_CHILDCOUNT;
-extern GrlKeyID GRL_METADATA_KEY_MIME;
-extern GrlKeyID GRL_METADATA_KEY_WIDTH;
-extern GrlKeyID GRL_METADATA_KEY_HEIGHT;
+extern GrlKeyID GRL_METADATA_KEY_EXTERNAL_PLAYER;
+extern GrlKeyID GRL_METADATA_KEY_EXTERNAL_URL;
extern GrlKeyID GRL_METADATA_KEY_FRAMERATE;
-extern GrlKeyID GRL_METADATA_KEY_RATING;
-extern GrlKeyID GRL_METADATA_KEY_BITRATE;
-extern GrlKeyID GRL_METADATA_KEY_PLAY_COUNT;
+extern GrlKeyID GRL_METADATA_KEY_GENRE;
+extern GrlKeyID GRL_METADATA_KEY_HEIGHT;
+extern GrlKeyID GRL_METADATA_KEY_ID;
extern GrlKeyID GRL_METADATA_KEY_LAST_PLAYED;
extern GrlKeyID GRL_METADATA_KEY_LAST_POSITION;
+extern GrlKeyID GRL_METADATA_KEY_LICENSE;
+extern GrlKeyID GRL_METADATA_KEY_LYRICS;
+extern GrlKeyID GRL_METADATA_KEY_MIME;
+extern GrlKeyID GRL_METADATA_KEY_PLAY_COUNT;
+extern GrlKeyID GRL_METADATA_KEY_RATING;
+extern GrlKeyID GRL_METADATA_KEY_SITE;
+extern GrlKeyID GRL_METADATA_KEY_SOURCE;
+extern GrlKeyID GRL_METADATA_KEY_STUDIO;
+extern GrlKeyID GRL_METADATA_KEY_THUMBNAIL;
+extern GrlKeyID GRL_METADATA_KEY_TITLE;
+extern GrlKeyID GRL_METADATA_KEY_URL;
+extern GrlKeyID GRL_METADATA_KEY_WIDTH;
#endif /* _GRL_METADATA_KEY_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]