1 /* -*- c-basic-offset: 2 -*- 2 * vi:si:et:sw=2:sts=8:ts=8:expandtab 3 * 4 * GStreamer 5 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> 6 * Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk> 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Library General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU Library General Public 19 * License along with this library; if not, write to the 20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 22 */ 23 24 #ifndef __GST_VOLUME_H__ 25 #define __GST_VOLUME_H__ 26 27 #include <gst/gst.h> 28 #include <gst/base/gstbasetransform.h> 29 #include <gst/audio/streamvolume.h> 30 #include <gst/audio/audio.h> 31 #include <gst/audio/gstaudiofilter.h> 32 33 G_BEGIN_DECLS 34 35 #define GST_TYPE_VOLUME \ 36 (gst_volume_get_type()) 37 #define GST_VOLUME(obj) \ 38 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VOLUME,GstVolume)) 39 #define GST_VOLUME_CLASS(klass) \ 40 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VOLUME,GstVolumeClass)) 41 #define GST_IS_VOLUME(obj) \ 42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VOLUME)) 43 #define GST_IS_VOLUME_CLASS(klass) \ 44 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VOLUME)) 45 46 typedef struct _GstVolume GstVolume; 47 typedef struct _GstVolumeClass GstVolumeClass; 48 49 /** 50 * GstVolume: 51 * 52 * Opaque data structure. 53 */ 54 struct _GstVolume { 55 GstAudioFilter element; 56 57 void (*process)(GstVolume*, gpointer, guint); 58 void (*process_controlled)(GstVolume*, gpointer, gdouble *, guint, guint); 59 60 gboolean mute; 61 gfloat volume; 62 63 gboolean current_mute; 64 gdouble current_volume; 65 66 gint current_vol_i32; 67 gint current_vol_i24; /* the _i(nt) values get synchronized with the */ 68 gint current_vol_i16; /* the _i(nt) values get synchronized with the */ 69 gint current_vol_i8; /* the _i(nt) values get synchronized with the */ 70 71 GList *tracklist; 72 gboolean negotiated; 73 74 gboolean *mutes; 75 guint mutes_count; 76 gdouble *volumes; 77 guint volumes_count; 78 }; 79 80 struct _GstVolumeClass { 81 GstAudioFilterClass parent_class; 82 }; 83 84 GType gst_volume_get_type (void); 85 86 G_END_DECLS 87 88 #endif /* __GST_VOLUME_H__ */ 89