1 /*
2  * Author: Harry van Haaren 2014
3  *         harryhaaren@gmail.com
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  * MA 02110-1301, USA.
19  */
20 
21 #ifndef OPENAV_DRIVA
22 #define OPENAV_DRIVA
23 
24 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
25 
26 #define DRIVA_URI    "http://www.openavproductions.com/artyfx#driva"
27 #define DRIVA_UI_URI "http://www.openavproductions.com/artyfx#driva/gui"
28 
29 typedef enum {
30 	// Audio
31 	INPUT = 0,
32 	OUTPUT,
33 
34 	// Top signal
35 	DRIVA_TONE,
36 	DRIVA_AMOUNT,
37 
38 } DrivaPortIndex;
39 
40 class StompBox;
41 
42 class Driva
43 {
44 public:
45 	Driva(int rate);
46 	~Driva();
47 	static LV2_Handle instantiate(const LV2_Descriptor* descriptor,
48 	                              double samplerate,
49 	                              const char* bundle_path,
50 	                              const LV2_Feature* const* features);
51 	static void activate(LV2_Handle instance);
52 	static void deactivate(LV2_Handle instance);
53 	static void connect_port(LV2_Handle instance, uint32_t port, void *data);
54 	static void run(LV2_Handle instance, uint32_t n_samples);
55 	static void cleanup(LV2_Handle instance);
56 	static const void* extension_data(const char* uri);
57 
58 	/// audio buffers
59 	float* audioInput;
60 	float* audioOutput;
61 
62 	/// control values
63 	float* controlWave1type;
64 	float* controlWave1amount;
65 
66 	float* controlOutputVol;
67 
68 private:
69 	/// history variables for Stompbox presets
70 	int wave1type;
71 
72 	StompBox* dspStompbox1;
73 };
74 
75 #endif // OPENAV_DRIVA
76