- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List

# index.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_INDEX_H
    00004 #define _GSTREAMERMM_INDEX_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/gstindex.h>
    00029 #include <gstreamermm/object.h>
    00030 #include <gstreamermm/format.h>
    00031
    00032
    00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00034 typedef struct _GstIndex GstIndex;
    00035 typedef struct _GstIndexClass GstIndexClass;
    00036 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00037
    00038
    00039 namespace Gst
    00040 { class Index_Class; } // namespace Gst
    00041 namespace Gst
    00042 {
    00043
    00049 enum IndexCertainty
    00050 {
    00051   INDEX_UNKNOWN,
    00052   INDEX_CERTAIN,
    00053   INDEX_FUZZY
    00054 };
    00055
    00056 } // namespace Gst
    00057
    00058
    00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00060 namespace Glib
    00061 {
    00062
    00063 template <>
    00064 class Value<Gst::IndexCertainty> : public Glib::Value_Enum<Gst::IndexCertainty>
    00065 {
    00066 public:
    00067   static GType value_type() G_GNUC_CONST;
    00068 };
    00069
    00070 } // namespace Glib
    00071 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00072
    00073
    00074 namespace Gst
    00075 {
    00076
    00080 enum IndexEntryType
    00081 {
    00082   INDEX_ENTRY_ID,
    00083   INDEX_ENTRY_ASSOCIATION,
    00084   INDEX_ENTRY_OBJECT,
    00085   INDEX_ENTRY_FORMAT
    00086 };
    00087
    00088 } // namespace Gst
    00089
    00090
    00091 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00092 namespace Glib
    00093 {
    00094
    00095 template <>
    00096 class Value<Gst::IndexEntryType> : public Glib::Value_Enum<Gst::IndexEntryType>
    00097 {
    00098 public:
    00099   static GType value_type() G_GNUC_CONST;
    00100 };
    00101
    00102 } // namespace Glib
    00103 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00104
    00105
    00106 namespace Gst
    00107 {
    00108
    00112 enum IndexLookupMethod
    00113 {
    00114   INDEX_LOOKUP_EXACT,
    00115   INDEX_LOOKUP_BEFORE,
    00116   INDEX_LOOKUP_AFTER
    00117 };
    00118
    00119 } // namespace Gst
    00120
    00121
    00122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00123 namespace Glib
    00124 {
    00125
    00126 template <>
    00127 class Value<Gst::IndexLookupMethod> : public Glib::Value_Enum<Gst::IndexLookupMethod>
    00128 {
    00129 public:
    00130   static GType value_type() G_GNUC_CONST;
    00131 };
    00132
    00133 } // namespace Glib
    00134 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00135
    00136
    00137 namespace Gst
    00138 {
    00139
    00151 enum AssocFlags
    00152 {
    00153   ASSOCIATION_FLAG_NONE = 0,
    00154   ASSOCIATION_FLAG_KEY_UNIT = 1 << 0,
    00155   ASSOCIATION_FLAG_DELTA_UNIT = 1 << 1,
    00156   ASSOCIATION_FLAG_LAST = 1 << 8
    00157 };
    00158
    00160 inline AssocFlags operator|(AssocFlags lhs, AssocFlags rhs)
    00161   { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
    00162
    00164 inline AssocFlags operator&(AssocFlags lhs, AssocFlags rhs)
    00165   { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
    00166
    00168 inline AssocFlags operator^(AssocFlags lhs, AssocFlags rhs)
    00169   { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
    00170
    00172 inline AssocFlags operator~(AssocFlags flags)
    00173   { return static_cast<AssocFlags>(~static_cast<unsigned>(flags)); }
    00174
    00176 inline AssocFlags& operator|=(AssocFlags& lhs, AssocFlags rhs)
    00177   { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
    00178
    00180 inline AssocFlags& operator&=(AssocFlags& lhs, AssocFlags rhs)
    00181   { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
    00182
    00184 inline AssocFlags& operator^=(AssocFlags& lhs, AssocFlags rhs)
    00185   { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
    00186
    00187 } // namespace Gst
    00188
    00189
    00190 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00191 namespace Glib
    00192 {
    00193
    00194 template <>
    00195 class Value<Gst::AssocFlags> : public Glib::Value_Flags<Gst::AssocFlags>
    00196 {
    00197 public:
    00198   static GType value_type() G_GNUC_CONST;
    00199 };
    00200
    00201 } // namespace Glib
    00202 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00203
    00204
    00205 namespace Gst
    00206 {
    00207
    00211 enum IndexResolverMethod
    00212 {
    00213   INDEX_RESOLVER_CUSTOM,
    00214   INDEX_RESOLVER_GTYPE,
    00215   INDEX_RESOLVER_PATH
    00216 };
    00217
    00218 } // namespace Gst
    00219
    00220
    00221 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00222 namespace Glib
    00223 {
    00224
    00225 template <>
    00226 class Value<Gst::IndexResolverMethod> : public Glib::Value_Enum<Gst::IndexResolverMethod>
    00227 {
    00228 public:
    00229   static GType value_type() G_GNUC_CONST;
    00230 };
    00231
    00232 } // namespace Glib
    00233 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00234
    00235
    00236 namespace Gst
    00237 {
    00238
    00242 enum IndexFlags
    00243 {
    00244   INDEX_WRITABLE = GST_OBJECT_FLAG_LAST << 0,
    00245   INDEX_READABLE = GST_OBJECT_FLAG_LAST << 1,
    00246   INDEX_FLAG_LAST = GST_OBJECT_FLAG_LAST << 8
    00247 };
    00248
    00249 } // namespace Gst
    00250
    00251
    00252 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00253 namespace Glib
    00254 {
    00255
    00256 template <>
    00257 class Value<Gst::IndexFlags> : public Glib::Value_Enum<Gst::IndexFlags>
    00258 {
    00259 public:
    00260   static GType value_type() G_GNUC_CONST;
    00261 };
    00262
    00263 } // namespace Glib
    00264 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00265
    00266
    00267 namespace Gst
    00268 {
    00269
    00270
    00273 class IndexEntry
    00274 {
    00275   public:
    00276 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00277   typedef IndexEntry CppObjectType;
    00278   typedef GstIndexEntry BaseObjectType;
    00279 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00280
    00281   IndexEntry();
    00282
    00283   // Use make_a_copy=true when getting it directly from a struct.
    00284   explicit IndexEntry(GstIndexEntry* castitem, bool make_a_copy = false);
    00285
    00286   IndexEntry(const IndexEntry& src);
    00287   IndexEntry& operator=(const IndexEntry& src);
    00288
    00289   ~IndexEntry();
    00290
    00291   GstIndexEntry*       gobj()       { return gobject_; }
    00292   const GstIndexEntry* gobj() const { return gobject_; }
    00293
    00295   GstIndexEntry* gobj_copy() const;
    00296
    00297 protected:
    00298   GstIndexEntry* gobject_;
    00299
    00300 private:
    00301
    00302 public:
    00303
    00310   bool assoc_map(Format format, gint64& value) const;
    00311
    00312
    00313 };
    00314
    00317 class IndexAssociation
    00318 {
    00319   public:
    00320 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00321   typedef IndexAssociation CppObjectType;
    00322   typedef GstIndexAssociation BaseObjectType;
    00323 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00324
    00325 private:
    00326
    00327
    00328 public:
    00330   IndexAssociation();
    00331
    00336    IndexAssociation(const GstIndexAssociation* castitem);
    00337
    00339   Gst::Format format;
    00340
    00342   gint64 value;
    00343
    00344
    00345 };
    00346
    00347
    00351 class Index : public Object
    00352 {
    00353
    00354 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00355
    00356 public:
    00357   typedef Index CppObjectType;
    00358   typedef Index_Class CppClassType;
    00359   typedef GstIndex BaseObjectType;
    00360   typedef GstIndexClass BaseClassType;
    00361
    00362 private:  friend class Index_Class;
    00363   static CppClassType index_class_;
    00364
    00365 private:
    00366   // noncopyable
    00367   Index(const Index&);
    00368   Index& operator=(const Index&);
    00369
    00370 protected:
    00371   explicit Index(const Glib::ConstructParams& construct_params);
    00372   explicit Index(GstIndex* castitem);
    00373
    00374 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00375
    00376 public:
    00377   virtual ~Index();
    00378
    00379 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00380   static GType get_type()      G_GNUC_CONST;
    00381   static GType get_base_type() G_GNUC_CONST;
    00382 #endif
    00383
    00385   GstIndex*       gobj()       { return reinterpret_cast<GstIndex*>(gobject_); }
    00386
    00388   const GstIndex* gobj() const { return reinterpret_cast<GstIndex*>(gobject_); }
    00389
    00391   GstIndex* gobj_copy();
    00392
    00393 private:
    00394
    00395
    00396 protected:
    00397   Index();
    00398
    00399 public:
    00406   typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, Gst::IndexEntry> SlotFilter;
    00407
    00414   typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, const Glib::RefPtr<Gst::Object>&, Glib::ustring&> SlotResolver;
    00415
    00419   bool is_readable() const;
    00420
    00424   bool is_writable() const;
    00425
    00426
    00432   void commit(int id);
    00433
    00437   int get_group() const;
    00438
    00443   int new_group();
    00444
    00450   bool set_group(int group_number);
    00451
    00455   void set_certainty(IndexCertainty certainty);
    00456
    00460   IndexCertainty get_certainty() const;
    00461
    00473   bool get_writer_id(const Glib::RefPtr<Gst::Object>& writer, int& id) const;
    00474
    00475 // This conversion is used for next few add* methods (add_format,
    00476 // add_association, etc.).  A copy is taken so the original is not freed by the
    00477 // wrapper.
    00478
    00479
    00487   Gst::IndexEntry add_format(int id, Format format);
    00488
    00489
    00497   Gst::IndexEntry add_association(int id, AssocFlags flags, int n, const Glib::ArrayHandle<const Gst::IndexAssociation>& list);
    00498
    00499
    00505   Gst::IndexEntry add_id(int id, const Glib::ustring& description);
    00506
    00517   Gst::IndexEntry get_assoc_entry(int id, gint64 value,
    00518     IndexLookupMethod method = Gst::INDEX_LOOKUP_EXACT,
    00519     AssocFlags flags = Gst::ASSOCIATION_FLAG_NONE,
    00520     Format format = Gst::FORMAT_DEFAULT) const;
    00521
    00527   void set_filter(const SlotFilter& slot);
    00528
    00533   void set_resolver(const SlotResolver& slot);
    00534
    00535   #ifdef GLIBMM_PROPERTIES_ENABLED
    00536
    00542   Glib::PropertyProxy<Gst::Index::SlotResolver> property_resolver() ;
    00543 #endif //#GLIBMM_PROPERTIES_ENABLED
    00544
    00545 #ifdef GLIBMM_PROPERTIES_ENABLED
    00546
    00552   Glib::PropertyProxy_ReadOnly<Gst::Index::SlotResolver> property_resolver() const;
    00553 #endif //#GLIBMM_PROPERTIES_ENABLED
    00554
    00555
    00562   Glib::SignalProxy1< void,const Gst::IndexEntry& > signal_entry_added();
    00563
    00564
    00565   #ifdef GLIBMM_VFUNCS_ENABLED
    00566   virtual bool get_writer_id_vfunc(int& writer_id, const Glib::ustring& writer_string) const;
    00567 #endif //GLIBMM_VFUNCS_ENABLED
    00568
    00569
    00570   #ifdef GLIBMM_VFUNCS_ENABLED
    00571   virtual void commit_vfunc(gint id);
    00572 #endif //GLIBMM_VFUNCS_ENABLED
    00573
    00574
    00575 #ifdef GLIBMM_VFUNCS_ENABLED
    00576   virtual void add_entry_vfunc(Gst::IndexEntry& entry);
    00577 #endif //GLIBMM_VFUNCS_ENABLED
    00578
    00579   //TODO: Leave this vfunc for later because it is not absolutely necessary
    00580   //right now.
    00581   //_WRAP_VFUNC(void get_assoc_entry(Gst::LookupMethod method, Gst::AssocFlags flags, Gst::Format format, gint64 value, const SlotCompareData& compare_slot), "get_assoc_entry")
    00582
    00583 protected:
    00584
    00585
    00586 public:
    00587
    00588 public:
    00589   //C++ methods used to invoke GTK+ virtual functions:
    00590 #ifdef GLIBMM_VFUNCS_ENABLED
    00591 #endif //GLIBMM_VFUNCS_ENABLED
    00592
    00593 protected:
    00594   //GTK+ Virtual Functions (override these to change behaviour):
    00595 #ifdef GLIBMM_VFUNCS_ENABLED
    00596 #endif //GLIBMM_VFUNCS_ENABLED
    00597
    00598   //Default Signal Handlers::
    00599 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00600   virtual void on_entry_added(const Gst::IndexEntry& entry);
    00601 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00602
    00603
    00604 };
    00605
    00606 } //namespace Gst
    00607
    00608
    00609 namespace Glib
    00610 {
    00611
    00620 Gst::IndexEntry wrap(GstIndexEntry* object, bool take_copy = false);
    00621
    00622 } // namespace Glib
    00623
    00624
    00625 namespace Glib
    00626 {
    00635   Glib::RefPtr<Gst::Index> wrap(GstIndex* object, bool take_copy = false);
    00636 }
    00637
    00638
    00639 #endif /* _GSTREAMERMM_INDEX_H */
    00640