1 /* 2 * Author: Harry van Haaren 2013 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_FILTA 22 #define OPENAV_FILTA 23 24 #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 25 26 #define FILTA_URI "http://www.openavproductions.com/artyfx#filta" 27 #define FILTA_UI_URI "http://www.openavproductions.com/artyfx#filta/gui" 28 29 typedef enum { 30 FILTA_INPUT_L = 0, 31 FILTA_INPUT_R, 32 33 FILTA_OUTPUT_L, 34 FILTA_OUTPUT_R, 35 36 FILTA_FREQ_CONTROL, 37 FILTA_ACTIVE, 38 } FiltaPortIndex; 39 40 #include "dsp_filters.hxx" 41 42 class Filta 43 { 44 public: 45 Filta(int rate); ~Filta()46 ~Filta() {} 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* audioInputL; 60 float* audioInputR; 61 float* audioOutputL; 62 float* audioOutputR; 63 64 /// control signals 65 float* freqControl; 66 float* activeControl; 67 68 private: 69 Filters dspFilters; 70 }; 71 72 #endif // OPENAV_FILTA 73