2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * mixer.h: mixer interface design
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __GST_MIXER_H__
23 #define __GST_MIXER_H__
26 #include <gst/interfaces/mixeroptions.h>
27 #include <gst/interfaces/mixertrack.h>
28 #include <gst/interfaces/interfaces-enumtypes.h>
32 #define GST_TYPE_MIXER \
33 (gst_mixer_get_type ())
34 #define GST_MIXER(obj) \
35 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER, GstMixer))
36 #define GST_MIXER_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER, GstMixerClass))
38 #define GST_IS_MIXER(obj) \
39 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER))
40 #define GST_IS_MIXER_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER))
42 #define GST_MIXER_GET_CLASS(inst) \
43 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
45 #define GST_MIXER_TYPE(klass) (klass->mixer_type)
47 typedef struct _GstMixer GstMixer;
48 typedef struct _GstMixerClass GstMixerClass;
52 * @GST_MIXER_HARDWARE: mixing is implemented with dedicated hardware.
53 * @GST_MIXER_SOFTWARE: mixing is implemented via software processing.
55 * Mixer classification.
64 * GstMixerMessageType:
65 * @GST_MIXER_MESSAGE_INVALID: Not a GstMixer message
66 * @GST_MIXER_MESSAGE_MUTE_TOGGLED: A mute-toggled GstMixer message
67 * @GST_MIXER_MESSAGE_RECORD_TOGGLED: A record-toggled GstMixer message
68 * @GST_MIXER_MESSAGE_VOLUME_CHANGED: A volume-changed GstMixer message
69 * @GST_MIXER_MESSAGE_OPTION_CHANGED: An option-changed GstMixer message
70 * @GST_MIXER_MESSAGE_OPTIONS_LIST_CHANGED: An options-list-changed
71 * GstMixer message, posted when the list of available options for a
72 * GstMixerOptions object has changed (Since: 0.10.18)
73 * @GST_MIXER_MESSAGE_MIXER_CHANGED: A mixer-changed GstMixer message, posted
74 * when the list of available mixer tracks has changed. The application
75 * should re-build its interface in this case (Since: 0.10.18)
77 * An enumeration for the type of a GstMixer message received on the bus
83 GST_MIXER_MESSAGE_INVALID,
84 GST_MIXER_MESSAGE_MUTE_TOGGLED,
85 GST_MIXER_MESSAGE_RECORD_TOGGLED,
86 GST_MIXER_MESSAGE_VOLUME_CHANGED,
87 GST_MIXER_MESSAGE_OPTION_CHANGED,
88 GST_MIXER_MESSAGE_OPTIONS_LIST_CHANGED,
89 GST_MIXER_MESSAGE_MIXER_CHANGED
90 } GstMixerMessageType;
94 * @GST_MIXER_FLAG_NONE: No flags
95 * @GST_MIXER_FLAG_AUTO_NOTIFICATIONS: The mixer implementation automatically
96 * sends notification messages.
97 * @GST_MIXER_FLAG_HAS_WHITELIST: The mixer implementation flags tracks that
98 * should be displayed by default (whitelisted). Since: 0.10.23
99 * @GST_MIXER_FLAG_GROUPING: The mixer implementation will leave some controls
100 * marked without either input or output. Controls marked as input or
101 * output should be grouped with input & output sliders, even if they
102 * are options or bare switches. Since: 0.10.23
104 * Flags indicating which optional features are supported by a mixer
111 GST_MIXER_FLAG_NONE = 0,
112 GST_MIXER_FLAG_AUTO_NOTIFICATIONS = (1<<0),
113 GST_MIXER_FLAG_HAS_WHITELIST = (1<<1),
114 GST_MIXER_FLAG_GROUPING = (1<<2),
117 struct _GstMixerClass {
118 GTypeInterface klass;
120 /* FIXME 0.11: Remove this */
121 #ifndef GST_REMOVE_DEPRECATED
122 GstMixerType mixer_type;
125 /* virtual functions */
126 const GList * (* list_tracks) (GstMixer *mixer);
128 void (* set_volume) (GstMixer *mixer,
129 GstMixerTrack *track,
131 void (* get_volume) (GstMixer *mixer,
132 GstMixerTrack *track,
135 void (* set_mute) (GstMixer *mixer,
136 GstMixerTrack *track,
138 void (* set_record) (GstMixer *mixer,
139 GstMixerTrack *track,
141 #ifndef GST_DISABLE_DEPRECATED
142 /* signals (deprecated) */
143 void (* mute_toggled) (GstMixer *mixer,
144 GstMixerTrack *channel,
146 void (* record_toggled) (GstMixer *mixer,
147 GstMixerTrack *channel,
149 void (* volume_changed) (GstMixer *mixer,
150 GstMixerTrack *channel,
153 gpointer padding1[3];
154 #endif /* not GST_DISABLE_DEPRECATED */
156 void (* set_option) (GstMixer *mixer,
157 GstMixerOptions *opts,
159 const gchar * (* get_option) (GstMixer *mixer,
160 GstMixerOptions *opts);
162 #ifndef GST_DISABLE_DEPRECATED
163 void (* option_changed) (GstMixer *mixer,
164 GstMixerOptions *opts,
168 #endif /* not GST_DISABLE_DEPRECATED */
170 GstMixerFlags (* get_mixer_flags) (GstMixer *mixer);
172 GstMixerType (* get_mixer_type) (GstMixer *mixer);
175 gpointer _gst_reserved[GST_PADDING];
178 GType gst_mixer_get_type (void);
180 /* virtual class function wrappers */
181 const GList * gst_mixer_list_tracks (GstMixer *mixer);
182 void gst_mixer_set_volume (GstMixer *mixer,
183 GstMixerTrack *track,
185 void gst_mixer_get_volume (GstMixer *mixer,
186 GstMixerTrack *track,
188 void gst_mixer_set_mute (GstMixer *mixer,
189 GstMixerTrack *track,
191 void gst_mixer_set_record (GstMixer *mixer,
192 GstMixerTrack *track,
194 void gst_mixer_set_option (GstMixer *mixer,
195 GstMixerOptions *opts,
197 const gchar * gst_mixer_get_option (GstMixer *mixer,
198 GstMixerOptions *opts);
200 /* trigger bus messages */
201 void gst_mixer_mute_toggled (GstMixer *mixer,
202 GstMixerTrack *track,
204 void gst_mixer_record_toggled (GstMixer *mixer,
205 GstMixerTrack *track,
207 void gst_mixer_volume_changed (GstMixer *mixer,
208 GstMixerTrack *track,
210 void gst_mixer_option_changed (GstMixer *mixer,
211 GstMixerOptions *opts,
214 void gst_mixer_mixer_changed (GstMixer *mixer);
216 void gst_mixer_options_list_changed (GstMixer *mixer,
217 GstMixerOptions *opts);
219 GstMixerType gst_mixer_get_mixer_type (GstMixer *mixer);
221 GstMixerFlags gst_mixer_get_mixer_flags (GstMixer *mixer);
223 /* Functions for recognising and parsing GstMixerMessages on the bus */
224 GstMixerMessageType gst_mixer_message_get_type (GstMessage *message);
225 void gst_mixer_message_parse_mute_toggled (GstMessage *message,
226 GstMixerTrack **track,
228 void gst_mixer_message_parse_record_toggled (GstMessage *message,
229 GstMixerTrack **track,
231 void gst_mixer_message_parse_volume_changed (GstMessage *message,
232 GstMixerTrack **track,
235 void gst_mixer_message_parse_option_changed (GstMessage *message,
236 GstMixerOptions **options,
237 const gchar **value);
238 void gst_mixer_message_parse_options_list_changed (GstMessage *message,
239 GstMixerOptions **options);
243 #endif /* __GST_MIXER_H__ */