1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gststreamvolume</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-interfaces.html" title="Interfaces Library">
9 <link rel="prev" href="gst-plugins-base-libs-gstpropertyprobe.html" title="gstpropertyprobe">
10 <link rel="next" href="gst-plugins-base-libs-gsttuner.html" title="gsttuner">
11 <meta name="generator" content="GTK-Doc V1.17 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstpropertyprobe.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-interfaces.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-base-libs-gsttuner.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gststreamvolume.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gststreamvolume.description" class="shortcut">Description</a>
28 <a href="#gst-plugins-base-libs-gststreamvolume.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#gst-plugins-base-libs-gststreamvolume.prerequisites" class="shortcut">Prerequisites</a>
32 <a href="#gst-plugins-base-libs-gststreamvolume.properties" class="shortcut">Properties</a>
35 <div class="refentry">
36 <a name="gst-plugins-base-libs-gststreamvolume"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
39 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gststreamvolume.top_of_page"></a>gststreamvolume</span></h2>
40 <p>gststreamvolume — Interface for elements that provide a stream volume</p>
42 <td valign="top" align="right"></td>
44 <div class="refsynopsisdiv">
45 <a name="gst-plugins-base-libs-gststreamvolume.synopsis"></a><h2>Synopsis</h2>
46 <a name="GstStreamVolume"></a><pre class="synopsis">
47 #include <gst/interfaces/streamvolume.h>
49 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume-struct" title="GstStreamVolume">GstStreamVolume</a>;
50 enum <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat">GstStreamVolumeFormat</a>;
51 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-get-volume" title="gst_stream_volume_get_volume ()">gst_stream_volume_get_volume</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
52 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>);
53 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-set-volume" title="gst_stream_volume_set_volume ()">gst_stream_volume_set_volume</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
54 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>,
55 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);
56 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-get-mute" title="gst_stream_volume_get_mute ()">gst_stream_volume_get_mute</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>);
57 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-set-mute" title="gst_stream_volume_set_mute ()">gst_stream_volume_set_mute</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
58 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> mute</code></em>);
59 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-convert-volume" title="gst_stream_volume_convert_volume ()">gst_stream_volume_convert_volume</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> from</code></em>,
60 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to</code></em>,
61 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);
64 <div class="refsect1">
65 <a name="gst-plugins-base-libs-gststreamvolume.object-hierarchy"></a><h2>Object Hierarchy</h2>
66 <pre class="synopsis">
71 <div class="refsect1">
72 <a name="gst-plugins-base-libs-gststreamvolume.prerequisites"></a><h2>Prerequisites</h2>
74 GstStreamVolume requires
75 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
77 <div class="refsect1">
78 <a name="gst-plugins-base-libs-gststreamvolume.properties"></a><h2>Properties</h2>
79 <pre class="synopsis">
80 "<a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume--mute" title='The "mute" property'>mute</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
81 "<a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume--volume" title='The "volume" property'>volume</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> : Read / Write
84 <div class="refsect1">
85 <a name="gst-plugins-base-libs-gststreamvolume.description"></a><h2>Description</h2>
88 <div class="refsect2">
89 <a name="idp13350128"></a><p>
90 This interface is implemented by elements that provide a stream volume. Examples for
91 such elements are <span class="type">volume</span> and <span class="type">playbin2</span>.
94 Applications can use this interface to get or set the current stream volume. For this
95 the "volume" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> property can be used or the helper functions <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-set-volume" title="gst_stream_volume_set_volume ()"><code class="function">gst_stream_volume_set_volume()</code></a>
96 and <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-get-volume" title="gst_stream_volume_get_volume ()"><code class="function">gst_stream_volume_get_volume()</code></a>. This volume is always a linear factor, i.e. 0.0 is muted
97 1.0 is 100%. For showing the volume in a GUI it might make sense to convert it to
98 a different format by using <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-convert-volume" title="gst_stream_volume_convert_volume ()"><code class="function">gst_stream_volume_convert_volume()</code></a>. Volume sliders should usually
102 Separate from the volume the stream can also be muted by the "mute" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> property or
103 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-set-mute" title="gst_stream_volume_set_mute ()"><code class="function">gst_stream_volume_set_mute()</code></a> and <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#gst-stream-volume-get-mute" title="gst_stream_volume_get_mute ()"><code class="function">gst_stream_volume_get_mute()</code></a>.
106 Elements that provide some kind of stream volume should implement the "volume" and
107 "mute" <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> properties and handle setting and getting of them properly.
108 The volume property is defined to be a linear volume factor.
114 <div class="refsect1">
115 <a name="gst-plugins-base-libs-gststreamvolume.details"></a><h2>Details</h2>
116 <div class="refsect2">
117 <a name="GstStreamVolume-struct"></a><h3>GstStreamVolume</h3>
118 <pre class="programlisting">typedef struct _GstStreamVolume GstStreamVolume;</pre>
121 <div class="refsect2">
122 <a name="GstStreamVolumeFormat"></a><h3>enum GstStreamVolumeFormat</h3>
123 <pre class="programlisting">typedef enum {
124 GST_STREAM_VOLUME_FORMAT_LINEAR = 0,
125 GST_STREAM_VOLUME_FORMAT_CUBIC,
126 GST_STREAM_VOLUME_FORMAT_DB
127 } GstStreamVolumeFormat;
130 Different representations of a stream volume. <code class="function">gst_stream_volume_convert()</code>
131 allows to convert between the different representations.
134 Formulas to convert from a linear to a cubic or dB volume are
135 cbrt(val) and 20 * log10 (val).
137 <div class="variablelist"><table border="0">
138 <col align="left" valign="top">
141 <td><p><a name="GST-STREAM-VOLUME-FORMAT-LINEAR:CAPS"></a><span class="term"><code class="literal">GST_STREAM_VOLUME_FORMAT_LINEAR</code></span></p></td>
142 <td>Linear scale factor, 1.0 = 100%
146 <td><p><a name="GST-STREAM-VOLUME-FORMAT-CUBIC:CAPS"></a><span class="term"><code class="literal">GST_STREAM_VOLUME_FORMAT_CUBIC</code></span></p></td>
147 <td>Cubic volume scale
151 <td><p><a name="GST-STREAM-VOLUME-FORMAT-DB:CAPS"></a><span class="term"><code class="literal">GST_STREAM_VOLUME_FORMAT_DB</code></span></p></td>
152 <td>Logarithmic volume scale (dB, amplitude not power)
157 <p class="since">Since 0.10.25</p>
160 <div class="refsect2">
161 <a name="gst-stream-volume-get-volume"></a><h3>gst_stream_volume_get_volume ()</h3>
162 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> gst_stream_volume_get_volume (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
163 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>);</pre>
164 <div class="variablelist"><table border="0">
165 <col align="left" valign="top">
168 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
170 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
173 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
175 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> which should be returned</td>
178 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
179 <td>The current stream volume as linear factor</td>
183 <p class="since">Since 0.10.25</p>
186 <div class="refsect2">
187 <a name="gst-stream-volume-set-volume"></a><h3>gst_stream_volume_set_volume ()</h3>
188 <pre class="programlisting"><span class="returnvalue">void</span> gst_stream_volume_set_volume (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
189 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>,
190 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);</pre>
191 <div class="variablelist"><table border="0">
192 <col align="left" valign="top">
195 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
197 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
200 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
202 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> of <em class="parameter"><code>val</code></em>
206 <td><p><span class="term"><em class="parameter"><code>val</code></em> :</span></p></td>
207 <td>Linear volume factor that should be set</td>
211 <p class="since">Since 0.10.25</p>
214 <div class="refsect2">
215 <a name="gst-stream-volume-get-mute"></a><h3>gst_stream_volume_get_mute ()</h3>
216 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_stream_volume_get_mute (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>);</pre>
217 <div class="variablelist"><table border="0">
218 <col align="left" valign="top">
221 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
223 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
226 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
227 <td>Returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the stream is muted</td>
231 <p class="since">Since 0.10.25</p>
234 <div class="refsect2">
235 <a name="gst-stream-volume-set-mute"></a><h3>gst_stream_volume_set_mute ()</h3>
236 <pre class="programlisting"><span class="returnvalue">void</span> gst_stream_volume_set_mute (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>,
237 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> mute</code></em>);</pre>
238 <div class="variablelist"><table border="0">
239 <col align="left" valign="top">
242 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
244 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
247 <td><p><span class="term"><em class="parameter"><code>mute</code></em> :</span></p></td>
248 <td>Mute state that should be set</td>
252 <p class="since">Since 0.10.25</p>
255 <div class="refsect2">
256 <a name="gst-stream-volume-convert-volume"></a><h3>gst_stream_volume_convert_volume ()</h3>
257 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> gst_stream_volume_convert_volume (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> from</code></em>,
258 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to</code></em>,
259 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);</pre>
260 <div class="variablelist"><table border="0">
261 <col align="left" valign="top">
264 <td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
266 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to convert from</td>
269 <td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
271 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to convert to</td>
274 <td><p><span class="term"><em class="parameter"><code>val</code></em> :</span></p></td>
275 <td>Volume in <em class="parameter"><code>from</code></em> format that should be converted</td>
278 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
279 <td>the converted volume</td>
283 <p class="since">Since 0.10.25</p>
286 <div class="refsect1">
287 <a name="gst-plugins-base-libs-gststreamvolume.property-details"></a><h2>Property Details</h2>
288 <div class="refsect2">
289 <a name="GstStreamVolume--mute"></a><h3>The <code class="literal">"mute"</code> property</h3>
290 <pre class="programlisting"> "mute" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
291 <p>Mute the audio channel without changing the volume.</p>
292 <p>Default value: FALSE</p>
295 <div class="refsect2">
296 <a name="GstStreamVolume--volume"></a><h3>The <code class="literal">"volume"</code> property</h3>
297 <pre class="programlisting"> "volume" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> : Read / Write</pre>
298 <p>Linear volume factor, 1.0=100%.</p>
299 <p>Allowed values: >= 0</p>
300 <p>Default value: 1</p>
306 Generated by GTK-Doc V1.17</div>