]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
cleanup unused calc_channel_volumes funcs
[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 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;
41
42 jack_mixer_t
43 create(
44   const char * jack_client_name_ptr,
45   bool stereo);
46
47 void
48 destroy(
49   jack_mixer_t mixer);
50
51 jack_mixer_channel_t
52 get_main_mix_channel(
53   jack_mixer_t mixer);
54
55 unsigned int
56 get_channels_count(
57   jack_mixer_t mixer);
58
59 const char*
60 get_client_name(
61   jack_mixer_t mixer);
62
63 unsigned int
64 get_last_midi_channel(
65   jack_mixer_t mixer);
66
67 jack_mixer_channel_t
68 add_channel(
69   jack_mixer_t mixer,
70   const char * channel_name,
71   bool stereo);
72
73 const char *
74 channel_get_name(
75   jack_mixer_channel_t channel);
76
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);
83
84 /* returned value is in dBFS */
85 void
86 channel_mono_meter_read(
87   jack_mixer_channel_t channel,
88   double * mono_ptr);
89
90 bool
91 channel_is_stereo(
92   jack_mixer_channel_t channel);
93
94 void
95 channel_set_midi_change_callback(
96   jack_mixer_channel_t channel,
97   void (*midi_change_callback) (void*),
98   void *user_data);
99
100 /* volume is in dBFS */
101 void
102 channel_volume_write(
103   jack_mixer_channel_t channel,
104   double volume);
105
106 double
107 channel_volume_read(
108   jack_mixer_channel_t channel);
109
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);
115
116 double
117 channel_balance_read(
118   jack_mixer_channel_t channel);
119
120 unsigned int
121 channel_get_balance_midi_cc(
122   jack_mixer_channel_t channel);
123
124 unsigned int
125 channel_set_balance_midi_cc(
126   jack_mixer_channel_t channel,
127   unsigned int new_cc);
128
129 unsigned int
130 channel_get_volume_midi_cc(
131   jack_mixer_channel_t channel);
132
133 unsigned int
134 channel_set_volume_midi_cc(
135   jack_mixer_channel_t channel,
136   unsigned int new_cc);
137
138 void
139 channel_autoset_midi_cc(
140   jack_mixer_channel_t channel);
141
142 void
143 remove_channel(
144   jack_mixer_channel_t channel);
145
146 /* returned value is in dBFS */
147 double
148 channel_abspeak_read(
149   jack_mixer_channel_t channel);
150
151 void
152 channel_abspeak_reset(
153   jack_mixer_channel_t channel);
154
155 void
156 channel_mute(
157   jack_mixer_channel_t channel);
158
159 void
160 channel_unmute(
161   jack_mixer_channel_t channel);
162
163 void
164 channel_solo(
165   jack_mixer_channel_t channel);
166
167 void
168 channel_unsolo(
169   jack_mixer_channel_t channel);
170
171 bool
172 channel_is_muted(
173   jack_mixer_channel_t channel);
174
175 bool
176 channel_is_soloed(
177   jack_mixer_channel_t channel);
178
179 void
180 channel_rename(
181   jack_mixer_channel_t channel,
182   const char * name);
183
184 void
185 channel_set_midi_scale(
186   jack_mixer_channel_t channel,
187   jack_mixer_scale_t scale);
188
189 bool
190 channel_get_midi_in_got_events(
191   jack_mixer_channel_t channel);
192
193 jack_mixer_scale_t
194 scale_create();
195
196 bool
197 scale_add_threshold(
198   jack_mixer_scale_t scale,
199   float db,
200   float scale_value);
201
202 void
203 scale_calculate_coefficients(
204   jack_mixer_scale_t scale);
205
206 double
207 scale_db_to_scale(
208   jack_mixer_scale_t scale,
209   double db);
210
211 double
212 scale_scale_to_db(
213   jack_mixer_scale_t scale,
214   double scale_value);
215
216 void
217 scale_destroy(
218   jack_mixer_scale_t scale);
219
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);
226
227 void
228 remove_output_channel(
229   jack_mixer_output_channel_t output_channel);
230
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);
236
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);
242
243 bool
244 output_channel_is_muted(
245   jack_mixer_output_channel_t output_channel,
246   jack_mixer_channel_t channel);
247
248 bool
249 output_channel_is_solo(
250   jack_mixer_output_channel_t output_channel,
251   jack_mixer_channel_t channel);
252
253 void
254 output_channel_set_prefader(
255   jack_mixer_output_channel_t output_channel,
256   bool pfl_value);
257
258 bool
259 output_channel_is_prefader(
260   jack_mixer_output_channel_t output_channel);
261
262 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */