[PATCH 03/13] core: Replaced grl-media-video defines with functions



---
 src/data/grl-media-video.c |   81 ++++++++++++++++++++++++++++++++++++++++++++
 src/data/grl-media-video.h |   63 +++-------------------------------
 2 files changed, 87 insertions(+), 57 deletions(-)

diff --git a/src/data/grl-media-video.c b/src/data/grl-media-video.c
index a4e064d..ec928b7 100644
--- a/src/data/grl-media-video.c
+++ b/src/data/grl-media-video.c
@@ -96,3 +96,84 @@ grl_media_video_set_size (GrlMediaVideo *video,
   grl_media_video_set_width (video, width);
   grl_media_video_set_height (video, height);
 }
+
+/**
+ * grl_media_video_set_width:
+ * @data: the media instance
+ * @width: the video's width
+ *
+ * Set the width of the video
+ */
+void
+grl_media_video_set_width (GrlMediaVideo *data, gint width)
+{
+  grl_data_set_int (GRL_DATA (data),
+                    GRL_METADATA_KEY_WIDTH,
+                    width);
+}
+
+/**
+ * grl_media_video_set_height:
+ * @data: the media instance
+ * @height: the video's height
+ *
+ * Set the height of the video
+ */
+void
+grl_media_video_set_height (GrlMediaVideo *data, gint height)
+{
+  grl_data_set_int (GRL_DATA (data),
+                    GRL_METADATA_KEY_HEIGHT,
+                    height);
+}
+
+/**
+ * grl_media_video_set_framerate:
+ * @data: the media instance
+ * @framerate: the video's framerate
+ *
+ * Set the framerate of the video
+ */
+void
+grl_media_video_set_framerate (GrlMediaVideo *data, gfloat framerate)
+{
+  grl_data_set_float (GRL_DATA (data),
+                      GRL_METADATA_KEY_FRAMERATE,
+                      framerate);
+}
+
+/**
+ * grl_media_video_get_width:
+ * @data: the media instance
+ *
+ * Returns: the width of the video
+ */
+gint
+grl_media_video_get_width (GrlMediaVideo *data)
+{
+  return grl_data_get_int (GRL_DATA (data), GRL_METADATA_KEY_WIDTH);
+}
+
+/**
+ * grl_media_video_get_height:
+ * @data: the media instance
+ *
+ * Returns: the height of the video
+ */
+gint
+grl_media_video_get_height (GrlMediaVideo *data)
+{
+  return grl_data_get_int (GRL_DATA (data), GRL_METADATA_KEY_HEIGHT);
+}
+
+/**
+ * grl_media_video_get_framerate:
+ * @data: the media instance
+ *
+ * Returns: the framerate of the video
+ */
+gfloat
+grl_media_video_get_framerate (GrlMediaVideo *data)
+{
+  return grl_data_get_float (GRL_DATA (data), GRL_METADATA_KEY_FRAMERATE);
+}
diff --git a/src/data/grl-media-video.h b/src/data/grl-media-video.h
index afdaad6..f79cebe 100644
--- a/src/data/grl-media-video.h
+++ b/src/data/grl-media-video.h
@@ -79,68 +79,17 @@ struct _GrlMediaVideo
   GrlMedia parent;
 };
 
-/**
- * grl_media_video_set_width:
- * @data: the media instance
- * @width: the video's width
- *
- * Set the width of the video
- */
-#define grl_media_video_set_width(data, width)  \
-  grl_data_set_int(GRL_DATA((data)),            \
-                   GRL_METADATA_KEY_WIDTH,      \
-                   (width))
+void grl_media_video_set_width (GrlMediaVideo *data, gint width);
 
-/**
- * grl_media_video_set_height:
- * @data: the media instance
- * @height: the video's height
- *
- * Set the height of the video
- */
-#define grl_media_video_set_height(data, height)        \
-  grl_data_set_int(GRL_DATA((data)),                    \
-                   GRL_METADATA_KEY_HEIGHT,             \
-                   (height))
+void grl_media_video_set_height (GrlMediaVideo *data, gint height);
 
-/**
- * grl_media_video_set_framerate:
- * @data: the media instance
- * @framerate: the video's framerate
- *
- * Set the framerate of the video
- */
-#define grl_media_video_set_framerate(data, framerate)  \
-  grl_data_set_float(GRL_DATA((data)),                  \
-                     GRL_METADATA_KEY_FRAMERATE,        \
-                     (framerate))
+void grl_media_video_set_framerate (GrlMediaVideo *data, gfloat framerate);
 
-/**
- * grl_media_video_get_width:
- * @data: the media instance
- *
- * Returns: the width of the video
- */
-#define grl_media_video_get_width(data)                         \
-  grl_data_get_int(GRL_DATA((data)), GRL_METADATA_KEY_WIDTH)
+gint grl_media_video_get_width (GrlMediaVideo *data);
 
-/**
- * grl_media_video_get_height:
- * @data: the media instance
- *
- * Returns: the height of the video
- */
-#define grl_media_video_get_height(data)                        \
-  grl_data_get_int(GRL_DATA((data)), GRL_METADATA_KEY_HEIGHT)
+gint grl_media_video_get_height (GrlMediaVideo *data);
 
-/**
- * grl_media_video_get_framerate:
- * @data: the media instance
- *
- * Returns: the framerate of the video
- */
-#define grl_media_video_get_framerate(data)                             \
-  grl_data_get_float(GRL_DATA((data)), GRL_METADATA_KEY_FRAMERATE)
+gfloat grl_media_video_get_framerate (GrlMediaVideo *data);
 
 GType grl_media_video_get_type (void) G_GNUC_CONST;
 
-- 
1.7.0.4



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