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
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/>.
39 const LADSPA_PortDescriptor
*desc
;
40 const LADSPA_PortRangeHint
*hint
;
41 /* value in the plugin */
43 /* values selected in the interface */
50 struct { LADSPA_Data fine
; LADSPA_Data coarse
; } inc
;
54 /* Return a value close to val that is valid for the given control */
55 /* val is supposed to be inside the min/max of control */
56 LADSPA_Data
control_rounding(const control_t
*control
, LADSPA_Data val
);
58 /* Exchange the selected and the active values */
59 void control_exchange(control_t
*control
);
62 /* Initial config (command line switches) */
63 extern const GOptionEntry control_entries
[];
65 /* Compute the type, the bounds, the default value and the increments */
66 int control_init(control_t
*control
, state_t
*state
, unsigned long port
,
70 /* Array of pointers */
71 /* Using an array type would be invalid C++ */
72 typedef control_t
**controls_t
;
74 /* Allocate an array *controls and initialise it with allocated controls (and
75 * set *count to the number of controls) */
76 int control_buildall(unsigned long *count
, controls_t
*controls
, state_t
*state
);
78 /* Deallocate the array *controls */
79 void control_cleanupall(unsigned long count
, controls_t
*controls
);