[gstreamermm: 105/167] fixed unit test - adding/getting date from taglist. Yep... minor bug, 3 hours spent... I'm not sure



commit 69e763d530b2990f48ac3223bc35049c3721f207
Author: Marcin Kolny [loganek] <marcin kolny gmail com>
Date:   Thu Aug 1 01:34:10 2013 +0200

    fixed unit test - adding/getting date from taglist. Yep... minor bug, 3 hours spent... I'm not sure it is 
the best way to fix this problem

 gstreamer/src/taglist.ccg |   10 ++++++++++
 gstreamer/src/taglist.hg  |   21 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/gstreamer/src/taglist.ccg b/gstreamer/src/taglist.ccg
index 836335c..90164c6 100644
--- a/gstreamer/src/taglist.ccg
+++ b/gstreamer/src/taglist.ccg
@@ -141,6 +141,16 @@ void TagList::add(const Glib::ustring& tag, const char* data, TagMergeMode mode)
                    static_cast<void*>(0));
 }
 
+void TagList::add(Tag tag, const Glib::Date& date, TagMergeMode mode)
+{
+  add(_tag_strings[tag], date, mode);
+}
+
+void TagList::add(const Glib::ustring& tag, const Glib::Date& date, TagMergeMode mode)
+{
+  gst_tag_list_add(gobj(), static_cast<GstTagMergeMode>(mode), tag.c_str(), date.gobj(), 0);
+}
+
 void TagList::foreach(const SlotForeach& slot)
 {
   gst_tag_list_foreach(gobj(), &TagList_foreach_gstreamermm_callback,
diff --git a/gstreamer/src/taglist.hg b/gstreamer/src/taglist.hg
index 74df297..3b202a3 100644
--- a/gstreamer/src/taglist.hg
+++ b/gstreamer/src/taglist.hg
@@ -413,6 +413,27 @@ public:
   template <class DataType>
   void add(const Glib::ustring& tag, const DataType& data, TagMergeMode mode = TAG_MERGE_PREPEND);
 
+  // Methods below are written as workaround for Glib::Date - it's not working with
+  // with Glib::Value, because GValue with Glib::Date is invalid type for gstreamer functions.
+
+  /** Sets the value for the given tag using the specified mode.
+   *
+   * @param tag The tag name.
+   * @param data A value which the tag should be set to (this can be any
+   * supported C++ type).
+   * @param mode The merge mode to use.
+   */
+  void add(Tag tag, const Glib::Date& date, TagMergeMode mode = TAG_MERGE_PREPEND);
+
+  /** Sets the value for the given tag using the specified mode.
+   *
+   * @param tag The tag name.
+   * @param data A value which the tag should be set to (this can be any
+   * supported C++ type).
+   * @param mode The merge mode to use.
+   */
+  void add(const Glib::ustring& tag, const Glib::Date& date, TagMergeMode mode = TAG_MERGE_PREPEND);
+
   _IGNORE(gst_tag_list_add_valist, gst_tag_list_add_valist_values)
 
 #m4begin


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