cleanup unused calc_channel_volumes funcs
[jack_mixer.git] / jack_mixer.h
blobf56d9aed01914d829f346fa5bf7f2318ee40520c
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 const char*
60 get_client_name(
61 jack_mixer_t mixer);
63 unsigned int
64 get_last_midi_channel(
65 jack_mixer_t mixer);
67 jack_mixer_channel_t
68 add_channel(
69 jack_mixer_t mixer,
70 const char * channel_name,
71 bool stereo);
73 const char *
74 channel_get_name(
75 jack_mixer_channel_t channel);
77 /* returned values are in dBFS */
78 void
79 channel_stereo_meter_read(
80 jack_mixer_channel_t channel,
81 double * left_ptr,
82 double * right_ptr);
84 /* returned value is in dBFS */
85 void
86 channel_mono_meter_read(
87 jack_mixer_channel_t channel,
88 double * mono_ptr);
90 bool
91 channel_is_stereo(
92 jack_mixer_channel_t channel);
94 void
95 channel_set_midi_change_callback(
96 jack_mixer_channel_t channel,
97 void (*midi_change_callback) (void*),
98 void *user_data);
100 /* volume is in dBFS */
101 void
102 channel_volume_write(
103 jack_mixer_channel_t channel,
104 double volume);
106 double
107 channel_volume_read(
108 jack_mixer_channel_t channel);
110 /* balance is from -1.0 (full left) to +1.0 (full right) */
111 void
112 channel_balance_write(
113 jack_mixer_channel_t channel,
114 double balance);
116 double
117 channel_balance_read(
118 jack_mixer_channel_t channel);
120 unsigned int
121 channel_get_balance_midi_cc(
122 jack_mixer_channel_t channel);
124 unsigned int
125 channel_set_balance_midi_cc(
126 jack_mixer_channel_t channel,
127 unsigned int new_cc);
129 unsigned int
130 channel_get_volume_midi_cc(
131 jack_mixer_channel_t channel);
133 unsigned int
134 channel_set_volume_midi_cc(
135 jack_mixer_channel_t channel,
136 unsigned int new_cc);
138 void
139 channel_autoset_midi_cc(
140 jack_mixer_channel_t channel);
142 void
143 remove_channel(
144 jack_mixer_channel_t channel);
146 /* returned value is in dBFS */
147 double
148 channel_abspeak_read(
149 jack_mixer_channel_t channel);
151 void
152 channel_abspeak_reset(
153 jack_mixer_channel_t channel);
155 void
156 channel_mute(
157 jack_mixer_channel_t channel);
159 void
160 channel_unmute(
161 jack_mixer_channel_t channel);
163 void
164 channel_solo(
165 jack_mixer_channel_t channel);
167 void
168 channel_unsolo(
169 jack_mixer_channel_t channel);
171 bool
172 channel_is_muted(
173 jack_mixer_channel_t channel);
175 bool
176 channel_is_soloed(
177 jack_mixer_channel_t channel);
179 void
180 channel_rename(
181 jack_mixer_channel_t channel,
182 const char * name);
184 void
185 channel_set_midi_scale(
186 jack_mixer_channel_t channel,
187 jack_mixer_scale_t scale);
189 bool
190 channel_get_midi_in_got_events(
191 jack_mixer_channel_t channel);
193 jack_mixer_scale_t
194 scale_create();
196 bool
197 scale_add_threshold(
198 jack_mixer_scale_t scale,
199 float db,
200 float scale_value);
202 void
203 scale_calculate_coefficients(
204 jack_mixer_scale_t scale);
206 double
207 scale_db_to_scale(
208 jack_mixer_scale_t scale,
209 double db);
211 double
212 scale_scale_to_db(
213 jack_mixer_scale_t scale,
214 double scale_value);
216 void
217 scale_destroy(
218 jack_mixer_scale_t scale);
220 jack_mixer_output_channel_t
221 add_output_channel(
222 jack_mixer_t mixer,
223 const char * channel_name,
224 bool stereo,
225 bool system);
227 void
228 remove_output_channel(
229 jack_mixer_output_channel_t output_channel);
231 void
232 output_channel_set_solo(
233 jack_mixer_output_channel_t output_channel,
234 jack_mixer_channel_t channel,
235 bool solo_value);
237 void
238 output_channel_set_muted(
239 jack_mixer_output_channel_t output_channel,
240 jack_mixer_channel_t channel,
241 bool muted_value);
243 bool
244 output_channel_is_muted(
245 jack_mixer_output_channel_t output_channel,
246 jack_mixer_channel_t channel);
248 bool
249 output_channel_is_solo(
250 jack_mixer_output_channel_t output_channel,
251 jack_mixer_channel_t channel);
253 void
254 output_channel_set_prefader(
255 jack_mixer_output_channel_t output_channel,
256 bool pfl_value);
258 bool
259 output_channel_is_prefader(
260 jack_mixer_output_channel_t output_channel);
262 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */