]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Set version to 14 in preparation for next release
[jack_mixer.git] / jack_mixer.h
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
3  *
4  *   This file is part of jack_mixer
5  *
6  *   Copyright (C) 2006 Nedko Arnaudov <nedko@arnaudov.name>
7  *
8  *   This program is free software; you can redistribute it and/or modify
9  *   it under the terms of the GNU General Public License as published by
10  *   the Free Software Foundation; version 2 of the License
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with this program; if not, write to the Free Software
19  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  *****************************************************************************/
22
23 #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
24 #define JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
25
26 #include <stdbool.h>
27 #include <jack/jack.h>
28
29 #include "scale.h"
30
31 typedef void * jack_mixer_t;
32 typedef void * jack_mixer_kmeter_t;
33 typedef void * jack_mixer_channel_t;
34 typedef void * jack_mixer_output_channel_t;
35 typedef void * jack_mixer_threshold_t;
36
37 enum midi_behavior_mode { Jump_To_Value, Pick_Up };
38
39 jack_mixer_t
40 create(
41   const char * jack_client_name_ptr,
42   bool stereo);
43
44 void
45 destroy(
46   jack_mixer_t mixer);
47
48 unsigned int
49 get_channels_count(
50   jack_mixer_t mixer);
51
52 const char*
53 get_client_name(
54   jack_mixer_t mixer);
55
56 int
57 get_last_midi_channel(
58   jack_mixer_t mixer);
59
60 unsigned int
61 set_last_midi_channel(
62   jack_mixer_t mixer,
63   int new_channel);
64
65 int
66 get_midi_behavior_mode(
67   jack_mixer_t mixer);
68
69 unsigned int
70 set_midi_behavior_mode(
71   jack_mixer_t mixer,
72   enum midi_behavior_mode mode);
73
74 jack_mixer_channel_t
75 add_channel(
76   jack_mixer_t mixer,
77   const char * channel_name,
78   bool stereo);
79
80 void kmeter_init(jack_mixer_kmeter_t km,
81   int sr,
82   int fsize,
83   float hold,
84   float fall);
85
86 void kmeter_process(
87   jack_mixer_kmeter_t km,
88   jack_default_audio_sample_t *p,
89   int start,
90   int end);
91
92 const char *
93 channel_get_name(
94   jack_mixer_channel_t channel);
95
96 /* returned values are in dBFS */
97 void
98 channel_stereo_meter_read(
99   jack_mixer_channel_t channel,
100   double * left_ptr,
101   double * right_ptr);
102
103 /* returned value is in dBFS */
104 void
105 channel_mono_meter_read(
106   jack_mixer_channel_t channel,
107   double * mono_ptr);
108
109
110 /* returned values are in dBFS */
111 void
112 channel_stereo_kmeter_read(
113   jack_mixer_channel_t channel,
114   double * left_ptr,
115   double * right_ptr,
116   double * left_rms_ptr,
117   double * right_rms_ptr);
118
119 /* returned value is in dBFS */
120 void
121 channel_mono_kmeter_read(
122   jack_mixer_channel_t channel,
123   double * mono_ptr,
124   double * mono_rms_ptr);
125
126
127
128 bool
129 channel_is_stereo(
130   jack_mixer_channel_t channel);
131
132 void
133 channel_set_midi_change_callback(
134   jack_mixer_channel_t channel,
135   void (*midi_change_callback) (void*),
136   void *user_data);
137
138 /* volume is in dBFS */
139 void
140 channel_volume_write(
141   jack_mixer_channel_t channel,
142   double volume);
143
144 double
145 channel_volume_read(
146   jack_mixer_channel_t channel);
147
148 void
149 channels_volumes_read(jack_mixer_t mixer_ptr);
150
151 /* balance is from -1.0 (full left) to +1.0 (full right) */
152 void
153 channel_balance_write(
154   jack_mixer_channel_t channel,
155   double balance);
156
157 double
158 channel_balance_read(
159   jack_mixer_channel_t channel);
160
161 int
162 channel_get_balance_midi_cc(
163   jack_mixer_channel_t channel);
164
165 unsigned int
166 channel_set_balance_midi_cc(
167   jack_mixer_channel_t channel,
168   int new_cc);
169
170 int
171 channel_get_volume_midi_cc(
172   jack_mixer_channel_t channel);
173
174 unsigned int
175 channel_set_volume_midi_cc(
176   jack_mixer_channel_t channel,
177   int new_cc);
178
179 int
180 channel_get_mute_midi_cc(
181   jack_mixer_channel_t channel);
182
183 unsigned int
184 channel_set_mute_midi_cc(
185   jack_mixer_channel_t channel,
186   int new_cc);
187
188 int
189 channel_get_solo_midi_cc(
190   jack_mixer_channel_t channel);
191
192 unsigned int
193 channel_set_solo_midi_cc(
194   jack_mixer_channel_t channel,
195   int new_cc);
196
197 void channel_set_midi_cc_volume_picked_up(jack_mixer_channel_t channel,
198   bool status);
199
200 void channel_set_midi_cc_balance_picked_up(jack_mixer_channel_t channel,
201   bool status);
202
203 void
204 channel_autoset_volume_midi_cc(
205   jack_mixer_channel_t channel);
206
207 void
208 channel_autoset_balance_midi_cc(
209   jack_mixer_channel_t channel);
210
211 void
212 channel_autoset_mute_midi_cc(
213   jack_mixer_channel_t channel);
214
215 void
216 channel_autoset_solo_midi_cc(
217   jack_mixer_channel_t channel);
218
219 void
220 remove_channel(
221   jack_mixer_channel_t channel);
222
223 void
224 remove_channels(
225   jack_mixer_t mixer);
226
227 /* returned value is in dBFS */
228 double
229 channel_abspeak_read(
230   jack_mixer_channel_t channel);
231
232 void
233 channel_abspeak_reset(
234   jack_mixer_channel_t channel);
235
236 void
237 channel_out_mute(
238   jack_mixer_channel_t channel);
239
240 void
241 channel_out_unmute(
242   jack_mixer_channel_t channel);
243
244 bool
245 channel_is_out_muted(
246   jack_mixer_channel_t channel);
247
248 void
249 channel_solo(
250   jack_mixer_channel_t channel);
251
252 void
253 channel_unsolo(
254   jack_mixer_channel_t channel);
255
256 bool
257 channel_is_soloed(
258   jack_mixer_channel_t channel);
259
260 void
261 channel_rename(
262   jack_mixer_channel_t channel,
263   const char * name);
264
265 void
266 channel_set_midi_scale(
267   jack_mixer_channel_t channel,
268   jack_mixer_scale_t scale);
269
270 bool
271 channel_get_midi_in_got_events(
272   jack_mixer_channel_t channel);
273
274 jack_mixer_output_channel_t
275 add_output_channel(
276   jack_mixer_t mixer,
277   const char * channel_name,
278   bool stereo,
279   bool system);
280
281 void
282 remove_output_channel(
283   jack_mixer_output_channel_t output_channel);
284
285 void
286 output_channel_set_solo(
287   jack_mixer_output_channel_t output_channel,
288   jack_mixer_channel_t channel,
289   bool solo_value);
290
291 void
292 output_channel_set_muted(
293   jack_mixer_output_channel_t output_channel,
294   jack_mixer_channel_t channel,
295   bool muted_value);
296
297 bool
298 output_channel_is_muted(
299   jack_mixer_output_channel_t output_channel,
300   jack_mixer_channel_t channel);
301
302 bool
303 output_channel_is_solo(
304   jack_mixer_output_channel_t output_channel,
305   jack_mixer_channel_t channel);
306
307 void
308 output_channel_set_prefader(
309   jack_mixer_output_channel_t output_channel,
310   bool pfl_value);
311
312 bool
313 output_channel_is_prefader(
314   jack_mixer_output_channel_t output_channel);
315
316 void output_channel_set_in_prefader(jack_mixer_output_channel_t output_channel,
317   jack_mixer_channel_t input_channel,
318   bool prefader_value);
319
320 bool
321 output_channel_is_in_prefader(
322   jack_mixer_output_channel_t output_channel,
323   jack_mixer_channel_t channel);
324
325 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */