Initialize threshold before using it
[jack_mixer.git] / jack_mixer.h
blob3de773a88e415ccf4b4897cc4f66ba826718e879
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);
46 void
47 destroy(
48 jack_mixer_t mixer);
50 jack_mixer_channel_t
51 get_main_mix_channel(
52 jack_mixer_t mixer);
54 unsigned int
55 get_channels_count(
56 jack_mixer_t mixer);
58 unsigned int
59 get_last_midi_channel(
60 jack_mixer_t mixer);
62 jack_mixer_channel_t
63 add_channel(
64 jack_mixer_t mixer,
65 const char * channel_name,
66 bool stereo);
68 const char *
69 channel_get_name(
70 jack_mixer_channel_t channel);
72 /* returned values are in dBFS */
73 void
74 channel_stereo_meter_read(
75 jack_mixer_channel_t channel,
76 double * left_ptr,
77 double * right_ptr);
79 /* returned value is in dBFS */
80 void
81 channel_mono_meter_read(
82 jack_mixer_channel_t channel,
83 double * mono_ptr);
85 bool
86 channel_is_stereo(
87 jack_mixer_channel_t channel);
89 void
90 channel_set_midi_change_callback(
91 jack_mixer_channel_t channel,
92 void (*midi_change_callback) (void*),
93 void *user_data);
95 /* volume is in dBFS */
96 void
97 channel_volume_write(
98 jack_mixer_channel_t channel,
99 double volume);
101 double
102 channel_volume_read(
103 jack_mixer_channel_t channel);
105 /* balance is from -1.0 (full left) to +1.0 (full right) */
106 void
107 channel_balance_write(
108 jack_mixer_channel_t channel,
109 double balance);
111 double
112 channel_balance_read(
113 jack_mixer_channel_t channel);
115 unsigned int
116 channel_get_balance_midi_cc(
117 jack_mixer_channel_t channel);
119 unsigned int
120 channel_set_balance_midi_cc(
121 jack_mixer_channel_t channel,
122 unsigned int new_cc);
124 unsigned int
125 channel_get_volume_midi_cc(
126 jack_mixer_channel_t channel);
128 unsigned int
129 channel_set_volume_midi_cc(
130 jack_mixer_channel_t channel,
131 unsigned int new_cc);
133 void
134 channel_autoset_midi_cc(
135 jack_mixer_channel_t channel);
137 void
138 remove_channel(
139 jack_mixer_channel_t channel);
141 /* returned value is in dBFS */
142 double
143 channel_abspeak_read(
144 jack_mixer_channel_t channel);
146 void
147 channel_abspeak_reset(
148 jack_mixer_channel_t channel);
150 void
151 channel_mute(
152 jack_mixer_channel_t channel);
154 void
155 channel_unmute(
156 jack_mixer_channel_t channel);
158 void
159 channel_solo(
160 jack_mixer_channel_t channel);
162 void
163 channel_unsolo(
164 jack_mixer_channel_t channel);
166 bool
167 channel_is_muted(
168 jack_mixer_channel_t channel);
170 bool
171 channel_is_soloed(
172 jack_mixer_channel_t channel);
174 void
175 channel_rename(
176 jack_mixer_channel_t channel,
177 const char * name);
179 void
180 channel_set_midi_scale(
181 jack_mixer_channel_t channel,
182 jack_mixer_scale_t scale);
184 bool
185 channel_get_midi_in_got_events(
186 jack_mixer_channel_t channel);
188 jack_mixer_scale_t
189 scale_create();
191 bool
192 scale_add_threshold(
193 jack_mixer_scale_t scale,
194 float db,
195 float scale_value);
197 void
198 scale_calculate_coefficients(
199 jack_mixer_scale_t scale);
201 double
202 scale_db_to_scale(
203 jack_mixer_scale_t scale,
204 double db);
206 double
207 scale_scale_to_db(
208 jack_mixer_scale_t scale,
209 double scale_value);
211 void
212 scale_destroy(
213 jack_mixer_scale_t scale);
215 jack_mixer_output_channel_t
216 add_output_channel(
217 jack_mixer_t mixer,
218 const char * channel_name,
219 bool stereo,
220 bool system);
222 void
223 remove_output_channel(
224 jack_mixer_output_channel_t output_channel);
226 void
227 output_channel_set_solo(
228 jack_mixer_output_channel_t output_channel,
229 jack_mixer_channel_t channel,
230 bool solo_value);
232 void
233 output_channel_set_muted(
234 jack_mixer_output_channel_t output_channel,
235 jack_mixer_channel_t channel,
236 bool muted_value);
238 bool
239 output_channel_is_muted(
240 jack_mixer_output_channel_t output_channel,
241 jack_mixer_channel_t channel);
243 bool
244 output_channel_is_solo(
245 jack_mixer_output_channel_t output_channel,
246 jack_mixer_channel_t channel);
248 void
249 output_channel_set_prefader(
250 jack_mixer_output_channel_t output_channel,
251 bool pfl_value);
253 bool
254 output_channel_is_prefader(
255 jack_mixer_output_channel_t output_channel);
257 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */