- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List

# structure.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_STRUCTURE_H
    00004 #define _GSTREAMERMM_STRUCTURE_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 <gstreamermm/clock.h>
    00029 #include <gstreamermm/enums.h>
    00030 #include <gstreamermm/value.h>
    00031
    00032
    00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00034 extern "C" { typedef struct _GstStructure GstStructure; }
    00035 #endif
    00036
    00037 namespace Gst
    00038 {
    00039
    00055 class Structure
    00056 {
    00057  public:
    00058 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00059   typedef Structure CppObjectType;
    00060   typedef GstStructure BaseObjectType;
    00061
    00062   static GType get_type() G_GNUC_CONST;
    00063 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00064
    00065   Structure();
    00066
    00067   explicit Structure(GstStructure* gobject, bool make_a_copy = true);
    00068
    00069   Structure(const Structure& other);
    00070   Structure& operator=(const Structure& other);
    00071
    00072   ~Structure();
    00073
    00074   void swap(Structure& other);
    00075
    00077   GstStructure*       gobj()       { return gobject_; }
    00078
    00080   const GstStructure* gobj() const { return gobject_; }
    00081
    00083   GstStructure* gobj_copy() const;
    00084
    00085 protected:
    00086   GstStructure* gobject_;
    00087
    00088 private:
    00089
    00090
    00091 public:
    00095   explicit Structure(const Glib::ustring& name);
    00096
    00103   static Structure create_from_string(const Glib::ustring& the_string);
    00104
    00105
    00108   operator bool() const;
    00109
    00110
    00114   Glib::ustring get_name() const;
    00115
    00120   bool has_name(const Glib::ustring& name) const;
    00121
    00127   void set_name(const Glib::ustring& name);
    00128
    00132   Glib::QueryQuark get_name_id() const;
    00133
    00139   void get_field(const Glib::ustring& fieldname, Glib::ValueBase& value) const;
    00140
    00141
    00154   void set_field(const Glib::ustring& fieldname, const Glib::ValueBase& value);
    00155
    00156
    00164   void set_field(const Glib::ustring& fieldname, bool value);
    00165
    00173   void set_field(const Glib::ustring& fieldname, int value);
    00174
    00182   void set_field(const Glib::ustring& fieldname, guint value);
    00183
    00195   void set_field(const Glib::ustring& fieldname, const Fourcc& value);
    00196
    00204   void set_field(const Glib::ustring& fieldname, double value);
    00205
    00206   //We use std::string, because the encoding is unknown. murrayc
    00214   void set_field(const Glib::ustring& fieldname, const std::string& value);
    00215
    00223   void set_field(const Glib::ustring& fieldname, const char* value);
    00224
    00235   void set_field(const Glib::ustring& fieldname, const Glib::Date& value);
    00236
    00244   void set_field(const Glib::ustring& fieldname, const ClockTime& value);
    00245
    00262   void set_field(const Glib::ustring& fieldname, GType enumtype, int value);
    00263
    00274   void set_field(const Glib::ustring& fieldname, const Gst::Fraction& value);
    00275
    00287   void set_field(const Glib::ustring& fieldname, const Gst::IntRange& value);
    00288
    00300   void set_field(const Glib::ustring& fieldname, const Gst::DoubleRange& value);
    00301
    00313   void set_field(const Glib::ustring& fieldname, const Gst::FractionRange& value);
    00314
    00315
    00316 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00317   //Only for use inside gstreamermm:
    00318   static void _set_gstructure_field(GstStructure* cstructure, const Glib::ustring& fieldname, const Glib::ValueBase& value);
    00319 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00320
    00326   void remove_field(const Glib::ustring& fieldname);
    00327
    00328
    00331   void remove_all_fields();
    00332
    00339   GType get_field_type(const Glib::ustring& fieldname) const;
    00340
    00341   //TODO: Remove any use of Quarks from the API, using plain strings instead? They seem like implementation detail. murrayc.
    00342
    00348   typedef sigc::slot<bool, const Glib::QueryQuark&, const Glib::ValueBase&> SlotForeach;
    00349
    00357   bool foreach(const SlotForeach& slot);
    00358
    00359
    00363   int size() const;
    00364
    00369   bool has_field(const Glib::ustring& fieldname) const;
    00370
    00376   bool has_field(const Glib::ustring& fieldname, GType type) const;
    00377
    00388   bool get_field(const Glib::ustring& fieldname, bool& value) const;
    00389
    00390
    00401   bool get_field(const Glib::ustring& fieldname, int& value) const;
    00402
    00403
    00414   bool get_field(const Glib::ustring& fieldname, guint& value) const;
    00415
    00416
    00427   bool get_field(const Glib::ustring& fieldname, Fourcc& value) const;
    00428
    00429
    00440   bool get_field(const Glib::ustring& fieldname, double& value) const;
    00441
    00442
    00453   bool get_field(const Glib::ustring& fieldname, Glib::ustring& value) const;
    00454
    00465   bool get_field(const Glib::ustring& fieldname, std::string& value) const;
    00466
    00467
    00478   bool get_field(const Glib::ustring& fieldname, Glib::Date& value) const;
    00479
    00480
    00491   bool get_field(const Glib::ustring& fieldname, ClockTime& value) const;
    00492
    00493
    00513   bool get_field(const Glib::ustring& fieldname, GType enumtype, int& value) const;
    00514
    00515
    00526   bool get_field(const Glib::ustring& fieldname, Gst::Fraction& value) const;
    00527
    00528
    00539   bool get_field(const Glib::ustring& fieldname, Gst::IntRange& value) const;
    00540
    00551   bool get_field(const Glib::ustring& fieldname, Gst::DoubleRange& value) const;
    00552
    00563   bool get_field(const Glib::ustring& fieldname, Gst::FractionRange& value) const;
    00564
    00570   typedef sigc::slot<bool, const Glib::QueryQuark&, Glib::ValueBase&> SlotMap;
    00571
    00580   bool map_in_place(const SlotMap& slot);
    00581
    00582
    00587   Glib::ustring get_nth_field_name(guint index) const;
    00588
    00599   Glib::ustring to_string() const;
    00600
    00607   bool fixate_field_nearest_int(const Glib::ustring& name, int target);
    00608
    00615   bool fixate_field_nearest_double(const Glib::ustring& name, double target);
    00616
    00624   bool fixate_nearest_fraction(const Glib::ustring& name, const Gst::Fraction& target);
    00625
    00626
    00633   bool fixate_field_boolean(const Glib::ustring& name, bool target);
    00634
    00635   //Variable argument functions are ignored.
    00636
    00637
    00638 };
    00639
    00640 } //namespace Gst
    00641
    00642
    00643 namespace Gst
    00644 {
    00645
    00650 inline void swap(Structure& lhs, Structure& rhs)
    00651   { lhs.swap(rhs); }
    00652
    00653 } // namespace Gst
    00654
    00655 namespace Glib
    00656 {
    00657
    00666 Gst::Structure wrap(GstStructure* object, bool take_copy = false);
    00667
    00668 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00669 template <>
    00670 class Value<Gst::Structure> : public Glib::Value_Boxed<Gst::Structure>
    00671 {};
    00672 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00673
    00674 } // namespace Glib
    00675
    00676
    00677 #endif /* _GSTREAMERMM_STRUCTURE_H */
    00678