gnomemm r1276 - in gstreamermm/trunk: . gst/src tests



Author: jaalburqu
Date: Sun Jan  6 20:07:07 2008
New Revision: 1276
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1276&view=rev

Log:
2008-01-06  Josà Alburquerque  <jaalburqu svn gnome org>

	* gst/src/element.hg: moved get_enum_name() methods to Gst namespace
	in enum.{hg, ccg}
	* gst/src/enums.ccg: added get_name() methods for EventType, Format,
	* gst/src/enums.hg:  MessageType, State and StateChangeReturn; added
	get_quark() methods for EventType, Format and MessageType
	* gst/src/event.hg: moved get_enum_name() and get_enum_quark() to
	Gst namespace in enum.{hg, ccg}
	* gst/src/format.ccg:
	* gst/src/format.hg: moved get_format_name() and get_format_quark()
	to enum.{hg, ccg}
	* gst/src/message.hg: moved get_enum_name() and get_enum_quark() to
	Gst namespace in files enum.{hg, ccg}
	* tests/test-event-wrap.cc: added type name output line
	* tests/test-message-wrap.cc: added type name output line


Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gst/src/element.hg
   gstreamermm/trunk/gst/src/enums.ccg
   gstreamermm/trunk/gst/src/enums.hg
   gstreamermm/trunk/gst/src/event.hg
   gstreamermm/trunk/gst/src/format.ccg
   gstreamermm/trunk/gst/src/format.hg
   gstreamermm/trunk/gst/src/message.hg
   gstreamermm/trunk/tests/test-event-wrap.cc
   gstreamermm/trunk/tests/test-message-wrap.cc

Modified: gstreamermm/trunk/ChangeLog
==============================================================================
--- gstreamermm/trunk/ChangeLog	(original)
+++ gstreamermm/trunk/ChangeLog	Sun Jan  6 20:07:07 2008
@@ -1,3 +1,20 @@
+2008-01-06  Josà Alburquerque  <jaalburqu svn gnome org>
+
+	* gst/src/element.hg: moved get_enum_name() methods to Gst namespace
+	in enum.{hg, ccg}
+	* gst/src/enums.ccg: added get_name() methods for EventType, Format,
+	* gst/src/enums.hg:  MessageType, State and StateChangeReturn; added
+	get_quark() methods for EventType, Format and MessageType
+	* gst/src/event.hg: moved get_enum_name() and get_enum_quark() to
+	Gst namespace in enum.{hg, ccg}
+	* gst/src/format.ccg:
+	* gst/src/format.hg: moved get_format_name() and get_format_quark()
+	to enum.{hg, ccg}
+	* gst/src/message.hg: moved get_enum_name() and get_enum_quark() to
+	Gst namespace in files enum.{hg, ccg}
+	* tests/test-event-wrap.cc: added type name output line
+	* tests/test-message-wrap.cc: added type name output line
+
 2008-01-04  Josà Alburquerque  <jaalburqu svn gnome org>
 
 	* examples/ogg_player_gtkmm/PlayerWindow.cc: modified on_forward()

Modified: gstreamermm/trunk/gst/src/element.hg
==============================================================================
--- gstreamermm/trunk/gst/src/element.hg	(original)
+++ gstreamermm/trunk/gst/src/element.hg	Sun Jan  6 20:07:07 2008
@@ -32,8 +32,6 @@
 
   static Glib::RefPtr<Element> create(const Glib::ustring& factoryname, const Glib::ustring& name);
   Glib::RefPtr<Element> link(const Glib::RefPtr<Element>& other_element);
-  _WRAP_METHOD(static Glib::ustring get_enum_name(State state), gst_element_state_get_name)
-  _WRAP_METHOD(static Glib::ustring get_enum_name(StateChangeReturn state_ret), gst_element_state_change_return_get_name)
   _WRAP_METHOD(bool add_pad(const Glib::RefPtr<Pad>& pad), gst_element_add_pad)
   _WRAP_METHOD(Glib::RefPtr<Pad> get_pad(const Glib::ustring& name), gst_element_get_pad)
   _WRAP_METHOD(void create_all_pads(), gst_element_create_all_pads)

Modified: gstreamermm/trunk/gst/src/enums.ccg
==============================================================================
--- gstreamermm/trunk/gst/src/enums.ccg	(original)
+++ gstreamermm/trunk/gst/src/enums.ccg	Sun Jan  6 20:07:07 2008
@@ -1 +1,46 @@
 #include <gst/gst.h>
+
+namespace Gst
+{
+
+Glib::ustring get_name(EventType t)
+{
+  return gst_event_type_get_name(GstEventType(t));
+}
+
+Glib::ustring get_name(Format f)
+{
+  return gst_format_get_name(GstFormat(f));
+}
+
+Glib::ustring get_name(MessageType t)
+{
+  return gst_message_type_get_name(GstMessageType(t));
+}
+
+Glib::ustring get_name(State s)
+{
+  return gst_element_state_get_name(GstState(s));
+}
+
+Glib::ustring get_name(StateChangeReturn s)
+{
+  return gst_element_state_change_return_get_name(GstStateChangeReturn(s));
+}
+
+Glib::QueryQuark get_quark(EventType t)
+{
+  return Glib::QueryQuark(gst_event_type_to_quark(GstEventType(t)));
+}
+
+Glib::QueryQuark get_quark(Format f)
+{
+  return Glib::QueryQuark(gst_format_to_quark(GstFormat(f)));
+}
+
+Glib::QueryQuark get_quark(MessageType t)
+{
+  return Glib::QueryQuark(gst_message_type_to_quark(GstMessageType(t)));
+}
+
+} //namespace Gst

Modified: gstreamermm/trunk/gst/src/enums.hg
==============================================================================
--- gstreamermm/trunk/gst/src/enums.hg	(original)
+++ gstreamermm/trunk/gst/src/enums.hg	Sun Jan  6 20:07:07 2008
@@ -178,4 +178,14 @@
 _WRAP_ENUM(TagMergeMode, GstTagMergeMode)
 _WRAP_ENUM(TagFlag, GstTagFlag)
 
+Glib::ustring get_name(EventType t);
+Glib::ustring get_name(Format f);
+Glib::ustring get_name(MessageType t);
+Glib::ustring get_name(State s);
+Glib::ustring get_name(StateChangeReturn s);
+
+Glib::QueryQuark get_quark(EventType t);
+Glib::QueryQuark get_quark(Format f);
+Glib::QueryQuark get_quark(MessageType t);
+
 } //namespace Gst

Modified: gstreamermm/trunk/gst/src/event.hg
==============================================================================
--- gstreamermm/trunk/gst/src/event.hg	(original)
+++ gstreamermm/trunk/gst/src/event.hg	Sun Jan  6 20:07:07 2008
@@ -28,9 +28,6 @@
    */
   static Glib::RefPtr<Event> wrap(GstEvent* event, bool take_copy=false);
 
-  _WRAP_METHOD(static Glib::ustring get_enum_name(EventType type), gst_event_type_get_name)
-  _WRAP_METHOD(static Glib::QueryQuark get_enum_quark(EventType type), gst_event_type_to_quark)
-
   bool is_downstream() const;
   bool is_upstream() const;
   bool is_serialized() const;

Modified: gstreamermm/trunk/gst/src/format.ccg
==============================================================================
--- gstreamermm/trunk/gst/src/format.ccg	(original)
+++ gstreamermm/trunk/gst/src/format.ccg	Sun Jan  6 20:07:07 2008
@@ -3,16 +3,6 @@
 namespace Gst
 {
 
-Glib::ustring get_format_name(Format format)
-{
-  return gst_format_get_name(GstFormat(format));
-}
-
-GQuark get_format_quark(Format format)
-{
-  return gst_format_to_quark(GstFormat(format));
-}
-
 Format register_format(const Glib::ustring& nick, const Glib::ustring& description)
 {
   return Format(gst_format_register(nick.c_str(), description.c_str()));

Modified: gstreamermm/trunk/gst/src/format.hg
==============================================================================
--- gstreamermm/trunk/gst/src/format.hg	(original)
+++ gstreamermm/trunk/gst/src/format.hg	Sun Jan  6 20:07:07 2008
@@ -13,8 +13,6 @@
 
   //Note that GstFormat is an enum. That's why these are not member functions of a class.
 
-  Glib::ustring get_format_name(Format format);
-  GQuark get_format_quark(Format format);
   Format register_format(const Glib::ustring& nick, const Glib::ustring&description);
   Format get_format_by_nick(const Glib::ustring& nick);
   bool formats_contain_format(const Format& formats, Format format);

Modified: gstreamermm/trunk/gst/src/message.hg
==============================================================================
--- gstreamermm/trunk/gst/src/message.hg	(original)
+++ gstreamermm/trunk/gst/src/message.hg	Sun Jan  6 20:07:07 2008
@@ -30,9 +30,6 @@
    */
   static Glib::RefPtr<Message> wrap(GstMessage* message, bool take_copy=false);
 
-  _WRAP_METHOD(static Glib::ustring get_enum_name(MessageType type), gst_message_type_get_name)
-  _WRAP_METHOD(static Glib::QueryQuark get_enum_quark(MessageType type), gst_message_type_to_quark)
-
 protected: 
   Structure structure_;
 };

Modified: gstreamermm/trunk/tests/test-event-wrap.cc
==============================================================================
--- gstreamermm/trunk/tests/test-event-wrap.cc	(original)
+++ gstreamermm/trunk/tests/test-event-wrap.cc	Sun Jan  6 20:07:07 2008
@@ -13,6 +13,7 @@
 
   Glib::RefPtr<Gst::EventLatency> event_latency = Glib::RefPtr<Gst::EventLatency>::cast_dynamic(event);
   std::cout << "event is a Gst::EventLatency: " << (bool)event_latency  << std::endl;
+  std::cout << "event type name: '" << Gst::get_name(event->get_event_type()) << "'" << std::endl;
 
   return 0;
 }

Modified: gstreamermm/trunk/tests/test-message-wrap.cc
==============================================================================
--- gstreamermm/trunk/tests/test-message-wrap.cc	(original)
+++ gstreamermm/trunk/tests/test-message-wrap.cc	Sun Jan  6 20:07:07 2008
@@ -15,6 +15,7 @@
 
   Glib::RefPtr<Gst::MessageWarning> message_warning = Glib::RefPtr<Gst::MessageWarning>::cast_dynamic(message);
   std::cout << "message is a Gst::MessageWarning: " << (bool)message_warning  << std::endl;
+  std::cout << "message type name: '" << Gst::get_name(message->get_message_type()) << "'"  << std::endl;
 
   return 0;
 }



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