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 #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
00037
00038
00039 namespace Gst
00040 { class Index_Class; }
00041 namespace Gst
00042 {
00043
00049 enum IndexCertainty
00050 {
00051 INDEX_UNKNOWN,
00052 INDEX_CERTAIN,
00053 INDEX_FUZZY
00054 };
00055
00056 }
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 }
00071 #endif
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 }
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 }
00103 #endif
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 }
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 }
00134 #endif
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 }
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 }
00202 #endif
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 }
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 }
00233 #endif
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 }
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 }
00264 #endif
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
00280
00281 IndexEntry();
00282
00283
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
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
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
00382
00383 static GType get_base_type() G_GNUC_CONST;
00384 #endif
00385
00387 GstIndex* gobj() { return reinterpret_cast<GstIndex*>(gobject_); }
00388
00390 const GstIndex* gobj() const { return reinterpret_cast<GstIndex*>(gobject_); }
00391
00393 GstIndex* gobj_copy();
00394
00395 private:
00396
00397
00398 protected:
00399 Index();
00400
00401 public:
00408 typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, Gst::IndexEntry> SlotFilter;
00409
00416 typedef sigc::slot<bool, const Glib::RefPtr<Gst::Index>&, const Glib::RefPtr<Gst::Object>&, Glib::ustring&> SlotResolver;
00417
00421 bool is_readable() const;
00422
00426 bool is_writable() const;
00427
00428
00434 void commit(int id);
00435
00439 int get_group() const;
00440
00445 int new_group();
00446
00452 bool set_group(int group_number);
00453
00457 void set_certainty(IndexCertainty certainty);
00458
00462 IndexCertainty get_certainty() const;
00463
00475 bool get_writer_id(const Glib::RefPtr<Gst::Object>& writer, int& id) const;
00476
00477
00478
00479
00480
00481
00489 Gst::IndexEntry add_format(int id, Format format);
00490
00491
00499 Gst::IndexEntry add_association(int id, AssocFlags flags, int n, const Glib::ArrayHandle<const Gst::IndexAssociation>& list);
00500
00501
00507 Gst::IndexEntry add_id(int id, const Glib::ustring& description);
00508
00519 Gst::IndexEntry get_assoc_entry(int id, gint64 value,
00520 IndexLookupMethod method = Gst::INDEX_LOOKUP_EXACT,
00521 AssocFlags flags = Gst::ASSOCIATION_FLAG_NONE,
00522 Format format = Gst::FORMAT_DEFAULT) const;
00523
00529 void set_filter(const SlotFilter& slot);
00530
00535 void set_resolver(const SlotResolver& slot);
00536
00537 #ifdef GLIBMM_PROPERTIES_ENABLED
00538
00544 Glib::PropertyProxy<Gst::Index::SlotResolver> property_resolver() ;
00545 #endif //#GLIBMM_PROPERTIES_ENABLED
00546
00547 #ifdef GLIBMM_PROPERTIES_ENABLED
00548
00554 Glib::PropertyProxy_ReadOnly<Gst::Index::SlotResolver> property_resolver() const;
00555 #endif //#GLIBMM_PROPERTIES_ENABLED
00556
00557
00564 Glib::SignalProxy1< void,const Gst::IndexEntry& > signal_entry_added();
00565
00566
00567 #ifdef GLIBMM_VFUNCS_ENABLED
00568 virtual bool get_writer_id_vfunc(int& writer_id, const Glib::ustring& writer_string) const;
00569 #endif //GLIBMM_VFUNCS_ENABLED
00570
00571
00572 #ifdef GLIBMM_VFUNCS_ENABLED
00573 virtual void commit_vfunc(gint id);
00574 #endif //GLIBMM_VFUNCS_ENABLED
00575
00576
00577 #ifdef GLIBMM_VFUNCS_ENABLED
00578 virtual void add_entry_vfunc(Gst::IndexEntry& entry);
00579 #endif //GLIBMM_VFUNCS_ENABLED
00580
00581
00582
00583
00584
00585 protected:
00586
00587
00588 public:
00589
00590 public:
00591
00592 #ifdef GLIBMM_VFUNCS_ENABLED
00593 #endif //GLIBMM_VFUNCS_ENABLED
00594
00595 protected:
00596
00597 #ifdef GLIBMM_VFUNCS_ENABLED
00598 #endif //GLIBMM_VFUNCS_ENABLED
00599
00600
00601 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00602 virtual void on_entry_added(const Gst::IndexEntry& entry);
00603 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00604
00605
00606 };
00607
00608 }
00609
00610
00611 namespace Glib
00612 {
00613
00622 Gst::IndexEntry wrap(GstIndexEntry* object, bool take_copy = false);
00623
00624 }
00625
00626
00627 namespace Glib
00628 {
00637 Glib::RefPtr<Gst::Index> wrap(GstIndex* object, bool take_copy = false);
00638 }
00639
00640
00641 #endif
00642