00001
00002
00003 #ifndef _GSTREAMERMM_BIN_H
00004 #define _GSTREAMERMM_BIN_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <gstreamermm/element.h>
00031 #include <gstreamermm/childproxy.h>
00032 #include <gstreamermm/pad.h>
00033 #include <stdexcept>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GstBin GstBin;
00038 typedef struct _GstBinClass GstBinClass;
00039 #endif
00040
00041
00042 namespace Gst
00043 { class Bin_Class; }
00044 namespace Gst
00045 {
00046
00047 class Pad;
00048
00049
00050 template <class CppType>
00051 class Iterator;
00052
00143 class Bin
00144 : public Element,
00145 public ChildProxy
00146 {
00147
00148 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00149
00150 public:
00151 typedef Bin CppObjectType;
00152 typedef Bin_Class CppClassType;
00153 typedef GstBin BaseObjectType;
00154 typedef GstBinClass BaseClassType;
00155
00156 private: friend class Bin_Class;
00157 static CppClassType bin_class_;
00158
00159 private:
00160
00161 Bin(const Bin&);
00162 Bin& operator=(const Bin&);
00163
00164 protected:
00165 explicit Bin(const Glib::ConstructParams& construct_params);
00166 explicit Bin(GstBin* castitem);
00167
00168 #endif
00169
00170 public:
00171 virtual ~Bin();
00172
00173 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00174 static GType get_type() G_GNUC_CONST;
00175 static GType get_base_type() G_GNUC_CONST;
00176 #endif
00177
00179 GstBin* gobj() { return reinterpret_cast<GstBin*>(gobject_); }
00180
00182 const GstBin* gobj() const { return reinterpret_cast<GstBin*>(gobject_); }
00183
00185 GstBin* gobj_copy();
00186
00187 private:
00188
00189
00190 protected:
00191 explicit Bin(const Glib::ustring& name);
00192
00193 public:
00200 static Glib::RefPtr<Bin> create(const Glib::ustring& name);
00201
00202
00217 Glib::RefPtr<Bin> add(const Glib::RefPtr<Element>& element);
00218
00219
00234 Glib::RefPtr<Bin> remove(const Glib::RefPtr<Element>& element);
00235
00236
00237
00238
00239
00240
00248 Glib::RefPtr<Element> get_element(const Glib::ustring& name);
00249
00257 Glib::RefPtr<const Element> get_element(const Glib::ustring& name) const;
00258
00259
00267 Glib::RefPtr<Element> get_element_recurse_up(const Glib::ustring& name);
00268
00276 Glib::RefPtr<const Element> get_element_recurse_up(const Glib::ustring& name) const;
00277
00278
00289 Glib::RefPtr<Element> get_element(GType interface);
00290
00301 Glib::RefPtr<const Element> get_element(GType interface) const;
00302
00303
00314 Glib::RefPtr<Pad> find_unlinked_pad(PadDirection dir);
00315
00326 Glib::RefPtr<const Pad> find_unlinked_pad(PadDirection dir) const;
00327
00328
00337 Iterator<Element> iterate_elements();
00338
00348 Iterator<Element> iterate_recurse();
00349
00363 Iterator<Element> iterate_sorted();
00364
00374 Iterator<Element> iterate_sources();
00375
00385 Iterator<Element> iterate_sinks();
00386
00400 Iterator<Element> iterate_by_interface(GType iface);
00401
00402
00405 Glib::ListHandle< Glib::RefPtr<Element> > get_children() const;
00406
00409 int get_num_children() const;
00410
00411
00418 Glib::SignalProxy1< void,const Glib::RefPtr<Element>& > signal_element_added();
00419
00420
00427 Glib::SignalProxy1< void,const Glib::RefPtr<Element>& > signal_element_removed();
00428
00429
00430 #ifdef GLIBMM_PROPERTIES_ENABLED
00431
00437 Glib::PropertyProxy<bool> property_async_handling() ;
00438 #endif //#GLIBMM_PROPERTIES_ENABLED
00439
00440 #ifdef GLIBMM_PROPERTIES_ENABLED
00441
00447 Glib::PropertyProxy_ReadOnly<bool> property_async_handling() const;
00448 #endif //#GLIBMM_PROPERTIES_ENABLED
00449
00450
00453 #ifdef GLIBMM_VFUNCS_ENABLED
00454 virtual bool add_element_vfunc(const Glib::RefPtr<Element>& element);
00455 #endif //GLIBMM_VFUNCS_ENABLED
00456
00457
00460 #ifdef GLIBMM_VFUNCS_ENABLED
00461 virtual bool remove_element_vfunc(const Glib::RefPtr<Element>& element);
00462 #endif //GLIBMM_VFUNCS_ENABLED
00463
00464
00467 #ifdef GLIBMM_VFUNCS_ENABLED
00468 virtual void handle_message_vfunc(const Glib::RefPtr<Message>& message);
00469 #endif //GLIBMM_VFUNCS_ENABLED
00470
00471
00472 public:
00473
00474 public:
00475
00476 #ifdef GLIBMM_VFUNCS_ENABLED
00477 #endif //GLIBMM_VFUNCS_ENABLED
00478
00479 protected:
00480
00481 #ifdef GLIBMM_VFUNCS_ENABLED
00482 #endif //GLIBMM_VFUNCS_ENABLED
00483
00484
00485 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00486 virtual void on_element_added(const Glib::RefPtr<Element>& element);
00487 virtual void on_element_removed(const Glib::RefPtr<Element>& element);
00488 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00489
00490
00491 };
00492
00493 }
00494
00495
00496 namespace Glib
00497 {
00506 Glib::RefPtr<Gst::Bin> wrap(GstBin* object, bool take_copy = false);
00507 }
00508
00509
00510 #endif
00511