Pass height/width to cairo.Surface.create_similar as integers
[jack_mixer.git] / jack_mixer.h
blobbc4c007088901a061a21dee001243aa0e634a873
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
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
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.
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.
21 *****************************************************************************/
23 #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
24 #define JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED
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 };
31 #include <stdbool.h>
32 #include "jack_mixer.h"
34 #endif
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;
42 jack_mixer_t
43 create(
44 const char * jack_client_name_ptr);
46 void
47 destroy(
48 jack_mixer_t mixer);
50 jack_mixer_channel_t
51 get_main_mix_channel(
52 jack_mixer_t mixer);
54 unsigned int
55 get_channels_count(
56 jack_mixer_t mixer);
58 unsigned int
59 get_last_midi_channel(
60 jack_mixer_t mixer);
62 jack_mixer_channel_t
63 add_channel(
64 jack_mixer_t mixer,
65 const char * channel_name,
66 bool stereo);
68 const char *
69 channel_get_name(
70 jack_mixer_channel_t channel);
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);
79 /* returned value is in dBFS */
80 void
81 channel_mono_meter_read(
82 jack_mixer_channel_t channel,
83 double * mono_ptr);
85 bool
86 channel_is_stereo(
87 jack_mixer_channel_t channel);
89 void
90 channel_set_midi_change_callback(
91 jack_mixer_channel_t channel,
92 void (*midi_change_callback) (void*),
93 void *user_data);
95 /* volume is in dBFS */
96 void
97 channel_volume_write(
98 jack_mixer_channel_t channel,
99 double volume);
101 double
102 channel_volume_read(
103 jack_mixer_channel_t channel);
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);
111 double
112 channel_balance_read(
113 jack_mixer_channel_t channel);
115 unsigned int
116 channel_get_balance_midi_cc(
117 jack_mixer_channel_t channel);
119 unsigned int
120 channel_set_balance_midi_cc(
121 jack_mixer_channel_t channel,
122 unsigned int new_cc);
124 unsigned int
125 channel_get_volume_midi_cc(
126 jack_mixer_channel_t channel);
128 unsigned int
129 channel_set_volume_midi_cc(
130 jack_mixer_channel_t channel,
131 unsigned int new_cc);
133 void
134 channel_autoset_midi_cc(
135 jack_mixer_channel_t channel);
137 void
138 remove_channel(
139 jack_mixer_channel_t channel);
141 /* returned value is in dBFS */
142 double
143 channel_abspeak_read(
144 jack_mixer_channel_t channel);
146 void
147 channel_abspeak_reset(
148 jack_mixer_channel_t channel);
150 void
151 channel_mute(
152 jack_mixer_channel_t channel);
154 void
155 channel_unmute(
156 jack_mixer_channel_t channel);
158 void
159 channel_solo(
160 jack_mixer_channel_t channel);
162 void
163 channel_unsolo(
164 jack_mixer_channel_t channel);
166 bool
167 channel_is_muted(
168 jack_mixer_channel_t channel);
170 bool
171 channel_is_soloed(
172 jack_mixer_channel_t channel);
174 void
175 channel_rename(
176 jack_mixer_channel_t channel,
177 const char * name);
179 void
180 channel_set_midi_scale(
181 jack_mixer_channel_t channel,
182 jack_mixer_scale_t scale);
184 jack_mixer_scale_t
185 scale_create();
187 bool
188 scale_add_threshold(
189 jack_mixer_scale_t scale,
190 float db,
191 float scale_value);
193 void
194 scale_calculate_coefficients(
195 jack_mixer_scale_t scale);
197 double
198 scale_db_to_scale(
199 jack_mixer_scale_t scale,
200 double db);
202 double
203 scale_scale_to_db(
204 jack_mixer_scale_t scale,
205 double scale_value);
207 void
208 scale_destroy(
209 jack_mixer_scale_t scale);
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);
218 void
219 remove_output_channel(
220 jack_mixer_output_channel_t output_channel);
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);
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);
234 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */