00001
00002
00003 #ifndef _GSTREAMERMM_INDEX_H
00004 #define _GSTREAMERMM_INDEX_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 <gst/gstindex.h>
00031 #include <gstreamermm/object.h>
00032 #include <gstreamermm/format.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GstIndex GstIndex;
00037 typedef struct _GstIndexClass GstIndexClass;
00038 #endif
00039
00040
00041 namespace Gst
00042 { class Index_Class; }
00043 namespace Gst
00044 {
00045
00051 enum IndexCertainty
00052 {
00053 INDEX_UNKNOWN,
00054 INDEX_CERTAIN,
00055 INDEX_FUZZY
00056 };
00057
00058 }
00059
00060
00061 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00062 namespace Glib
00063 {
00064
00065 template <>
00066 class Value<Gst::IndexCertainty> : public Glib::Value_Enum<Gst::IndexCertainty>
00067 {
00068 public:
00069 static GType value_type() G_GNUC_CONST;
00070 };
00071
00072 }
00073 #endif
00074
00075
00076 namespace Gst
00077 {
00078
00082 enum IndexEntryType
00083 {
00084 INDEX_ENTRY_ID,
00085 INDEX_ENTRY_ASSOCIATION,
00086 INDEX_ENTRY_OBJECT,
00087 INDEX_ENTRY_FORMAT
00088 };
00089
00090 }
00091
00092
00093 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00094 namespace Glib
00095 {
00096
00097 template <>
00098 class Value<Gst::IndexEntryType> : public Glib::Value_Enum<Gst::IndexEntryType>
00099 {
00100 public:
00101 static GType value_type() G_GNUC_CONST;
00102 };
00103
00104 }
00105 #endif
00106
00107
00108 namespace Gst
00109 {
00110
00114 enum IndexLookupMethod
00115 {
00116 INDEX_LOOKUP_EXACT,
00117 INDEX_LOOKUP_BEFORE,
00118 INDEX_LOOKUP_AFTER
00119 };
00120
00121 }
00122
00123
00124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00125 namespace Glib
00126 {
00127
00128 template <>
00129 class Value<Gst::IndexLookupMethod> : public Glib::Value_Enum<Gst::IndexLookupMethod>
00130 {
00131 public:
00132 static GType value_type() G_GNUC_CONST;
00133 };
00134
00135 }
00136 #endif
00137
00138
00139 namespace Gst
00140 {
00141
00153 enum AssocFlags
00154 {
00155 ASSOCIATION_FLAG_NONE = 0,
00156 ASSOCIATION_FLAG_KEY_UNIT = 1 << 0,
00157 ASSOCIATION_FLAG_DELTA_UNIT = 1 << 1,
00158 ASSOCIATION_FLAG_LAST = 1 << 8
00159 };
00160
00162 inline AssocFlags operator|(AssocFlags lhs, AssocFlags rhs)
00163 { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00164
00166 inline AssocFlags operator&(AssocFlags lhs, AssocFlags rhs)
00167 { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00168
00170 inline AssocFlags operator^(AssocFlags lhs, AssocFlags rhs)
00171 { return static_cast<AssocFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00172
00174 inline AssocFlags operator~(AssocFlags flags)
00175 { return static_cast<AssocFlags>(~static_cast<unsigned>(flags)); }
00176
00178 inline AssocFlags& operator|=(AssocFlags& lhs, AssocFlags rhs)
00179 { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00180
00182 inline AssocFlags& operator&=(AssocFlags& lhs, AssocFlags rhs)
00183 { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00184
00186 inline AssocFlags& operator^=(AssocFlags& lhs, AssocFlags rhs)
00187 { return (lhs = static_cast<AssocFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00188
00189 }
00190
00191
00192 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00193 namespace Glib
00194 {
00195
00196 template <>
00197 class Value<Gst::AssocFlags> : public Glib::Value_Flags<Gst::AssocFlags>
00198 {
00199 public:
00200 static GType value_type() G_GNUC_CONST;
00201 };
00202
00203 }
00204 #endif
00205
00206
00207 namespace Gst
00208 {
00209
00213 enum IndexResolverMethod
00214 {
00215 INDEX_RESOLVER_CUSTOM,
00216 INDEX_RESOLVER_GTYPE,
00217 INDEX_RESOLVER_PATH
00218 };
00219
00220 }
00221
00222
00223 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00224 namespace Glib
00225 {
00226
00227 template <>
00228 class Value<Gst::IndexResolverMethod> : public Glib::Value_Enum<Gst::IndexResolverMethod>
00229 {
00230 public:
00231 static GType value_type() G_GNUC_CONST;
00232 };
00233
00234 }
00235 #endif
00236
00237
00238 namespace Gst
00239 {
00240
00244 enum IndexFlags
00245 {
00246 INDEX_WRITABLE = GST_OBJECT_FLAG_LAST << 0,
00247 INDEX_READABLE = GST_OBJECT_FLAG_LAST << 1,
00248 INDEX_FLAG_LAST = GST_OBJECT_FLAG_LAST << 8
00249 };
00250
00251 }
00252
00253
00254 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00255 namespace Glib
00256 {
00257
00258 template <>
00259 class Value<Gst::IndexFlags> : public Glib::Value_Enum<Gst::IndexFlags>
00260 {
00261 public:
00262 static GType value_type() G_GNUC_CONST;
00263 };
00264
00265 }
00266 #endif
00267
00268
00269 namespace Gst
00270 {
00271
00272
00275 class IndexEntry
00276 {
00277 public:
00278 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00279 typedef IndexEntry CppObjectType;
00280 typedef GstIndexEntry BaseObjectType;
00281 #endif
00282
00283 IndexEntry();
00284
00285
00286 explicit IndexEntry(GstIndexEntry* castitem, bool make_a_copy = false);
00287
00288 IndexEntry(const IndexEntry& src);
00289 IndexEntry& operator=(const IndexEntry& src);
00290
00291 ~IndexEntry();
00292
00293 GstIndexEntry* gobj() { return gobject_; }
00294 const GstIndexEntry* gobj() const { return gobject_; }
00295
00297 GstIndexEntry* gobj_copy() const;
00298
00299 protected:
00300 GstIndexEntry* gobject_;
00301
00302 private:
00303
00304 public:
00305
00312 bool assoc_map(Format format, gint64& value) const;
00313
00314
00315 };
00316
00319 class IndexGroup
00320 {
00321 public:
00322 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00323 typedef IndexGroup CppObjectType;
00324 typedef GstIndexGroup BaseObjectType;
00325 #endif
00326
00327 private:
00328
00329
00330 };
00331
00334 class IndexAssociation
00335 {
00336 public:
00337 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00338 typedef IndexAssociation CppObjectType;
00339 typedef GstIndexAssociation BaseObjectType;
00340 #endif
00341
00342 private:
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
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
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:
00403 bool is_readable() const;
00404
00408 bool is_writable() const;
00409
00410
00416 void commit(int id);
00417
00421 int get_group() const;
00422
00427 int new_group();
00428
00434 bool set_group(int group_number);
00435
00439 void set_certainty(IndexCertainty certainty);
00440
00444 IndexCertainty set_certainty() const;
00445
00457 bool get_writer_id(const Glib::RefPtr<Gst::Object>& writer, int& id) const;
00458
00466 Gst::IndexEntry add_format(int id, Format format);
00467
00475 Gst::IndexEntry add_association(int id, AssocFlags flags, int n, const Gst::IndexAssociation& list);
00476
00482 Gst::IndexEntry add_id(int id, const Glib::ustring& description);
00483
00484
00485
00495 Gst::IndexEntry get_assoc_entry(int id, IndexLookupMethod method, AssocFlags flags, Format format, gint64 value) const;
00496
00503 typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, Gst::IndexEntry> SlotFilter;
00504
00510 void set_filter(const SlotFilter& slot);
00511
00518 typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, const Glib::RefPtr<Gst::Object>&, Glib::ustring&> SlotResolver;
00519
00524 void set_resolver(const SlotResolver& slot);
00525
00532 Glib::SignalProxy1< void,const Gst::IndexEntry& > signal_entry_added();
00533
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
00556 public:
00557
00558 public:
00559
00560 #ifdef GLIBMM_VFUNCS_ENABLED
00561 #endif //GLIBMM_VFUNCS_ENABLED
00562
00563 protected:
00564
00565 #ifdef GLIBMM_VFUNCS_ENABLED
00566 #endif //GLIBMM_VFUNCS_ENABLED
00567
00568
00569 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00570 virtual void on_entry_added(const Gst::IndexEntry& entry);
00571 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00572
00573
00574 };
00575
00576 }
00577
00578
00579 namespace Glib
00580 {
00581
00590 Gst::IndexEntry wrap(GstIndexEntry* object, bool take_copy = false);
00591
00592 }
00593
00594
00595 namespace Glib
00596 {
00605 Glib::RefPtr<Gst::Index> wrap(GstIndex* object, bool take_copy = false);
00606 }
00607
00608
00609 #endif
00610