DSSIControlDescription.h (2170B)
1 /* 2 ZynAddSubFX - a software synthesizer 3 4 DSSIControlDescription.h - Description of DSSI control ports 5 Copyright (C) 2015 Olivier Jolly 6 Author: Olivier Jolly 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 */ 13 14 #ifndef ZYNADDSUBFX_DSSICONTROLDESCRIPTION_H 15 #define ZYNADDSUBFX_DSSICONTROLDESCRIPTION_H 16 17 18 #include <globals.h> 19 #include <ladspa.h> 20 21 /** 22 * DSSIControlDescription represent one instance of DSSI control used to describe accepted values to the DSSI host 23 * and to forward DSSI host value change to ZynAddSubFx controller 24 */ 25 struct DSSIControlDescription { 26 27 const static int MAX_DSSI_CONTROLS = 12; 28 29 const zyn::MidiControllers controller_code; /// controller code, as accepted by the Controller class 30 const char *name; /// human readable name of this control 31 32 /** hint about usable range of value for this control, defaulting to 0-128, initially at 64 */ 33 const LADSPA_PortRangeHint port_range_hint = { 34 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_MIDDLE, 0, 128}; 35 36 /** 37 * Ctr for a DSSIControlDescription using the default hint (0-128 starting at 64) 38 * @param controller_code the controller code 39 * @param name the human readable code name 40 */ 41 DSSIControlDescription(zyn::MidiControllers controller_code, const char *name) : 42 controller_code(controller_code), 43 name(name) { } 44 45 /** 46 * Ctr for a DSSIControlDescription 47 * @param controller_code the controller code 48 * @param name the human readable code name 49 * @param port_range_hint the accepted range of values 50 */ 51 DSSIControlDescription(zyn::MidiControllers controller_code, const char *name, LADSPA_PortRangeHint port_range_hint) : 52 controller_code(controller_code), name(name), port_range_hint(port_range_hint) { } 53 54 }; 55 56 extern const DSSIControlDescription dssi_control_description[DSSIControlDescription::MAX_DSSI_CONTROLS]; 57 58 #endif //ZYNADDSUBFX_DSSICONTROLDESCRIPTION_H