]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Add midi control for mute-all button
[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 unsigned int
52 get_channels_count(
53   jack_mixer_t mixer);
54
55 const char*
56 get_client_name(
57   jack_mixer_t mixer);
58
59 unsigned int
60 get_last_midi_channel(
61   jack_mixer_t mixer);
62
63 jack_mixer_channel_t
64 add_channel(
65   jack_mixer_t mixer,
66   const char * channel_name,
67   bool stereo);
68
69 const char *
70 channel_get_name(
71   jack_mixer_channel_t channel);
72
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);
79
80 /* returned value is in dBFS */
81 void
82 channel_mono_meter_read(
83   jack_mixer_channel_t channel,
84   double * mono_ptr);
85
86 bool
87 channel_is_stereo(
88   jack_mixer_channel_t channel);
89
90 void
91 channel_set_midi_change_callback(
92   jack_mixer_channel_t channel,
93   void (*midi_change_callback) (void*),
94   void *user_data);
95
96 /* volume is in dBFS */
97 void
98 channel_volume_write(
99   jack_mixer_channel_t channel,
100   double volume);
101
102 double
103 channel_volume_read(
104   jack_mixer_channel_t channel);
105
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);
111
112 double
113 channel_balance_read(
114   jack_mixer_channel_t channel);
115
116 int
117 channel_get_balance_midi_cc(
118   jack_mixer_channel_t channel);
119
120 unsigned int
121 channel_set_balance_midi_cc(
122   jack_mixer_channel_t channel,
123   unsigned int new_cc);
124
125 int
126 channel_get_volume_midi_cc(
127   jack_mixer_channel_t channel);
128
129 unsigned int
130 channel_set_volume_midi_cc(
131   jack_mixer_channel_t channel,
132   unsigned int new_cc);
133
134 int
135 channel_get_mute_midi_cc(
136   jack_mixer_channel_t channel);
137
138 unsigned int
139 channel_set_mute_midi_cc(
140   jack_mixer_channel_t channel,
141   unsigned int new_cc);
142
143 void
144 channel_autoset_midi_cc(
145   jack_mixer_channel_t channel);
146
147 void
148 remove_channel(
149   jack_mixer_channel_t channel);
150
151 /* returned value is in dBFS */
152 double
153 channel_abspeak_read(
154   jack_mixer_channel_t channel);
155
156 void
157 channel_abspeak_reset(
158   jack_mixer_channel_t channel);
159
160 void
161 channel_out_mute(
162   jack_mixer_channel_t channel);
163
164 void
165 channel_out_unmute(
166   jack_mixer_channel_t channel);
167
168 bool
169 channel_is_out_muted(
170   jack_mixer_channel_t channel);
171
172 void
173 channel_rename(
174   jack_mixer_channel_t channel,
175   const char * name);
176
177 void
178 channel_set_midi_scale(
179   jack_mixer_channel_t channel,
180   jack_mixer_scale_t scale);
181
182 bool
183 channel_get_midi_in_got_events(
184   jack_mixer_channel_t channel);
185
186 jack_mixer_scale_t
187 scale_create();
188
189 bool
190 scale_add_threshold(
191   jack_mixer_scale_t scale,
192   float db,
193   float scale_value);
194
195 void
196 scale_calculate_coefficients(
197   jack_mixer_scale_t scale);
198
199 double
200 scale_db_to_scale(
201   jack_mixer_scale_t scale,
202   double db);
203
204 double
205 scale_scale_to_db(
206   jack_mixer_scale_t scale,
207   double scale_value);
208
209 void
210 scale_destroy(
211   jack_mixer_scale_t scale);
212
213 jack_mixer_output_channel_t
214 add_output_channel(
215   jack_mixer_t mixer,
216   const char * channel_name,
217   bool stereo,
218   bool system);
219
220 void
221 remove_output_channel(
222   jack_mixer_output_channel_t output_channel);
223
224 void
225 output_channel_set_solo(
226   jack_mixer_output_channel_t output_channel,
227   jack_mixer_channel_t channel,
228   bool solo_value);
229
230 void
231 output_channel_set_muted(
232   jack_mixer_output_channel_t output_channel,
233   jack_mixer_channel_t channel,
234   bool muted_value);
235
236 bool
237 output_channel_is_muted(
238   jack_mixer_output_channel_t output_channel,
239   jack_mixer_channel_t channel);
240
241 bool
242 output_channel_is_solo(
243   jack_mixer_output_channel_t output_channel,
244   jack_mixer_channel_t channel);
245
246 void
247 output_channel_set_prefader(
248   jack_mixer_output_channel_t output_channel,
249   bool pfl_value);
250
251 bool
252 output_channel_is_prefader(
253   jack_mixer_output_channel_t output_channel);
254
255 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */