[grilo/debian: 4/7] core: Add functions to handle new keys



commit 749a70f3b4c100cba2a6e96a76473aef5d3be719
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Mar 17 21:21:40 2011 +0000

    core: Add functions to handle new keys
    
    Add functions in GrlMediaVideo to handle season, episode and show keys.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/data/grl-media-video.c |   75 ++++++++++++++++++++++++++++++++++++++++++++
 src/data/grl-media-video.h |   12 +++++++
 2 files changed, 87 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-media-video.c b/src/data/grl-media-video.c
index 5a2aee8..c390a7b 100644
--- a/src/data/grl-media-video.c
+++ b/src/data/grl-media-video.c
@@ -153,6 +153,45 @@ grl_media_video_set_framerate (GrlMediaVideo *video, gfloat framerate)
 }
 
 /**
+ * grl_media_video_set_season:
+ * @video: the media instance
+ * @season: the video's season
+ *
+ * Sets the season number of the video
+ */
+void
+grl_media_video_set_season (GrlMediaVideo *video, gint season)
+{
+  grl_data_set_int (GRL_DATA (video), GRL_METADATA_KEY_SEASON, season);
+}
+
+/**
+ * grl_media_video_set_episode:
+ * @video: the media instance
+ * @episode: the video's episode
+ *
+ * Sets the episode number of the video
+ */
+void
+grl_media_video_set_episode (GrlMediaVideo *video, gint episode)
+{
+  grl_data_set_int (GRL_DATA (video), GRL_METADATA_KEY_EPISODE, episode);
+}
+
+/**
+ * grl_media_video_set_show:
+ * @video: the media instance
+ * @show: the video's show name
+ *
+ * Sets the show title of the video
+ */
+void
+grl_media_video_set_show (GrlMediaVideo *video, const gchar *show)
+{
+  grl_data_set_string (GRL_DATA (video), GRL_METADATA_KEY_SHOW, show);
+}
+
+/**
  * grl_media_video_get_width:
  * @video: the media instance
  *
@@ -195,6 +234,42 @@ grl_media_video_get_framerate (GrlMediaVideo *video)
 }
 
 /**
+ * grl_media_video_get_season:
+ * @video: the media instance
+ *
+ * Returns: the season number of the video
+ */
+gint
+grl_media_video_get_season (GrlMediaVideo *video)
+{
+  return grl_data_get_int (GRL_DATA (video), GRL_METADATA_KEY_SEASON);
+}
+
+/**
+ * grl_media_video_get_episode:
+ * @video: the media instance
+ *
+ * Returns: the episode number of the video
+ */
+gint
+grl_media_video_get_episode (GrlMediaVideo *video)
+{
+  return grl_data_get_int (GRL_DATA (video), GRL_METADATA_KEY_EPISODE);
+}
+
+/**
+ * grl_media_video_get_show:
+ * @video: the media instance
+ *
+ * Returns: the show title of the video
+ */
+const gchar *
+grl_media_video_get_show (GrlMediaVideo *video)
+{
+  return grl_data_get_string (GRL_DATA (video), GRL_METADATA_KEY_SHOW);
+}
+
+/**
  * grl_media_video_set_url_data:
  * @video: the media instance
  * @url: the video's url
diff --git a/src/data/grl-media-video.h b/src/data/grl-media-video.h
index 1f6e1fb..4eba01c 100644
--- a/src/data/grl-media-video.h
+++ b/src/data/grl-media-video.h
@@ -91,12 +91,24 @@ void grl_media_video_set_height (GrlMediaVideo *video, gint height);
 
 void grl_media_video_set_framerate (GrlMediaVideo *video, gfloat framerate);
 
+void grl_media_video_set_season (GrlMediaVideo *video, gint season);
+
+void grl_media_video_set_episode (GrlMediaVideo *video, gint episode);
+
+void grl_media_video_set_show (GrlMediaVideo *video, const gchar *show);
+
 gint grl_media_video_get_width (GrlMediaVideo *video);
 
 gint grl_media_video_get_height (GrlMediaVideo *video);
 
 gfloat grl_media_video_get_framerate (GrlMediaVideo *video);
 
+gint grl_media_video_get_season (GrlMediaVideo *video);
+
+gint grl_media_video_get_episode (GrlMediaVideo *video);
+
+const gchar *grl_media_video_get_show (GrlMediaVideo *video);
+
 GType grl_media_video_get_type (void) G_GNUC_CONST;
 
 GrlMedia *grl_media_video_new (void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]