| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_PRESET_H |
| 3 | #define _GSTREAMERMM_PRESET_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2008-2016 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gst/gst.h> |
| 29 | #include <glibmm/arrayhandle.h> |
| 30 | #include <glibmm/interface.h> |
| 31 | |
| 32 | |
| 33 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 34 | using GstPreset = struct _GstPreset; |
| 35 | using GstPresetClass = struct _GstPresetClass; |
| 36 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 37 | |
| 38 | |
| 39 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 40 | namespace Gst |
| 41 | { class Preset_Class; } // namespace Gst |
| 42 | #endif // DOXYGEN_SHOULD_SKIP_THIS |
| 43 | |
| 44 | namespace Gst |
| 45 | { |
| 46 | |
| 47 | /** A helper interface for element presets. |
| 48 | * This interface offers methods to query and manipulate parameter preset sets. |
| 49 | * A preset is a bunch of property settings, together with meta data and a |
| 50 | * name. The name of a preset serves as key for subsequent method calls to |
| 51 | * manipulate single presets. All instances of one type will share the list of |
| 52 | * presets. The list is created on demand, if presets are not used, the list is |
| 53 | * not created. |
| 54 | * |
| 55 | * The interface comes with a default implementation that serves most plugins. |
| 56 | * Wrapper plugins will override most methods to implement support for the |
| 57 | * native preset format of those wrapped plugins. One method that is useful to |
| 58 | * be overridden is property_names_vfunc(). With that, one can control which |
| 59 | * properties are saved and in which order. |
| 60 | * |
| 61 | * Last reviewed on 2016-06-06 (1.8.0) |
| 62 | * @ingroup GstInterfaces |
| 63 | */ |
| 64 | |
| 65 | class Preset : public Glib::Interface |
| 66 | { |
| 67 | |
| 68 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 69 | |
| 70 | public: |
| 71 | using CppObjectType = Preset; |
| 72 | using CppClassType = Preset_Class; |
| 73 | using BaseObjectType = GstPreset; |
| 74 | using BaseClassType = GstPresetInterface; |
| 75 | |
| 76 | // noncopyable |
| 77 | Preset(const Preset&) = delete; |
| 78 | Preset& operator=(const Preset&) = delete; |
| 79 | |
| 80 | private: |
| 81 | friend class Preset_Class; |
| 82 | static CppClassType preset_class_; |
| 83 | |
| 84 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 85 | protected: |
| 86 | /** |
| 87 | * You should derive from this class to use it. |
| 88 | */ |
| 89 | Preset(); |
| 90 | |
| 91 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 92 | /** Called by constructors of derived classes. Provide the result of |
| 93 | * the Class init() function to ensure that it is properly |
| 94 | * initialized. |
| 95 | * |
| 96 | * @param interface_class The Class object for the derived type. |
| 97 | */ |
| 98 | explicit Preset(const Glib::Interface_Class& interface_class); |
| 99 | |
| 100 | public: |
| 101 | // This is public so that C++ wrapper instances can be |
| 102 | // created for C instances of unwrapped types. |
| 103 | // For instance, if an unexpected C type implements the C interface. |
| 104 | explicit Preset(GstPreset* castitem); |
| 105 | |
| 106 | protected: |
| 107 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 108 | |
| 109 | public: |
| 110 | |
| 111 | Preset(Preset&& src) noexcept; |
| 112 | Preset& operator=(Preset&& src) noexcept; |
| 113 | |
| 114 | ~Preset() noexcept override; |
| 115 | |
| 116 | static void add_interface(GType gtype_implementer); |
| 117 | |
| 118 | /** Get the GType for this class, for use with the underlying GObject type system. |
| 119 | */ |
| 120 | static GType get_type() G_GNUC_CONST; |
| 121 | |
| 122 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 123 | static GType get_base_type() G_GNUC_CONST; |
| 124 | #endif |
| 125 | |
| 126 | ///Provides access to the underlying C GObject. |
| 127 | GstPreset* gobj() { return reinterpret_cast<GstPreset*>(gobject_); } |
| 128 | |
| 129 | ///Provides access to the underlying C GObject. |
| 130 | const GstPreset* gobj() const { return reinterpret_cast<GstPreset*>(gobject_); } |
| 131 | |
| 132 | private: |
| 133 | |
| 134 | |
| 135 | public: |
| 136 | |
| 137 | |
| 138 | /** Get a copy of preset names as a <tt>nullptr</tt> terminated string array. |
| 139 | * |
| 140 | * @return List with names. |
| 141 | */ |
| 142 | Glib::StringArrayHandle get_preset_names() const; |
| 143 | |
| 144 | /** Get a the names of the GObject properties that can be used for presets. |
| 145 | * |
| 146 | * @return An |
| 147 | * array of property names which should be freed with Glib::strfreev() after use. |
| 148 | */ |
| 149 | Glib::StringArrayHandle get_property_names() const; |
| 150 | |
| 151 | /** Load the given preset. |
| 152 | * |
| 153 | * @param name Preset name to load. |
| 154 | * @return <tt>true</tt> for success, <tt>false</tt> if e.g. there is no preset with that @a name. |
| 155 | */ |
| 156 | bool load_preset(const Glib::ustring& name); |
| 157 | |
| 158 | /** Save the current object settings as a preset under the given name. If there |
| 159 | * is already a preset by this @a name it will be overwritten. |
| 160 | * |
| 161 | * @param name Preset name to save. |
| 162 | * @return <tt>true</tt> for success, <tt>false</tt>. |
| 163 | */ |
| 164 | bool save_preset(const Glib::ustring& name); |
| 165 | |
| 166 | /** Renames a preset. If there is already a preset by the @a new_name it will be |
| 167 | * overwritten. |
| 168 | * |
| 169 | * @param old_name Current preset name. |
| 170 | * @param new_name New preset name. |
| 171 | * @return <tt>true</tt> for success, <tt>false</tt> if e.g. there is no preset with @a old_name. |
| 172 | */ |
| 173 | bool rename_preset(const Glib::ustring& old_name, const Glib::ustring& new_name); |
| 174 | |
| 175 | /** Delete the given preset. |
| 176 | * |
| 177 | * @param name Preset name to remove. |
| 178 | * @return <tt>true</tt> for success, <tt>false</tt> if e.g. there is no preset with that @a name. |
| 179 | */ |
| 180 | bool delete_preset(const Glib::ustring& name); |
| 181 | |
| 182 | /** Sets a new @a value for an existing meta data item or adds a new item. Meta |
| 183 | * data @a tag names can be something like e.g. "comment". Supplying <tt>nullptr</tt> for the |
| 184 | * @a value will unset an existing value. |
| 185 | * |
| 186 | * @param name Preset name. |
| 187 | * @param tag Meta data item name. |
| 188 | * @param value New value. |
| 189 | * @return <tt>true</tt> for success, <tt>false</tt> if e.g. there is no preset with that @a name. |
| 190 | */ |
| 191 | bool set_meta(const Glib::ustring& name, const Glib::ustring& tag, const Glib::ustring& value); |
| 192 | |
| 193 | /** Check if one can add new presets, change existing ones and remove presets. |
| 194 | * |
| 195 | * @return <tt>true</tt> if presets are editable or <tt>false</tt> if they are static. |
| 196 | */ |
| 197 | bool is_editable() const; |
| 198 | |
| 199 | |
| 200 | /** Gets the @a value for an existing meta data @a tag. Meta data @a tag names can be |
| 201 | * something like e.g. "comment". Returned values need to be released when done. |
| 202 | * |
| 203 | * @param name Preset name. |
| 204 | * @param tag Meta data item name. |
| 205 | * @param value Value. |
| 206 | * @return <tt>true</tt> for success, <tt>false</tt> if e.g. there is no preset with that @a name |
| 207 | * or no value for the given @a tag. |
| 208 | */ |
| 209 | |
| 210 | bool get_meta(const Glib::ustring& name, const Glib::ustring& tag, Glib::ustring& value) const; |
| 211 | |
| 212 | |
| 213 | virtual Glib::StringArrayHandle get_preset_names_vfunc() const; |
| 214 | virtual Glib::StringArrayHandle get_property_names_vfunc() const; |
| 215 | |
| 216 | virtual bool load_preset_vfunc(const Glib::ustring& name); |
| 217 | |
| 218 | virtual bool save_preset_vfunc(const Glib::ustring& name) const; |
| 219 | |
| 220 | virtual bool rename_preset_vfunc(const Glib::ustring& old_name, const Glib::ustring& new_name); |
| 221 | |
| 222 | virtual bool delete_preset_vfunc(const Glib::ustring& name); |
| 223 | |
| 224 | virtual bool set_meta_vfunc(const Glib::ustring& name, const Glib::ustring& tag, const Glib::ustring& value); |
| 225 | |
| 226 | |
| 227 | virtual bool get_meta_vfunc(const Glib::ustring& name, |
| 228 | const Glib::ustring& tag, Glib::ustring& value) const; |
| 229 | |
| 230 | protected: |
| 231 | |
| 232 | |
| 233 | public: |
| 234 | |
| 235 | public: |
| 236 | //C++ methods used to invoke GTK+ virtual functions: |
| 237 | |
| 238 | protected: |
| 239 | //GTK+ Virtual Functions (override these to change behaviour): |
| 240 | |
| 241 | //Default Signal Handlers:: |
| 242 | |
| 243 | |
| 244 | }; |
| 245 | |
| 246 | } // namespace Gst |
| 247 | |
| 248 | |
| 249 | namespace Glib |
| 250 | { |
| 251 | /** A Glib::wrap() method for this object. |
| 252 | * |
| 253 | * @param object The C instance. |
| 254 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 255 | * @result A C++ instance that wraps this C instance. |
| 256 | * |
| 257 | * @relates Gst::Preset |
| 258 | */ |
| 259 | Glib::RefPtr<Gst::Preset> wrap(GstPreset* object, bool take_copy = false); |
| 260 | |
| 261 | } // namespace Glib |
| 262 | |
| 263 | |
| 264 | #endif /* _GSTREAMERMM_PRESET_H */ |
| 265 |