Makefile: [fix] clean: do not fail
[ng-jackspa.git] / control.h
blob2f6fbd2dba8250267b965b1920e81d020b09933f
1 /* control.h - API for interfaces to the controls of a jackspa plugin instance
2 * Copyright © 2013 Géraud Meyer <graud@gmx.com>
4 * control.h is part of ng-jackspa.
6 * ng-jackspa is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CONTROL_H
20 #define CONTROL_H
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 #include <ladspa.h>
26 #include "jackspa.h"
28 enum ctype {
29 JACKSPA_FLOAT,
30 JACKSPA_INT,
31 JACKSPA_TOGGLE
34 typedef struct {
35 unsigned long port;
36 const char *name;
37 const LADSPA_PortDescriptor *desc;
38 const LADSPA_PortRangeHint *hint;
39 /* value in the plugin */
40 LADSPA_Data *val;
41 /* values selected in the interface */
42 LADSPA_Data sel;
43 /* value range */
44 LADSPA_Data min;
45 LADSPA_Data max;
46 LADSPA_Data *def;
47 enum ctype type;
48 struct { LADSPA_Data fine; LADSPA_Data coarse; } inc;
49 } control_t;
52 /* Return a value close to val that is valid for the given control */
53 /* val is supposed to be inside the min/max of control */
54 LADSPA_Data control_rounding(const control_t *control, LADSPA_Data val);
56 /* Exchange the selected and the active values */
57 void control_exchange(control_t *control);
59 /* Compute the type, the bounds, the default value and the increments */
60 int control_init(control_t *control, state_t *state, unsigned long port);
62 #ifdef __cplusplus
63 } /* extern "C" */
64 #endif
65 #endif