Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst-libs / gst / interfaces / streamvolume.h
1 /* GStreamer StreamVolume
2  * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_STREAM_VOLUME_H__
21 #define __GST_STREAM_VOLUME_H__
22
23 #include <gst/gst.h>
24
25 G_BEGIN_DECLS
26
27 #define GST_TYPE_STREAM_VOLUME \
28   (gst_stream_volume_get_type ())
29 #define GST_STREAM_VOLUME(obj) \
30   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_STREAM_VOLUME, GstStreamVolume))
31 #define GST_STREAM_VOLUME_INTERFACE(iface) \
32   (G_TYPE_CHECK_INTERFACE_CAST ((iface), GST_TYPE_STREAM_VOLUME, GstStreamVolumeInterface))
33 #define GST_IS_STREAM_VOLUME(obj) \
34   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_STREAM_VOLUME))
35 #define GST_IS_STREAM_VOLUME_INTERFACE(iface) \
36   (G_TYPE_CHECK_INTERFACE_TYPE ((iface), GST_TYPE_STREAM_VOLUME))
37 #define GST_STREAM_VOLUME_GET_INTERFACE(inst) \
38   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_STREAM_VOLUME, GstStreamVolumeInterface))
39
40 typedef struct _GstStreamVolume GstStreamVolume;
41 typedef struct _GstStreamVolumeInterface GstStreamVolumeInterface;
42
43 struct _GstStreamVolumeInterface {
44   GTypeInterface parent;
45
46   /*< private >*/
47   gpointer _gst_reserved[GST_PADDING];
48 };
49
50 /**
51  * GstStreamVolumeFormat:
52  * @GST_STREAM_VOLUME_FORMAT_LINEAR: Linear scale factor, 1.0 = 100%
53  * @GST_STREAM_VOLUME_FORMAT_CUBIC: Cubic volume scale
54  * @GST_STREAM_VOLUME_FORMAT_DB: Logarithmic volume scale (dB, amplitude not power)
55  *
56  * Different representations of a stream volume. gst_stream_volume_convert()
57  * allows to convert between the different representations.
58  *
59  * Formulas to convert from a linear to a cubic or dB volume are
60  * cbrt(val) and 20 * log10 (val).
61  * 
62  * Since: 0.10.25
63  */
64 typedef enum {
65   GST_STREAM_VOLUME_FORMAT_LINEAR = 0,
66   GST_STREAM_VOLUME_FORMAT_CUBIC,
67   GST_STREAM_VOLUME_FORMAT_DB
68 } GstStreamVolumeFormat;
69
70 GType           gst_stream_volume_get_type        (void);
71 void            gst_stream_volume_set_volume      (GstStreamVolume *volume,
72                                                    GstStreamVolumeFormat format,
73                                                    gdouble val);
74 gdouble         gst_stream_volume_get_volume      (GstStreamVolume *volume,
75                                                    GstStreamVolumeFormat format);
76
77 void            gst_stream_volume_set_mute        (GstStreamVolume *volume,
78                                                    gboolean mute);
79 gboolean        gst_stream_volume_get_mute        (GstStreamVolume *volume);
80
81 gdouble         gst_stream_volume_convert_volume  (GstStreamVolumeFormat from,
82                                                    GstStreamVolumeFormat to,
83                                                    gdouble val) G_GNUC_CONST;
84
85 G_END_DECLS
86
87 #endif /* __GST_STREAM_VOLUME_H__ */