bus.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GSTREAMERMM_BUS_H
00004 #define _GSTREAMERMM_BUS_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* gstreamermm - a C++ wrapper for gstreamer
00010  *
00011  * Copyright 2008 The gstreamermm Development Team
00012  *
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Lesser General Public
00015  * License as published by the Free Software Foundation; either
00016  - version 2.1 of the License, or (at your option) any later version.
00017  *
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Lesser General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public
00024  * License along with this library; if not, write to the Free
00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00026  */
00027 
00028 #include <gst/gstbus.h>
00029 #include <gstreamermm/object.h>
00030 #include <gstreamermm/clock.h>
00031 #include <gstreamermm/message.h>
00032 //#include <glibmm/main.h> //For Glib::Source
00033 
00034 
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GstBus GstBus;
00037 typedef struct _GstBusClass GstBusClass;
00038 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00039 
00040 
00041 namespace Gst
00042 { class Bus_Class; } // namespace Gst
00043 namespace Gst
00044 {
00045 
00046 class Message;
00047 
00053 enum BusFlags
00054 {
00055   BUS_FLUSHING = GST_OBJECT_FLAG_LAST << 0,
00056   BUS_FLAG_LAST = GST_OBJECT_FLAG_LAST << 1
00057 };
00058 
00059 } // namespace Gst
00060 
00061 
00062 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00063 namespace Glib
00064 {
00065 
00066 template <>
00067 class Value<Gst::BusFlags> : public Glib::Value_Enum<Gst::BusFlags>
00068 {
00069 public:
00070   static GType value_type() G_GNUC_CONST;
00071 };
00072 
00073 } // namespace Glib
00074 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00075 
00076 
00077 namespace Gst
00078 {
00079 
00080 
00090 enum BusSyncReply
00091 {
00092   BUS_DROP,
00093   BUS_PASS,
00094   BUS_ASYNC
00095 };
00096 
00097 } // namespace Gst
00098 
00099 
00100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00101 namespace Glib
00102 {
00103 
00104 template <>
00105 class Value<Gst::BusSyncReply> : public Glib::Value_Enum<Gst::BusSyncReply>
00106 {
00107 public:
00108   static GType value_type() G_GNUC_CONST;
00109 };
00110 
00111 } // namespace Glib
00112 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00113 
00114 
00115 namespace Gst
00116 {
00117 
00118 
00162 class Bus : public Object
00163 {
00164   
00165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00166 
00167 public:
00168   typedef Bus CppObjectType;
00169   typedef Bus_Class CppClassType;
00170   typedef GstBus BaseObjectType;
00171   typedef GstBusClass BaseClassType;
00172 
00173 private:  friend class Bus_Class;
00174   static CppClassType bus_class_;
00175 
00176 private:
00177   // noncopyable
00178   Bus(const Bus&);
00179   Bus& operator=(const Bus&);
00180 
00181 protected:
00182   explicit Bus(const Glib::ConstructParams& construct_params);
00183   explicit Bus(GstBus* castitem);
00184 
00185 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00186 
00187 public:
00188   virtual ~Bus();
00189 
00190 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00191   static GType get_type()      G_GNUC_CONST;
00192   static GType get_base_type() G_GNUC_CONST;
00193 #endif
00194 
00196   GstBus*       gobj()       { return reinterpret_cast<GstBus*>(gobject_); }
00197 
00199   const GstBus* gobj() const { return reinterpret_cast<GstBus*>(gobject_); }
00200 
00202   GstBus* gobj_copy();
00203 
00204 private:
00205 
00206 
00207 protected:
00208   Bus();
00209 
00210 public:
00217   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Bus>&, const Glib::RefPtr<Gst::Message>& > SlotMessage;
00218 
00223   typedef sigc::slot< BusSyncReply, const Glib::RefPtr<Gst::Bus>&, const Glib::RefPtr<Gst::Message>& > SlotMessageSync;
00224 
00230   static Glib::RefPtr<Bus> create();
00231 
00232 
00240   bool post(const Glib::RefPtr<Gst::Message>& message);
00241   
00249   bool have_pending() const;
00250   
00258   Glib::RefPtr<Gst::Message> peek();
00259   
00267   Glib::RefPtr<const Gst::Message> peek() const;
00268   
00276   Glib::RefPtr<Gst::Message> pop();
00277   
00292   Glib::RefPtr<Gst::Message> pop(MessageType message_type);
00293   
00309   Glib::RefPtr<Gst::Message> pop(ClockTime timeout);
00310   
00329   Glib::RefPtr<Gst::Message> pop(ClockTime timeout, MessageType message_type);
00330   
00338   void set_flushing(bool flushing = true);
00339 
00340 //TODO Glib::Source has a strange cobject constructor.
00341 //#m4 __CONVERSION(`GSource*',`Glib::RefPtr<Glib::Source>', `Glib::wrap($3)')
00342 //  _WRAP_METHOD(Glib::RefPtr<Glib::Source> create_watch(), gst_bus_create_watch)
00343 
00354   guint add_watch(const SlotMessage& slot, int priority = Glib::PRIORITY_DEFAULT);
00355   
00356 
00362   bool remove_watch(guint watch_id);
00363 
00374   void set_sync_handler(const SlotMessageSync& slot);
00375   
00376   
00389   void disable_sync_message_emission();
00390   
00409   void enable_sync_message_emission();
00410 
00411   
00426   void add_signal_watch(int priority = Glib::PRIORITY_DEFAULT);
00427   
00428 
00433   void remove_signal_watch();
00434   
00474   Glib::RefPtr<Gst::Message> poll(MessageType message_type, ClockTimeDiff timeout);
00475 
00476  
00485   Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Message>& > signal_message();
00486 
00487 
00499   Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Message>& > signal_sync_message();
00500 
00501 
00502 public:
00503 
00504 public:
00505   //C++ methods used to invoke GTK+ virtual functions:
00506 #ifdef GLIBMM_VFUNCS_ENABLED
00507 #endif //GLIBMM_VFUNCS_ENABLED
00508 
00509 protected:
00510   //GTK+ Virtual Functions (override these to change behaviour):
00511 #ifdef GLIBMM_VFUNCS_ENABLED
00512 #endif //GLIBMM_VFUNCS_ENABLED
00513 
00514   //Default Signal Handlers::
00515 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00516   virtual void on_message(const Glib::RefPtr<Gst::Message>& message);
00517   virtual void on_sync_message(const Glib::RefPtr<Gst::Message>& message);
00518 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00519 
00520 
00521 };
00522 
00523 } //namespace Gst
00524 
00525 
00526 namespace Glib
00527 {
00536   Glib::RefPtr<Gst::Bus> wrap(GstBus* object, bool take_copy = false);
00537 }
00538 
00539 
00540 #endif /* _GSTREAMERMM_BUS_H */
00541 

Generated on Wed Aug 19 15:53:14 2009 for gstreamermm by  doxygen 1.5.4