gstreamermm: index.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files

# 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 IndexGroup
    00318 {
    00319   public:
    00320 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00321   typedef IndexGroup CppObjectType;
    00322   typedef GstIndexGroup BaseObjectType;
    00323 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00324
    00325 private:
    00326
    00327
    00328 };
    00329
    00332 class IndexAssociation
    00333 {
    00334   public:
    00335 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00336   typedef IndexAssociation CppObjectType;
    00337   typedef GstIndexAssociation BaseObjectType;
    00338 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00339
    00340 private:
    00341
    00342
    00343 };
    00344
    00345
    00349 class Index : public Object
    00350 {
    00351
    00352 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00353
    00354 public:
    00355   typedef Index CppObjectType;
    00356   typedef Index_Class CppClassType;
    00357   typedef GstIndex BaseObjectType;
    00358   typedef GstIndexClass BaseClassType;
    00359
    00360 private:  friend class Index_Class;
    00361   static CppClassType index_class_;
    00362
    00363 private:
    00364   // noncopyable
    00365   Index(const Index&);
    00366   Index& operator=(const Index&);
    00367
    00368 protected:
    00369   explicit Index(const Glib::ConstructParams& construct_params);
    00370   explicit Index(GstIndex* castitem);
    00371
    00372 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00373
    00374 public:
    00375   virtual ~Index();
    00376
    00377 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00378   static GType get_type()      G_GNUC_CONST;
    00379   static GType get_base_type() G_GNUC_CONST;
    00380 #endif
    00381
    00383   GstIndex*       gobj()       { return reinterpret_cast<GstIndex*>(gobject_); }
    00384
    00386   const GstIndex* gobj() const { return reinterpret_cast<GstIndex*>(gobject_); }
    00387
    00389   GstIndex* gobj_copy();
    00390
    00391 private:
    00392
    00393
    00394 protected:
    00395   Index();
    00396
    00397 public:
    00401   bool is_readable() const;
    00402
    00406   bool is_writable() const;
    00407
    00408
    00414   void commit(int id);
    00415
    00419   int get_group() const;
    00420
    00425   int new_group();
    00426
    00432   bool set_group(int group_number);
    00433
    00437   void set_certainty(IndexCertainty certainty);
    00438
    00442   IndexCertainty get_certainty() const;
    00443
    00455   bool get_writer_id(const Glib::RefPtr<Gst::Object>& writer, int& id) const;
    00456
    00464   Gst::IndexEntry add_format(int id, Format format);
    00465
    00473   Gst::IndexEntry add_association(int id, AssocFlags flags, int n, const Gst::IndexAssociation& list);
    00474
    00480   Gst::IndexEntry add_id(int id, const Glib::ustring& description);
    00481
    00482   //TODO: Reorder parameters to allow default values?
    00483
    00493   Gst::IndexEntry get_assoc_entry(int id, IndexLookupMethod method, AssocFlags flags, Format format, gint64 value) const;
    00494
    00501   typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, Gst::IndexEntry> SlotFilter;
    00502
    00508   void set_filter(const SlotFilter& slot);
    00509
    00516   typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, const Glib::RefPtr<Gst::Object>&, Glib::ustring&> SlotResolver;
    00517
    00522   void set_resolver(const SlotResolver& slot);
    00523
    00524
    00531   Glib::SignalProxy1< void,const Gst::IndexEntry& > signal_entry_added();
    00532
    00533
    00534   #ifdef GLIBMM_PROPERTIES_ENABLED
    00535
    00541   Glib::PropertyProxy<Gst::Index::SlotResolver> property_resolver() ;
    00542 #endif //#GLIBMM_PROPERTIES_ENABLED
    00543
    00544 #ifdef GLIBMM_PROPERTIES_ENABLED
    00545
    00551   Glib::PropertyProxy_ReadOnly<Gst::Index::SlotResolver> property_resolver() const;
    00552 #endif //#GLIBMM_PROPERTIES_ENABLED
    00553
    00554
    00555 public:
    00556
    00557 public:
    00558   //C++ methods used to invoke GTK+ virtual functions:
    00559 #ifdef GLIBMM_VFUNCS_ENABLED
    00560 #endif //GLIBMM_VFUNCS_ENABLED
    00561
    00562 protected:
    00563   //GTK+ Virtual Functions (override these to change behaviour):
    00564 #ifdef GLIBMM_VFUNCS_ENABLED
    00565 #endif //GLIBMM_VFUNCS_ENABLED
    00566
    00567   //Default Signal Handlers::
    00568 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00569   virtual void on_entry_added(const Gst::IndexEntry& entry);
    00570 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00571
    00572
    00573 };
    00574
    00575 } //namespace Gst
    00576
    00577
    00578 namespace Glib
    00579 {
    00580
    00589 Gst::IndexEntry wrap(GstIndexEntry* object, bool take_copy = false);
    00590
    00591 } // namespace Glib
    00592
    00593
    00594 namespace Glib
    00595 {
    00604   Glib::RefPtr<Gst::Index> wrap(GstIndex* object, bool take_copy = false);
    00605 }
    00606
    00607
    00608 #endif /* _GSTREAMERMM_INDEX_H */
    00609