|
1 /* GStreamer Mixer |
|
2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net> |
|
3 * |
|
4 * mixer.h: mixer interface design |
|
5 * |
|
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. |
|
10 * |
|
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. |
|
15 * |
|
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. |
|
20 */ |
|
21 |
|
22 #ifndef __GST_MIXER_H__ |
|
23 #define __GST_MIXER_H__ |
|
24 |
|
25 #include <gst/gst.h> |
|
26 #include <gst/interfaces/mixeroptions.h> |
|
27 #include <gst/interfaces/mixertrack.h> |
|
28 #include <gst/interfaces/interfaces-enumtypes.h> |
|
29 |
|
30 G_BEGIN_DECLS |
|
31 |
|
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)) |
|
44 |
|
45 #define GST_MIXER_TYPE(klass) (klass->mixer_type) |
|
46 |
|
47 typedef struct _GstMixer GstMixer; |
|
48 typedef struct _GstMixerClass GstMixerClass; |
|
49 |
|
50 typedef enum |
|
51 { |
|
52 GST_MIXER_HARDWARE, |
|
53 GST_MIXER_SOFTWARE |
|
54 } GstMixerType; |
|
55 |
|
56 /** |
|
57 * GstMixerMessageType: |
|
58 * @GST_MIXER_MESSAGE_INVALID: Not a GstMixer message |
|
59 * @GST_MIXER_MESSAGE_MUTE_TOGGLED: A mute-toggled GstMixer message |
|
60 * @GST_MIXER_MESSAGE_RECORD_TOGGLED: A record-toggled GstMixer message |
|
61 * @GST_MIXER_MESSAGE_VOLUME_CHANGED: A volume-changed GstMixer message |
|
62 * @GST_MIXER_MESSAGE_OPTION_CHANGED: An option-changed GstMixer message |
|
63 * @GST_MIXER_MESSAGE_OPTIONS_LIST_CHANGED: An options-list-changed |
|
64 * GstMixer message, posted when the list of available options for a |
|
65 * GstMixerOptions object has changed (Since: 0.10.18) |
|
66 * @GST_MIXER_MESSAGE_MIXER_CHANGED: A mixer-changed GstMixer message, posted |
|
67 * when the list of available mixer tracks has changed. The application |
|
68 * should re-build its interface in this case (Since: 0.10.18) |
|
69 * |
|
70 * An enumeration for the type of a GstMixer message received on the bus |
|
71 * |
|
72 * Since: 0.10.14 |
|
73 */ |
|
74 typedef enum |
|
75 { |
|
76 GST_MIXER_MESSAGE_INVALID, |
|
77 GST_MIXER_MESSAGE_MUTE_TOGGLED, |
|
78 GST_MIXER_MESSAGE_RECORD_TOGGLED, |
|
79 GST_MIXER_MESSAGE_VOLUME_CHANGED, |
|
80 GST_MIXER_MESSAGE_OPTION_CHANGED, |
|
81 GST_MIXER_MESSAGE_OPTIONS_LIST_CHANGED, |
|
82 GST_MIXER_MESSAGE_MIXER_CHANGED |
|
83 } GstMixerMessageType; |
|
84 |
|
85 /** |
|
86 * GstMixerFlags: |
|
87 * @GST_MIXER_FLAG_NONE: No flags |
|
88 * @GST_MIXER_FLAG_AUTO_NOTIFICATIONS: The mixer implementation automatically sends |
|
89 * notification messages. |
|
90 * |
|
91 * Flags for supported features. Whether the element automatically sends |
|
92 * notifications on the bus is the only one for now. |
|
93 * |
|
94 * Since: 0.10.14 |
|
95 */ |
|
96 typedef enum |
|
97 { |
|
98 GST_MIXER_FLAG_NONE = 0, |
|
99 GST_MIXER_FLAG_AUTO_NOTIFICATIONS = (1<<0) |
|
100 } GstMixerFlags; |
|
101 |
|
102 struct _GstMixerClass { |
|
103 GTypeInterface klass; |
|
104 |
|
105 GstMixerType mixer_type; |
|
106 |
|
107 /* virtual functions */ |
|
108 const GList * (* list_tracks) (GstMixer *mixer); |
|
109 |
|
110 void (* set_volume) (GstMixer *mixer, |
|
111 GstMixerTrack *track, |
|
112 gint *volumes); |
|
113 void (* get_volume) (GstMixer *mixer, |
|
114 GstMixerTrack *track, |
|
115 gint *volumes); |
|
116 |
|
117 void (* set_mute) (GstMixer *mixer, |
|
118 GstMixerTrack *track, |
|
119 gboolean mute); |
|
120 void (* set_record) (GstMixer *mixer, |
|
121 GstMixerTrack *track, |
|
122 gboolean record); |
|
123 #ifndef GST_DISABLE_DEPRECATED |
|
124 /* signals (deprecated) */ |
|
125 void (* mute_toggled) (GstMixer *mixer, |
|
126 GstMixerTrack *channel, |
|
127 gboolean mute); |
|
128 void (* record_toggled) (GstMixer *mixer, |
|
129 GstMixerTrack *channel, |
|
130 gboolean record); |
|
131 void (* volume_changed) (GstMixer *mixer, |
|
132 GstMixerTrack *channel, |
|
133 gint *volumes); |
|
134 #else |
|
135 gpointer padding1[3]; |
|
136 #endif /* not GST_DISABLE_DEPRECATED */ |
|
137 |
|
138 void (* set_option) (GstMixer *mixer, |
|
139 GstMixerOptions *opts, |
|
140 gchar *value); |
|
141 const gchar * (* get_option) (GstMixer *mixer, |
|
142 GstMixerOptions *opts); |
|
143 |
|
144 #ifndef GST_DISABLE_DEPRECATED |
|
145 void (* option_changed) (GstMixer *mixer, |
|
146 GstMixerOptions *opts, |
|
147 gchar *option); |
|
148 #else |
|
149 gpointer padding2; |
|
150 #endif /* not GST_DISABLE_DEPRECATED */ |
|
151 |
|
152 GstMixerFlags (* get_mixer_flags) (GstMixer *mixer); |
|
153 |
|
154 /*< private >*/ |
|
155 gpointer _gst_reserved[GST_PADDING-1]; |
|
156 }; |
|
157 #ifdef __SYMBIAN32__ |
|
158 IMPORT_C |
|
159 #endif |
|
160 |
|
161 |
|
162 GType gst_mixer_get_type (void); |
|
163 |
|
164 /* virtual class function wrappers */ |
|
165 #ifdef __SYMBIAN32__ |
|
166 IMPORT_C |
|
167 #endif |
|
168 |
|
169 const GList * gst_mixer_list_tracks (GstMixer *mixer); |
|
170 #ifdef __SYMBIAN32__ |
|
171 IMPORT_C |
|
172 #endif |
|
173 |
|
174 void gst_mixer_set_volume (GstMixer *mixer, |
|
175 GstMixerTrack *track, |
|
176 gint *volumes); |
|
177 #ifdef __SYMBIAN32__ |
|
178 IMPORT_C |
|
179 #endif |
|
180 |
|
181 void gst_mixer_get_volume (GstMixer *mixer, |
|
182 GstMixerTrack *track, |
|
183 gint *volumes); |
|
184 #ifdef __SYMBIAN32__ |
|
185 IMPORT_C |
|
186 #endif |
|
187 |
|
188 void gst_mixer_set_mute (GstMixer *mixer, |
|
189 GstMixerTrack *track, |
|
190 gboolean mute); |
|
191 #ifdef __SYMBIAN32__ |
|
192 IMPORT_C |
|
193 #endif |
|
194 |
|
195 void gst_mixer_set_record (GstMixer *mixer, |
|
196 GstMixerTrack *track, |
|
197 gboolean record); |
|
198 #ifdef __SYMBIAN32__ |
|
199 IMPORT_C |
|
200 #endif |
|
201 |
|
202 void gst_mixer_set_option (GstMixer *mixer, |
|
203 GstMixerOptions *opts, |
|
204 gchar *value); |
|
205 #ifdef __SYMBIAN32__ |
|
206 IMPORT_C |
|
207 #endif |
|
208 |
|
209 const gchar * gst_mixer_get_option (GstMixer *mixer, |
|
210 GstMixerOptions *opts); |
|
211 |
|
212 /* trigger bus messages */ |
|
213 #ifdef __SYMBIAN32__ |
|
214 IMPORT_C |
|
215 #endif |
|
216 |
|
217 void gst_mixer_mute_toggled (GstMixer *mixer, |
|
218 GstMixerTrack *track, |
|
219 gboolean mute); |
|
220 #ifdef __SYMBIAN32__ |
|
221 IMPORT_C |
|
222 #endif |
|
223 |
|
224 void gst_mixer_record_toggled (GstMixer *mixer, |
|
225 GstMixerTrack *track, |
|
226 gboolean record); |
|
227 #ifdef __SYMBIAN32__ |
|
228 IMPORT_C |
|
229 #endif |
|
230 |
|
231 void gst_mixer_volume_changed (GstMixer *mixer, |
|
232 GstMixerTrack *track, |
|
233 gint *volumes); |
|
234 #ifdef __SYMBIAN32__ |
|
235 IMPORT_C |
|
236 #endif |
|
237 |
|
238 void gst_mixer_option_changed (GstMixer *mixer, |
|
239 GstMixerOptions *opts, |
|
240 gchar *value); |
|
241 #ifdef __SYMBIAN32__ |
|
242 IMPORT_C |
|
243 #endif |
|
244 |
|
245 |
|
246 void gst_mixer_mixer_changed (GstMixer *mixer); |
|
247 #ifdef __SYMBIAN32__ |
|
248 IMPORT_C |
|
249 #endif |
|
250 |
|
251 |
|
252 void gst_mixer_options_list_changed (GstMixer *mixer, |
|
253 GstMixerOptions *opts); |
|
254 #ifdef __SYMBIAN32__ |
|
255 IMPORT_C |
|
256 #endif |
|
257 |
|
258 |
|
259 |
|
260 GstMixerFlags gst_mixer_get_mixer_flags (GstMixer *mixer); |
|
261 |
|
262 /* Functions for recognising and parsing GstMixerMessages on the bus */ |
|
263 #ifdef __SYMBIAN32__ |
|
264 IMPORT_C |
|
265 #endif |
|
266 |
|
267 GstMixerMessageType gst_mixer_message_get_type (GstMessage *message); |
|
268 #ifdef __SYMBIAN32__ |
|
269 IMPORT_C |
|
270 #endif |
|
271 |
|
272 void gst_mixer_message_parse_mute_toggled (GstMessage *message, |
|
273 GstMixerTrack **track, |
|
274 gboolean *mute); |
|
275 #ifdef __SYMBIAN32__ |
|
276 IMPORT_C |
|
277 #endif |
|
278 |
|
279 void gst_mixer_message_parse_record_toggled (GstMessage *message, |
|
280 GstMixerTrack **track, |
|
281 gboolean *record); |
|
282 #ifdef __SYMBIAN32__ |
|
283 IMPORT_C |
|
284 #endif |
|
285 |
|
286 void gst_mixer_message_parse_volume_changed (GstMessage *message, |
|
287 GstMixerTrack **track, |
|
288 gint **volumes, |
|
289 gint *num_channels); |
|
290 #ifdef __SYMBIAN32__ |
|
291 IMPORT_C |
|
292 #endif |
|
293 |
|
294 void gst_mixer_message_parse_option_changed (GstMessage *message, |
|
295 GstMixerOptions **options, |
|
296 const gchar **value); |
|
297 #ifdef __SYMBIAN32__ |
|
298 IMPORT_C |
|
299 #endif |
|
300 |
|
301 void gst_mixer_message_parse_options_list_changed (GstMessage *message, |
|
302 GstMixerOptions **options); |
|
303 |
|
304 G_END_DECLS |
|
305 |
|
306 #endif /* __GST_MIXER_H__ */ |