tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.git] / docs / libs / html / gst-plugins-base-libs-gststreamvolume.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
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.76.1">
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.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
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">
16 <tr valign="middle">
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>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gststreamvolume.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-base-libs-gststreamvolume.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#gst-plugins-base-libs-gststreamvolume.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#gst-plugins-base-libs-gststreamvolume.prerequisites" class="shortcut">Prerequisites</a>
31                    | 
32                   <a href="#gst-plugins-base-libs-gststreamvolume.properties" class="shortcut">Properties</a>
33 </td></tr>
34 </table>
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>
38 <td valign="top">
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>
41 </td>
42 <td valign="top" align="right"></td>
43 </tr></table></div>
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 &lt;gst/interfaces/streamvolume.h&gt;
48
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>);
62 </pre>
63 </div>
64 <div class="refsect1">
65 <a name="gst-plugins-base-libs-gststreamvolume.object-hierarchy"></a><h2>Object Hierarchy</h2>
66 <pre class="synopsis">
67   GInterface
68    +----GstStreamVolume
69 </pre>
70 </div>
71 <div class="refsect1">
72 <a name="gst-plugins-base-libs-gststreamvolume.prerequisites"></a><h2>Prerequisites</h2>
73 <p>
74 GstStreamVolume requires
75  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
76 </div>
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
82 </pre>
83 </div>
84 <div class="refsect1">
85 <a name="gst-plugins-base-libs-gststreamvolume.description"></a><h2>Description</h2>
86 <p>
87 </p>
88 <div class="refsect2">
89 <a name="idp15191264"></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>.
92 </p>
93 <p>
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
99 use a cubic volume.
100 </p>
101 <p>
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>.
104 </p>
105 <p>
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.
109 </p>
110 </div>
111 <p>
112 </p>
113 </div>
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>
119 </div>
120 <hr>
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;
128 </pre>
129 <p>
130 Different representations of a stream volume. <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>
131 allows to convert between the different representations.
132 </p>
133 <p>
134 Formulas to convert from a linear to a cubic or dB volume are
135 cbrt(val) and 20 * log10 (val).
136 </p>
137 <div class="variablelist"><table border="0">
138 <col align="left" valign="top">
139 <tbody>
140 <tr>
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%
143 </td>
144 </tr>
145 <tr>
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
148 </td>
149 </tr>
150 <tr>
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)
153 </td>
154 </tr>
155 </tbody>
156 </table></div>
157 <p class="since">Since 0.10.25</p>
158 </div>
159 <hr>
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">
166 <tbody>
167 <tr>
168 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
169 <td>
170 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
171 </tr>
172 <tr>
173 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
174 <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>
176 </tr>
177 <tr>
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>
180 </tr>
181 </tbody>
182 </table></div>
183 <p class="since">Since 0.10.25</p>
184 </div>
185 <hr>
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">
193 <tbody>
194 <tr>
195 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
196 <td>
197 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
198 </tr>
199 <tr>
200 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
201 <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>
203 </td>
204 </tr>
205 <tr>
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>
208 </tr>
209 </tbody>
210 </table></div>
211 <p class="since">Since 0.10.25</p>
212 </div>
213 <hr>
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">
219 <tbody>
220 <tr>
221 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
222 <td>
223 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
224 </tr>
225 <tr>
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>
228 </tr>
229 </tbody>
230 </table></div>
231 <p class="since">Since 0.10.25</p>
232 </div>
233 <hr>
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">
240 <tbody>
241 <tr>
242 <td><p><span class="term"><em class="parameter"><code>volume</code></em> :</span></p></td>
243 <td>
244 <a class="link" href="gst-plugins-base-libs-gststreamvolume.html#GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</td>
245 </tr>
246 <tr>
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>
249 </tr>
250 </tbody>
251 </table></div>
252 <p class="since">Since 0.10.25</p>
253 </div>
254 <hr>
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">
262 <tbody>
263 <tr>
264 <td><p><span class="term"><em class="parameter"><code>from</code></em> :</span></p></td>
265 <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>
267 </tr>
268 <tr>
269 <td><p><span class="term"><em class="parameter"><code>to</code></em> :</span></p></td>
270 <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>
272 </tr>
273 <tr>
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>
276 </tr>
277 <tr>
278 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
279 <td>the converted volume</td>
280 </tr>
281 </tbody>
282 </table></div>
283 <p class="since">Since 0.10.25</p>
284 </div>
285 </div>
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>
293 </div>
294 <hr>
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: &gt;= 0</p>
300 <p>Default value: 1</p>
301 </div>
302 </div>
303 </div>
304 <div class="footer">
305 <hr>
306           Generated by GTK-Doc V1.18</div>
307 </body>
308 </html>