]> git.0d.be Git - jack_mixer.git/blob - jack_mixer.h
Possibility to change CC attribution dynamically
[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_scale_t;
39 typedef void * jack_mixer_threshold_t;
40
41 jack_mixer_t
42 create(
43   const char * jack_client_name_ptr);
44
45 void
46 destroy(
47   jack_mixer_t mixer);
48
49 jack_mixer_channel_t
50 get_main_mix_channel(
51   jack_mixer_t mixer);
52
53 unsigned int
54 get_channels_count(
55   jack_mixer_t mixer);
56
57 unsigned int
58 get_last_midi_channel(
59   jack_mixer_t mixer);
60
61 jack_mixer_channel_t
62 add_channel(
63   jack_mixer_t mixer,
64   const char * channel_name,
65   bool stereo);
66
67 const char *
68 channel_get_name(
69   jack_mixer_channel_t channel);
70
71 /* returned values are in dBFS */
72 void
73 channel_stereo_meter_read(
74   jack_mixer_channel_t channel,
75   double * left_ptr,
76   double * right_ptr);
77
78 /* returned value is in dBFS */
79 void
80 channel_mono_meter_read(
81   jack_mixer_channel_t channel,
82   double * mono_ptr);
83
84 bool
85 channel_is_stereo(
86   jack_mixer_channel_t channel);
87
88 void
89 channel_set_midi_change_callback(
90   jack_mixer_channel_t channel,
91   void (*midi_change_callback) (void*),
92   void *user_data);
93
94 /* volume is in dBFS */
95 void
96 channel_volume_write(
97   jack_mixer_channel_t channel,
98   double volume);
99
100 double
101 channel_volume_read(
102   jack_mixer_channel_t channel);
103
104 /* balance is from -1.0 (full left) to +1.0 (full right) */
105 void
106 channel_balance_write(
107   jack_mixer_channel_t channel,
108   double balance);
109
110 double
111 channel_balance_read(
112   jack_mixer_channel_t channel);
113
114 unsigned int
115 channel_get_balance_midi_cc(
116   jack_mixer_channel_t channel);
117
118 unsigned int
119 channel_set_balance_midi_cc(
120   jack_mixer_channel_t channel,
121   unsigned int new_cc);
122
123 unsigned int
124 channel_get_volume_midi_cc(
125   jack_mixer_channel_t channel);
126
127 unsigned int
128 channel_set_volume_midi_cc(
129   jack_mixer_channel_t channel,
130   unsigned int new_cc);
131
132 void
133 remove_channel(
134   jack_mixer_channel_t channel);
135
136 /* returned value is in dBFS */
137 double
138 channel_abspeak_read(
139   jack_mixer_channel_t channel);
140
141 void
142 channel_abspeak_reset(
143   jack_mixer_channel_t channel);
144
145 void
146 channel_mute(
147   jack_mixer_channel_t channel);
148
149 void
150 channel_unmute(
151   jack_mixer_channel_t channel);
152
153 void
154 channel_solo(
155   jack_mixer_channel_t channel);
156
157 void
158 channel_unsolo(
159   jack_mixer_channel_t channel);
160
161 bool
162 channel_is_muted(
163   jack_mixer_channel_t channel);
164
165 bool
166 channel_is_soloed(
167   jack_mixer_channel_t channel);
168
169 void
170 channel_rename(
171   jack_mixer_channel_t channel,
172   const char * name);
173
174 void
175 channel_set_midi_scale(
176   jack_mixer_channel_t channel,
177   jack_mixer_scale_t scale);
178
179 jack_mixer_scale_t
180 scale_create();
181
182 bool
183 scale_add_threshold(
184   jack_mixer_scale_t scale,
185   float db,
186   float scale_value);
187
188 void
189 scale_calculate_coefficients(
190   jack_mixer_scale_t scale);
191
192 double
193 scale_db_to_scale(
194   jack_mixer_scale_t scale,
195   double db);
196
197 double
198 scale_scale_to_db(
199   jack_mixer_scale_t scale,
200   double scale_value);
201
202 void
203 scale_destroy(
204   jack_mixer_scale_t scale);
205
206 #endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */