]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Updating the NEWS file with recent changes
[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 bool
185 channel_get_midi_in_got_events(
186   jack_mixer_channel_t channel);
187
188 jack_mixer_scale_t
189 scale_create();
190
191 bool
192 scale_add_threshold(
193   jack_mixer_scale_t scale,
194   float db,
195   float scale_value);
196
197 void
198 scale_calculate_coefficients(
199   jack_mixer_scale_t scale);
200
201 double
202 scale_db_to_scale(
203   jack_mixer_scale_t scale,
204   double db);
205
206 double
207 scale_scale_to_db(
208   jack_mixer_scale_t scale,
209   double scale_value);
210
211 void
212 scale_destroy(
213   jack_mixer_scale_t scale);
214
215 jack_mixer_output_channel_t
216 add_output_channel(
217   jack_mixer_t mixer,
218   const char * channel_name,
219   bool stereo,
220   bool system);
221
222 void
223 remove_output_channel(
224   jack_mixer_output_channel_t output_channel);
225
226 void
227 output_channel_set_solo(
228   jack_mixer_output_channel_t output_channel,
229   jack_mixer_channel_t channel,
230   bool solo_value);
231
232 void
233 output_channel_set_muted(
234   jack_mixer_output_channel_t output_channel,
235   jack_mixer_channel_t channel,
236   bool muted_value);
237
238 bool
239 output_channel_is_muted(
240   jack_mixer_output_channel_t output_channel,
241   jack_mixer_channel_t channel);
242
243 bool
244 output_channel_is_solo(
245   jack_mixer_output_channel_t output_channel,
246   jack_mixer_channel_t channel);
247
248 void
249 output_channel_set_prefader(
250   jack_mixer_output_channel_t output_channel,
251   bool pfl_value);
252
253 bool
254 output_channel_is_prefader(
255   jack_mixer_output_channel_t output_channel);
256
257 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */