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