| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_STREAMVOLUME_H |
| 3 | #define _GSTREAMERMM_STREAMVOLUME_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2009 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/audio/streamvolume.h> |
| 29 | #include <glibmm/interface.h> |
| 30 | |
| 31 | |
| 32 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 33 | using GstStreamVolume = struct _GstStreamVolume; |
| 34 | using GstStreamVolumeClass = struct _GstStreamVolumeClass; |
| 35 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 36 | |
| 37 | |
| 38 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 39 | namespace Gst |
| 40 | { class StreamVolume_Class; } // namespace Gst |
| 41 | #endif // DOXYGEN_SHOULD_SKIP_THIS |
| 42 | |
| 43 | namespace Gst |
| 44 | { |
| 45 | |
| 46 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 47 | |
| 48 | /** |
| 49 | * @var StreamVolumeFormat STREAM_VOLUME_FORMAT_LINEAR |
| 50 | * Linear scale factor, 1.0 = 100%. |
| 51 | * |
| 52 | * @var StreamVolumeFormat STREAM_VOLUME_FORMAT_CUBIC |
| 53 | * Cubic volume scale. |
| 54 | * |
| 55 | * @var StreamVolumeFormat STREAM_VOLUME_FORMAT_DB |
| 56 | * Logarithmic volume scale (dB, amplitude not power). |
| 57 | * |
| 58 | * @enum StreamVolumeFormat |
| 59 | * |
| 60 | * Different representations of a stream volume. gst_stream_volume_convert_volume() |
| 61 | * allows to convert between the different representations. |
| 62 | * |
| 63 | * Formulas to convert from a linear to a cubic or dB volume are |
| 64 | * cbrt(val) and 20 * log10 (val). |
| 65 | * |
| 66 | * @ingroup gstreamermmEnums |
| 67 | */ |
| 68 | enum StreamVolumeFormat |
| 69 | { |
| 70 | STREAM_VOLUME_FORMAT_LINEAR, |
| 71 | STREAM_VOLUME_FORMAT_CUBIC, |
| 72 | STREAM_VOLUME_FORMAT_DB |
| 73 | }; |
| 74 | |
| 75 | |
| 76 | /** An interface for elements that provide a stream volume. |
| 77 | * @ingroup GstInterfaces |
| 78 | */ |
| 79 | |
| 80 | |
| 81 | class StreamVolume : public Glib::Interface |
| 82 | { |
| 83 | |
| 84 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 85 | |
| 86 | public: |
| 87 | using CppObjectType = StreamVolume; |
| 88 | using CppClassType = StreamVolume_Class; |
| 89 | using BaseObjectType = GstStreamVolume; |
| 90 | using BaseClassType = GstStreamVolumeInterface; |
| 91 | |
| 92 | // noncopyable |
| 93 | StreamVolume(const StreamVolume&) = delete; |
| 94 | StreamVolume& operator=(const StreamVolume&) = delete; |
| 95 | |
| 96 | private: |
| 97 | friend class StreamVolume_Class; |
| 98 | static CppClassType streamvolume_class_; |
| 99 | |
| 100 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 101 | protected: |
| 102 | /** |
| 103 | * You should derive from this class to use it. |
| 104 | */ |
| 105 | StreamVolume(); |
| 106 | |
| 107 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 108 | /** Called by constructors of derived classes. Provide the result of |
| 109 | * the Class init() function to ensure that it is properly |
| 110 | * initialized. |
| 111 | * |
| 112 | * @param interface_class The Class object for the derived type. |
| 113 | */ |
| 114 | explicit StreamVolume(const Glib::Interface_Class& interface_class); |
| 115 | |
| 116 | public: |
| 117 | // This is public so that C++ wrapper instances can be |
| 118 | // created for C instances of unwrapped types. |
| 119 | // For instance, if an unexpected C type implements the C interface. |
| 120 | explicit StreamVolume(GstStreamVolume* castitem); |
| 121 | |
| 122 | protected: |
| 123 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 124 | |
| 125 | public: |
| 126 | |
| 127 | StreamVolume(StreamVolume&& src) noexcept; |
| 128 | StreamVolume& operator=(StreamVolume&& src) noexcept; |
| 129 | |
| 130 | ~StreamVolume() noexcept override; |
| 131 | |
| 132 | static void add_interface(GType gtype_implementer); |
| 133 | |
| 134 | /** Get the GType for this class, for use with the underlying GObject type system. |
| 135 | */ |
| 136 | static GType get_type() G_GNUC_CONST; |
| 137 | |
| 138 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 139 | static GType get_base_type() G_GNUC_CONST; |
| 140 | #endif |
| 141 | |
| 142 | ///Provides access to the underlying C GObject. |
| 143 | GstStreamVolume* gobj() { return reinterpret_cast<GstStreamVolume*>(gobject_); } |
| 144 | |
| 145 | ///Provides access to the underlying C GObject. |
| 146 | const GstStreamVolume* gobj() const { return reinterpret_cast<GstStreamVolume*>(gobject_); } |
| 147 | |
| 148 | private: |
| 149 | |
| 150 | |
| 151 | public: |
| 152 | |
| 153 | /** @param format Gst::StreamVolumeFormat which should be returned. |
| 154 | * @return The current stream volume as linear factor. |
| 155 | */ |
| 156 | double get_volume(Gst::StreamVolumeFormat format); |
| 157 | |
| 158 | /** @param format Gst::StreamVolumeFormat of @a val. |
| 159 | * @param val Linear volume factor that should be set. |
| 160 | */ |
| 161 | void set_volume(Gst::StreamVolumeFormat format, double val); |
| 162 | |
| 163 | /** @return Returns <tt>true</tt> if the stream is muted. |
| 164 | */ |
| 165 | bool get_mute(); |
| 166 | |
| 167 | /** @param mute Mute state that should be set. |
| 168 | */ |
| 169 | void set_mute(bool mute); |
| 170 | |
| 171 | /** @param from Gst::StreamVolumeFormat to convert from. |
| 172 | * @param to Gst::StreamVolumeFormat to convert to. |
| 173 | * @param val Volume in @a from format that should be converted. |
| 174 | * @return The converted volume. |
| 175 | */ |
| 176 | static double convert_volume(Gst::StreamVolumeFormat from, Gst::StreamVolumeFormat to, double val); |
| 177 | |
| 178 | // Properties: |
| 179 | /** Mute the audio channel without changing the volume. |
| 180 | * |
| 181 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 182 | * or receive notification when the value of the property changes. |
| 183 | */ |
| 184 | Glib::PropertyProxy< bool > property_mute() ; |
| 185 | |
| 186 | /** Mute the audio channel without changing the volume. |
| 187 | * |
| 188 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 189 | * or receive notification when the value of the property changes. |
| 190 | */ |
| 191 | Glib::PropertyProxy_ReadOnly< bool > property_mute() const; |
| 192 | |
| 193 | /** Linear volume factor, 1.0=100%. |
| 194 | * |
| 195 | * @return A PropertyProxy that allows you to get or set the value of the property, |
| 196 | * or receive notification when the value of the property changes. |
| 197 | */ |
| 198 | Glib::PropertyProxy< double > property_volume() ; |
| 199 | |
| 200 | /** Linear volume factor, 1.0=100%. |
| 201 | * |
| 202 | * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, |
| 203 | * or receive notification when the value of the property changes. |
| 204 | */ |
| 205 | Glib::PropertyProxy_ReadOnly< double > property_volume() const; |
| 206 | |
| 207 | |
| 208 | public: |
| 209 | |
| 210 | public: |
| 211 | //C++ methods used to invoke GTK+ virtual functions: |
| 212 | |
| 213 | protected: |
| 214 | //GTK+ Virtual Functions (override these to change behaviour): |
| 215 | |
| 216 | //Default Signal Handlers:: |
| 217 | |
| 218 | |
| 219 | }; |
| 220 | |
| 221 | } // namespace Gst |
| 222 | |
| 223 | |
| 224 | namespace Glib |
| 225 | { |
| 226 | /** A Glib::wrap() method for this object. |
| 227 | * |
| 228 | * @param object The C instance. |
| 229 | * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
| 230 | * @result A C++ instance that wraps this C instance. |
| 231 | * |
| 232 | * @relates Gst::StreamVolume |
| 233 | */ |
| 234 | Glib::RefPtr<Gst::StreamVolume> wrap(GstStreamVolume* object, bool take_copy = false); |
| 235 | |
| 236 | } // namespace Glib |
| 237 | |
| 238 | |
| 239 | #endif /* _GSTREAMERMM_STREAMVOLUME_H */ |
| 240 |