[grilo] core: added GRL_METADATA_KEY_EXTERNAL_URL and GRL_METADATA_KEY_EXTERNAL_PLAYER
- From: Iago Toral Quiroga <itoral src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: added GRL_METADATA_KEY_EXTERNAL_URL and GRL_METADATA_KEY_EXTERNAL_PLAYER
- Date: Mon, 5 Jul 2010 11:54:38 +0000 (UTC)
commit b580c9220d8b5094543bdee09cfacfd091464c56
Author: Iago Toral Quiroga <itoral igalia com>
Date: Mon Jul 5 13:50:47 2010 +0200
core: added GRL_METADATA_KEY_EXTERNAL_URL and GRL_METADATA_KEY_EXTERNAL_PLAYER
src/data/grl-media.h | 42 ++++++++++++++++++++++++++++++++++++++++++
src/grl-metadata-key.c | 19 +++++++++++++++++++
src/grl-metadata-key.h | 2 ++
3 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-media.h b/src/data/grl-media.h
index fc0d49e..ddd67b9 100644
--- a/src/data/grl-media.h
+++ b/src/data/grl-media.h
@@ -251,6 +251,28 @@ struct _GrlMedia
GRL_METADATA_KEY_LAST_POSITION, \
(last_position))
+/**
+ * grl_media_set_external_player:
+ * @data: the media
+ *
+ * Set the location of a player for the media (usually a flash player)
+ */
+#define grl_media_set_external_player(data, player) \
+ grl_data_set_string(GRL_DATA((data)), \
+ GRL_METADATA_KEY_EXTERNAL_PLAYER, \
+ (player))
+
+/**
+ * grl_media_set_external_url:
+ * @data: the media
+ *
+ * Set an external location where users can play the media
+ */
+#define grl_media_set_external_url(data, url) \
+ grl_data_set_string(GRL_DATA((data)), \
+ GRL_METADATA_KEY_EXTERNAL_URL, \
+ (url))
+
void grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max);
/**
@@ -388,6 +410,26 @@ void grl_media_set_rating (GrlMedia *media, gfloat rating, gfloat max);
#define grl_media_get_last_played(data) \
grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_LAST_PLAYED)
+/**
+ * grl_media_get_external_player:
+ * @data: the media object
+ *
+ * Returns: (type utf8) (transfer none): URL of an external player
+ * object for this media
+ */
+#define grl_media_get_player(data) \
+ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_EXTERNAL_PLAYER)
+
+/**
+ * grl_media_get_external_url:
+ * @data: the media object
+ *
+ * Returns: (type utf8) (transfer none): URL of an external location
+ * where the user play the media.
+ */
+#define grl_media_get_external_url(data) \
+ grl_data_get_string(GRL_DATA((data)), GRL_METADATA_KEY_EXTERNAL_URL)
+
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 5774180..54f972a 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -39,7 +39,10 @@ GrlKeyID GRL_METADATA_KEY_SITE = NULL;
GrlKeyID GRL_METADATA_KEY_SOURCE = NULL;
GrlKeyID GRL_METADATA_KEY_THUMBNAIL = NULL;
GrlKeyID GRL_METADATA_KEY_TITLE = NULL;
+
GrlKeyID GRL_METADATA_KEY_URL = NULL;
+GrlKeyID GRL_METADATA_KEY_EXTERNAL_URL = NULL;
+GrlKeyID GRL_METADATA_KEY_EXTERNAL_PLAYER = NULL;
GrlKeyID GRL_METADATA_KEY_BITRATE = NULL;
GrlKeyID GRL_METADATA_KEY_CHILDCOUNT = NULL;
@@ -161,6 +164,22 @@ grl_metadata_key_setup_system_keys (GrlPluginRegistry *registry)
NULL,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+ GRL_METADATA_KEY_EXTERNAL_URL =
+ grl_plugin_registry_register_metadata_key (registry,
+ g_param_spec_string ("external-url",
+ "External URL",
+ "External location where the media can be played back, usually a website",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+
+ GRL_METADATA_KEY_EXTERNAL_PLAYER =
+ grl_plugin_registry_register_metadata_key (registry,
+ g_param_spec_string ("external-player",
+ "External Player URL",
+ "URL of an external player that can be used to play the resource (usually a Flash player)",
+ 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 2b07ad2..b991809 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -47,6 +47,8 @@ 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]