]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Balance uses pick up mode
[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 #ifdef SWIG
27 %module jack_mixer_c
28 %include "typemaps.i"
29 %apply double *OUTPUT { double * left_ptr, double * right_ptr, double * mono_ptr };
30 %{
31 #include <stdbool.h>
32 #include "jack_mixer.h"
33 %}
34 #endif
35
36 #include "scale.h"
37
38 typedef void * jack_mixer_t;
39 typedef void * jack_mixer_channel_t;
40 typedef void * jack_mixer_output_channel_t;
41 typedef void * jack_mixer_threshold_t;
42
43 enum midi_behavior_mode { Jump_To_Value, Pick_Up };
44
45 jack_mixer_t
46 create(
47   const char * jack_client_name_ptr,
48   bool stereo);
49
50 void
51 destroy(
52   jack_mixer_t mixer);
53
54 unsigned int
55 get_channels_count(
56   jack_mixer_t mixer);
57
58 const char*
59 get_client_name(
60   jack_mixer_t mixer);
61
62 int
63 get_last_midi_channel(
64   jack_mixer_t mixer);
65
66 unsigned int
67 set_last_midi_channel(
68   jack_mixer_t mixer,
69   int new_channel);
70
71
72 int
73 get_midi_behavior_mode(
74   jack_mixer_t mixer);
75
76 unsigned int
77 set_midi_behavior_mode(
78   jack_mixer_t mixer,
79   enum midi_behavior_mode mode);
80
81 jack_mixer_channel_t
82 add_channel(
83   jack_mixer_t mixer,
84   const char * channel_name,
85   bool stereo);
86
87 const char *
88 channel_get_name(
89   jack_mixer_channel_t channel);
90
91 /* returned values are in dBFS */
92 void
93 channel_stereo_meter_read(
94   jack_mixer_channel_t channel,
95   double * left_ptr,
96   double * right_ptr);
97
98 /* returned value is in dBFS */
99 void
100 channel_mono_meter_read(
101   jack_mixer_channel_t channel,
102   double * mono_ptr);
103
104 bool
105 channel_is_stereo(
106   jack_mixer_channel_t channel);
107
108 void
109 channel_set_midi_change_callback(
110   jack_mixer_channel_t channel,
111   void (*midi_change_callback) (void*),
112   void *user_data);
113
114 /* volume is in dBFS */
115 void
116 channel_volume_write(
117   jack_mixer_channel_t channel,
118   double volume);
119
120 double
121 channel_volume_read(
122   jack_mixer_channel_t channel);
123
124 void
125 channels_volumes_read(jack_mixer_t mixer_ptr);
126
127 /* balance is from -1.0 (full left) to +1.0 (full right) */
128 void
129 channel_balance_write(
130   jack_mixer_channel_t channel,
131   double balance);
132
133 double
134 channel_balance_read(
135   jack_mixer_channel_t channel);
136
137 int
138 channel_get_balance_midi_cc(
139   jack_mixer_channel_t channel);
140
141 unsigned int
142 channel_set_balance_midi_cc(
143   jack_mixer_channel_t channel,
144   int new_cc);
145
146 int
147 channel_get_volume_midi_cc(
148   jack_mixer_channel_t channel);
149
150 unsigned int
151 channel_set_volume_midi_cc(
152   jack_mixer_channel_t channel,
153   int new_cc);
154
155 int
156 channel_get_mute_midi_cc(
157   jack_mixer_channel_t channel);
158
159 unsigned int
160 channel_set_mute_midi_cc(
161   jack_mixer_channel_t channel,
162   int new_cc);
163
164 int
165 channel_get_solo_midi_cc(
166   jack_mixer_channel_t channel);
167
168 unsigned int
169 channel_set_solo_midi_cc(
170   jack_mixer_channel_t channel,
171   int new_cc);
172
173 void channel_set_midi_cc_volume_picked_up(jack_mixer_channel_t channel,
174   bool status);
175
176 void channel_set_midi_cc_balance_picked_up(jack_mixer_channel_t channel,
177   bool status);
178
179 void
180 channel_autoset_volume_midi_cc(
181   jack_mixer_channel_t channel);
182
183 void
184 channel_autoset_balance_midi_cc(
185   jack_mixer_channel_t channel);
186
187 void
188 channel_autoset_mute_midi_cc(
189   jack_mixer_channel_t channel);
190
191 void
192 channel_autoset_solo_midi_cc(
193   jack_mixer_channel_t channel);
194
195 void
196 remove_channel(
197   jack_mixer_channel_t channel);
198
199 void
200 remove_channels(
201   jack_mixer_t mixer);
202
203 /* returned value is in dBFS */
204 double
205 channel_abspeak_read(
206   jack_mixer_channel_t channel);
207
208 void
209 channel_abspeak_reset(
210   jack_mixer_channel_t channel);
211
212 void
213 channel_out_mute(
214   jack_mixer_channel_t channel);
215
216 void
217 channel_out_unmute(
218   jack_mixer_channel_t channel);
219
220 bool
221 channel_is_out_muted(
222   jack_mixer_channel_t channel);
223
224 void
225 channel_solo(
226   jack_mixer_channel_t channel);
227
228 void
229 channel_unsolo(
230   jack_mixer_channel_t channel);
231
232 bool
233 channel_is_soloed(
234   jack_mixer_channel_t channel);
235
236 void
237 channel_rename(
238   jack_mixer_channel_t channel,
239   const char * name);
240
241 void
242 channel_set_midi_scale(
243   jack_mixer_channel_t channel,
244   jack_mixer_scale_t scale);
245
246 bool
247 channel_get_midi_in_got_events(
248   jack_mixer_channel_t channel);
249
250 jack_mixer_output_channel_t
251 add_output_channel(
252   jack_mixer_t mixer,
253   const char * channel_name,
254   bool stereo,
255   bool system);
256
257 void
258 remove_output_channel(
259   jack_mixer_output_channel_t output_channel);
260
261 void
262 output_channel_set_solo(
263   jack_mixer_output_channel_t output_channel,
264   jack_mixer_channel_t channel,
265   bool solo_value);
266
267 void
268 output_channel_set_muted(
269   jack_mixer_output_channel_t output_channel,
270   jack_mixer_channel_t channel,
271   bool muted_value);
272
273 bool
274 output_channel_is_muted(
275   jack_mixer_output_channel_t output_channel,
276   jack_mixer_channel_t channel);
277
278 bool
279 output_channel_is_solo(
280   jack_mixer_output_channel_t output_channel,
281   jack_mixer_channel_t channel);
282
283 void
284 output_channel_set_prefader(
285   jack_mixer_output_channel_t output_channel,
286   bool pfl_value);
287
288 bool
289 output_channel_is_prefader(
290   jack_mixer_output_channel_t output_channel);
291
292 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */