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