Add jack_mix_box, a minimalistic jack mixer (no UI, controlled by MIDI)
[jack_mixer.git] / jack_mixer.h
blob5e38576061ac9e5238d4d2e644796659c8f278b9
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * This file is part of jack_mixer
6 * Copyright (C) 2006 Nedko Arnaudov <nedko@arnaudov.name>
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
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.
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.
21 *****************************************************************************/
23 #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
24 #define JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
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 };
31 #include <stdbool.h>
32 #include "jack_mixer.h"
34 #endif
36 typedef void * jack_mixer_t;
37 typedef void * jack_mixer_channel_t;
38 typedef void * jack_mixer_output_channel_t;
39 typedef void * jack_mixer_scale_t;
40 typedef void * jack_mixer_threshold_t;
42 jack_mixer_t
43 create(
44 const char * jack_client_name_ptr,
45 bool stereo);
47 void
48 destroy(
49 jack_mixer_t mixer);
51 jack_mixer_channel_t
52 get_main_mix_channel(
53 jack_mixer_t mixer);
55 unsigned int
56 get_channels_count(
57 jack_mixer_t mixer);
59 unsigned int
60 get_last_midi_channel(
61 jack_mixer_t mixer);
63 jack_mixer_channel_t
64 add_channel(
65 jack_mixer_t mixer,
66 const char * channel_name,
67 bool stereo);
69 const char *
70 channel_get_name(
71 jack_mixer_channel_t channel);
73 /* returned values are in dBFS */
74 void
75 channel_stereo_meter_read(
76 jack_mixer_channel_t channel,
77 double * left_ptr,
78 double * right_ptr);
80 /* returned value is in dBFS */
81 void
82 channel_mono_meter_read(
83 jack_mixer_channel_t channel,
84 double * mono_ptr);
86 bool
87 channel_is_stereo(
88 jack_mixer_channel_t channel);
90 void
91 channel_set_midi_change_callback(
92 jack_mixer_channel_t channel,
93 void (*midi_change_callback) (void*),
94 void *user_data);
96 /* volume is in dBFS */
97 void
98 channel_volume_write(
99 jack_mixer_channel_t channel,
100 double volume);
102 double
103 channel_volume_read(
104 jack_mixer_channel_t channel);
106 /* balance is from -1.0 (full left) to +1.0 (full right) */
107 void
108 channel_balance_write(
109 jack_mixer_channel_t channel,
110 double balance);
112 double
113 channel_balance_read(
114 jack_mixer_channel_t channel);
116 unsigned int
117 channel_get_balance_midi_cc(
118 jack_mixer_channel_t channel);
120 unsigned int
121 channel_set_balance_midi_cc(
122 jack_mixer_channel_t channel,
123 unsigned int new_cc);
125 unsigned int
126 channel_get_volume_midi_cc(
127 jack_mixer_channel_t channel);
129 unsigned int
130 channel_set_volume_midi_cc(
131 jack_mixer_channel_t channel,
132 unsigned int new_cc);
134 void
135 channel_autoset_midi_cc(
136 jack_mixer_channel_t channel);
138 void
139 remove_channel(
140 jack_mixer_channel_t channel);
142 /* returned value is in dBFS */
143 double
144 channel_abspeak_read(
145 jack_mixer_channel_t channel);
147 void
148 channel_abspeak_reset(
149 jack_mixer_channel_t channel);
151 void
152 channel_mute(
153 jack_mixer_channel_t channel);
155 void
156 channel_unmute(
157 jack_mixer_channel_t channel);
159 void
160 channel_solo(
161 jack_mixer_channel_t channel);
163 void
164 channel_unsolo(
165 jack_mixer_channel_t channel);
167 bool
168 channel_is_muted(
169 jack_mixer_channel_t channel);
171 bool
172 channel_is_soloed(
173 jack_mixer_channel_t channel);
175 void
176 channel_rename(
177 jack_mixer_channel_t channel,
178 const char * name);
180 void
181 channel_set_midi_scale(
182 jack_mixer_channel_t channel,
183 jack_mixer_scale_t scale);
185 bool
186 channel_get_midi_in_got_events(
187 jack_mixer_channel_t channel);
189 jack_mixer_scale_t
190 scale_create();
192 bool
193 scale_add_threshold(
194 jack_mixer_scale_t scale,
195 float db,
196 float scale_value);
198 void
199 scale_calculate_coefficients(
200 jack_mixer_scale_t scale);
202 double
203 scale_db_to_scale(
204 jack_mixer_scale_t scale,
205 double db);
207 double
208 scale_scale_to_db(
209 jack_mixer_scale_t scale,
210 double scale_value);
212 void
213 scale_destroy(
214 jack_mixer_scale_t scale);
216 jack_mixer_output_channel_t
217 add_output_channel(
218 jack_mixer_t mixer,
219 const char * channel_name,
220 bool stereo,
221 bool system);
223 void
224 remove_output_channel(
225 jack_mixer_output_channel_t output_channel);
227 void
228 output_channel_set_solo(
229 jack_mixer_output_channel_t output_channel,
230 jack_mixer_channel_t channel,
231 bool solo_value);
233 void
234 output_channel_set_muted(
235 jack_mixer_output_channel_t output_channel,
236 jack_mixer_channel_t channel,
237 bool muted_value);
239 bool
240 output_channel_is_muted(
241 jack_mixer_output_channel_t output_channel,
242 jack_mixer_channel_t channel);
244 bool
245 output_channel_is_solo(
246 jack_mixer_output_channel_t output_channel,
247 jack_mixer_channel_t channel);
249 void
250 output_channel_set_prefader(
251 jack_mixer_output_channel_t output_channel,
252 bool pfl_value);
254 bool
255 output_channel_is_prefader(
256 jack_mixer_output_channel_t output_channel);
258 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */