]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Do pick up mode properly for volume
[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 #include "scale.h"
37
38 typedef void * jack_mixer_t;
39 typedef void * jack_mixer_channel_t;
40 typedef void * jack_mixer_output_channel_t;
41 typedef void * jack_mixer_threshold_t;
42
43 enum midi_behavior_mode { Jump_To_Value, Pick_Up };
44
45 jack_mixer_t
46 create(
47   const char * jack_client_name_ptr,
48   bool stereo);
49
50 void
51 destroy(
52   jack_mixer_t mixer);
53
54 unsigned int
55 get_channels_count(
56   jack_mixer_t mixer);
57
58 const char*
59 get_client_name(
60   jack_mixer_t mixer);
61
62 int
63 get_last_midi_channel(
64   jack_mixer_t mixer);
65
66 unsigned int
67 set_last_midi_channel(
68   jack_mixer_t mixer,
69   int new_channel);
70
71
72 int
73 get_midi_behavior_mode(
74   jack_mixer_t mixer);
75
76 unsigned int
77 set_midi_behavior_mode(
78   jack_mixer_t mixer,
79   enum midi_behavior_mode mode);
80
81 jack_mixer_channel_t
82 add_channel(
83   jack_mixer_t mixer,
84   const char * channel_name,
85   bool stereo);
86
87 const char *
88 channel_get_name(
89   jack_mixer_channel_t channel);
90
91 /* returned values are in dBFS */
92 void
93 channel_stereo_meter_read(
94   jack_mixer_channel_t channel,
95   double * left_ptr,
96   double * right_ptr);
97
98 /* returned value is in dBFS */
99 void
100 channel_mono_meter_read(
101   jack_mixer_channel_t channel,
102   double * mono_ptr);
103
104 bool
105 channel_is_stereo(
106   jack_mixer_channel_t channel);
107
108 void
109 channel_set_midi_change_callback(
110   jack_mixer_channel_t channel,
111   void (*midi_change_callback) (void*),
112   void *user_data);
113
114 /* volume is in dBFS */
115 void
116 channel_volume_write(
117   jack_mixer_channel_t channel,
118   double volume);
119
120 double
121 channel_volume_read(
122   jack_mixer_channel_t channel);
123
124 void
125 channels_volumes_read(jack_mixer_t mixer_ptr);
126
127 /* balance is from -1.0 (full left) to +1.0 (full right) */
128 void
129 channel_balance_write(
130   jack_mixer_channel_t channel,
131   double balance);
132
133 double
134 channel_balance_read(
135   jack_mixer_channel_t channel);
136
137 int
138 channel_get_balance_midi_cc(
139   jack_mixer_channel_t channel);
140
141 unsigned int
142 channel_set_balance_midi_cc(
143   jack_mixer_channel_t channel,
144   int new_cc);
145
146 int
147 channel_get_volume_midi_cc(
148   jack_mixer_channel_t channel);
149
150 unsigned int
151 channel_set_volume_midi_cc(
152   jack_mixer_channel_t channel,
153   int new_cc);
154
155 int
156 channel_get_mute_midi_cc(
157   jack_mixer_channel_t channel);
158
159 unsigned int
160 channel_set_mute_midi_cc(
161   jack_mixer_channel_t channel,
162   int new_cc);
163
164 int
165 channel_get_solo_midi_cc(
166   jack_mixer_channel_t channel);
167
168 unsigned int
169 channel_set_solo_midi_cc(
170   jack_mixer_channel_t channel,
171   int new_cc);
172
173 void channel_set_midi_cc_picked_up(jack_mixer_channel_t channel,
174   bool status);
175
176 void
177 channel_autoset_volume_midi_cc(
178   jack_mixer_channel_t channel);
179
180 void
181 channel_autoset_balance_midi_cc(
182   jack_mixer_channel_t channel);
183
184 void
185 channel_autoset_mute_midi_cc(
186   jack_mixer_channel_t channel);
187
188 void
189 channel_autoset_solo_midi_cc(
190   jack_mixer_channel_t channel);
191
192 void
193 remove_channel(
194   jack_mixer_channel_t channel);
195
196 void
197 remove_channels(
198   jack_mixer_t mixer);
199
200 /* returned value is in dBFS */
201 double
202 channel_abspeak_read(
203   jack_mixer_channel_t channel);
204
205 void
206 channel_abspeak_reset(
207   jack_mixer_channel_t channel);
208
209 void
210 channel_out_mute(
211   jack_mixer_channel_t channel);
212
213 void
214 channel_out_unmute(
215   jack_mixer_channel_t channel);
216
217 bool
218 channel_is_out_muted(
219   jack_mixer_channel_t channel);
220
221 void
222 channel_solo(
223   jack_mixer_channel_t channel);
224
225 void
226 channel_unsolo(
227   jack_mixer_channel_t channel);
228
229 bool
230 channel_is_soloed(
231   jack_mixer_channel_t channel);
232
233 void
234 channel_rename(
235   jack_mixer_channel_t channel,
236   const char * name);
237
238 void
239 channel_set_midi_scale(
240   jack_mixer_channel_t channel,
241   jack_mixer_scale_t scale);
242
243 bool
244 channel_get_midi_in_got_events(
245   jack_mixer_channel_t channel);
246
247 jack_mixer_output_channel_t
248 add_output_channel(
249   jack_mixer_t mixer,
250   const char * channel_name,
251   bool stereo,
252   bool system);
253
254 void
255 remove_output_channel(
256   jack_mixer_output_channel_t output_channel);
257
258 void
259 output_channel_set_solo(
260   jack_mixer_output_channel_t output_channel,
261   jack_mixer_channel_t channel,
262   bool solo_value);
263
264 void
265 output_channel_set_muted(
266   jack_mixer_output_channel_t output_channel,
267   jack_mixer_channel_t channel,
268   bool muted_value);
269
270 bool
271 output_channel_is_muted(
272   jack_mixer_output_channel_t output_channel,
273   jack_mixer_channel_t channel);
274
275 bool
276 output_channel_is_solo(
277   jack_mixer_output_channel_t output_channel,
278   jack_mixer_channel_t channel);
279
280 void
281 output_channel_set_prefader(
282   jack_mixer_output_channel_t output_channel,
283   bool pfl_value);
284
285 bool
286 output_channel_is_prefader(
287   jack_mixer_output_channel_t output_channel);
288
289 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */