QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
streamvolume.cpp
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "streamvolume.h"
18 #include <gst/audio/streamvolume.h>
19 
20 namespace QGst {
21 
22 double StreamVolume::volume(StreamVolumeFormat format) const
23 {
24  return gst_stream_volume_get_volume(object<GstStreamVolume>(),
25  static_cast<GstStreamVolumeFormat>(format));
26 }
27 
28 void StreamVolume::setVolume(double value, StreamVolumeFormat format)
29 {
30  gst_stream_volume_set_volume(object<GstStreamVolume>(),
31  static_cast<GstStreamVolumeFormat>(format), value);
32 }
33 
34 bool StreamVolume::isMuted() const
35 {
36  return gst_stream_volume_get_mute(object<GstStreamVolume>());
37 }
38 
39 void StreamVolume::setMuted(bool muted)
40 {
41  gst_stream_volume_set_mute(object<GstStreamVolume>(), muted);
42 }
43 
44 double StreamVolume::convert(StreamVolumeFormat from, StreamVolumeFormat to, double value)
45 {
46  return gst_stream_volume_convert_volume(static_cast<GstStreamVolumeFormat>(from),
47  static_cast<GstStreamVolumeFormat>(to), value);
48 }
49 
50 } //namespace QGst