[grilo/debian: 17/23] core: Add missing implementations
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo/debian: 17/23] core: Add missing implementations
- Date: Sun, 6 Mar 2011 17:00:01 +0000 (UTC)
commit 9f9c4af92151d06540215491016ccb2c78cbfef9
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Fri Mar 4 13:09:01 2011 +0100
core: Add missing implementations
Add implementations for grl_media_get_player_nth() and
grl_media_get_external_url_nth().
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/data/grl-media.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-media.c b/src/data/grl-media.c
index 3ee5830..e2bd440 100644
--- a/src/data/grl-media.c
+++ b/src/data/grl-media.c
@@ -1178,6 +1178,29 @@ grl_media_get_player(GrlMedia *media)
}
/**
+ * grl_media_get_player_nth:
+ * @media: the media object
+ * @index: element to retrieve
+ *
+ * Returns: the n-th media's external player object.
+ */
+const gchar *
+grl_media_get_player_nth (GrlMedia *media, guint index)
+{
+ GrlRelatedKeys *relkeys =
+ grl_data_get_related_keys (GRL_DATA (media),
+ GRL_METADATA_KEY_EXTERNAL_PLAYER,
+ index);
+
+ if (!relkeys) {
+ return NULL;
+ } else {
+ return grl_related_keys_get_string (relkeys,
+ GRL_METADATA_KEY_EXTERNAL_PLAYER);
+ }
+}
+
+/**
* grl_media_get_external_url:
* @media: the media object
*
@@ -1193,6 +1216,28 @@ grl_media_get_external_url (GrlMedia *media)
}
/**
+ * grl_media_get_external_url_nth:
+ * @media: the media object
+ * @index: element to retrieve
+ *
+ * Returns: the n-th media's external location where the user can play it.
+ */
+const gchar *
+grl_media_get_external_url_nth (GrlMedia *media, guint index)
+{
+ GrlRelatedKeys *relkeys =
+ grl_data_get_related_keys (GRL_DATA (media),
+ GRL_METADATA_KEY_EXTERNAL_URL,
+ index);
+
+ if (!relkeys) {
+ return NULL;
+ } else {
+ return grl_related_keys_get_string (relkeys, GRL_METADATA_KEY_EXTERNAL_URL);
+ }
+}
+
+/**
* grl_media_get_studio:
* @media: the media object
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]