]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Add possibility for main to be mono
[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 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 unsigned 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 unsigned 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 void
135 channel_autoset_midi_cc(
136   jack_mixer_channel_t channel);
137
138 void
139 remove_channel(
140   jack_mixer_channel_t channel);
141
142 /* returned value is in dBFS */
143 double
144 channel_abspeak_read(
145   jack_mixer_channel_t channel);
146
147 void
148 channel_abspeak_reset(
149   jack_mixer_channel_t channel);
150
151 void
152 channel_mute(
153   jack_mixer_channel_t channel);
154
155 void
156 channel_unmute(
157   jack_mixer_channel_t channel);
158
159 void
160 channel_solo(
161   jack_mixer_channel_t channel);
162
163 void
164 channel_unsolo(
165   jack_mixer_channel_t channel);
166
167 bool
168 channel_is_muted(
169   jack_mixer_channel_t channel);
170
171 bool
172 channel_is_soloed(
173   jack_mixer_channel_t channel);
174
175 void
176 channel_rename(
177   jack_mixer_channel_t channel,
178   const char * name);
179
180 void
181 channel_set_midi_scale(
182   jack_mixer_channel_t channel,
183   jack_mixer_scale_t scale);
184
185 bool
186 channel_get_midi_in_got_events(
187   jack_mixer_channel_t channel);
188
189 jack_mixer_scale_t
190 scale_create();
191
192 bool
193 scale_add_threshold(
194   jack_mixer_scale_t scale,
195   float db,
196   float scale_value);
197
198 void
199 scale_calculate_coefficients(
200   jack_mixer_scale_t scale);
201
202 double
203 scale_db_to_scale(
204   jack_mixer_scale_t scale,
205   double db);
206
207 double
208 scale_scale_to_db(
209   jack_mixer_scale_t scale,
210   double scale_value);
211
212 void
213 scale_destroy(
214   jack_mixer_scale_t scale);
215
216 jack_mixer_output_channel_t
217 add_output_channel(
218   jack_mixer_t mixer,
219   const char * channel_name,
220   bool stereo,
221   bool system);
222
223 void
224 remove_output_channel(
225   jack_mixer_output_channel_t output_channel);
226
227 void
228 output_channel_set_solo(
229   jack_mixer_output_channel_t output_channel,
230   jack_mixer_channel_t channel,
231   bool solo_value);
232
233 void
234 output_channel_set_muted(
235   jack_mixer_output_channel_t output_channel,
236   jack_mixer_channel_t channel,
237   bool muted_value);
238
239 bool
240 output_channel_is_muted(
241   jack_mixer_output_channel_t output_channel,
242   jack_mixer_channel_t channel);
243
244 bool
245 output_channel_is_solo(
246   jack_mixer_output_channel_t output_channel,
247   jack_mixer_channel_t channel);
248
249 void
250 output_channel_set_prefader(
251   jack_mixer_output_channel_t output_channel,
252   bool pfl_value);
253
254 bool
255 output_channel_is_prefader(
256   jack_mixer_output_channel_t output_channel);
257
258 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */