1 /* 2 Copyright (C) 2009-2010 Fons Adriaensen <fons@kokkinizita.net> 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 */ 18 19 20 #ifndef __AMBISONIC0_H 21 #define __AMBISONIC0_H 22 23 24 #include "ladspaplugin.h" 25 #include "virtmic.h" 26 #include "allpass.h" 27 28 29 30 class Ladspa_Tricard2amb : public LadspaPlugin 31 { 32 public: 33 34 enum { INP_L, INP_R, INP_B, OUT_W, OUT_X, OUT_Y, OUT_Z, NPORT }; 35 Ladspa_Tricard2amb(unsigned long fsam)36 Ladspa_Tricard2amb (unsigned long fsam) : LadspaPlugin (fsam) {} 37 virtual void setport (unsigned long port, LADSPA_Data *data); 38 virtual void active (bool act); 39 virtual void runproc (unsigned long len, bool add); ~Ladspa_Tricard2amb(void)40 virtual ~Ladspa_Tricard2amb (void) {} 41 42 private: 43 44 float *_port [NPORT]; 45 }; 46 47 48 49 class Ladspa_Virtualmic : public LadspaPlugin 50 { 51 public: 52 53 enum { INP_W, INP_X, INP_Y, INP_Z, OUT_L, OUT_R, 54 CTL_ELEV, CTL_AZIM, CTL_ANGLE, CTL_POLAR, NPORT }; 55 Ladspa_Virtualmic(unsigned long fsam)56 Ladspa_Virtualmic (unsigned long fsam) : LadspaPlugin (fsam) {} 57 virtual void setport (unsigned long port, LADSPA_Data *data); 58 virtual void active (bool act); 59 virtual void runproc (unsigned long len, bool add); ~Ladspa_Virtualmic(void)60 virtual ~Ladspa_Virtualmic (void) {} 61 62 private: 63 64 float *_port [NPORT]; 65 Virtmic _vmic; 66 }; 67 68 69 70 class Ladspa_UHJ_encoder : public LadspaPlugin 71 { 72 public: 73 74 enum { INP_W, INP_X, INP_Y, INP_Z, OUT_L, OUT_R, NPORT }; 75 76 Ladspa_UHJ_encoder (unsigned long fsam); 77 virtual void setport (unsigned long port, LADSPA_Data *data); 78 virtual void active (bool act); 79 virtual void runproc (unsigned long len, bool add); ~Ladspa_UHJ_encoder(void)80 virtual ~Ladspa_UHJ_encoder (void) {} 81 82 private: 83 84 float *_port [NPORT]; 85 bool _err; 86 Allpass22 _Wfilt_r, _Wfilt_i; 87 Allpass22 _Xfilt_r, _Xfilt_i; 88 Allpass22 _Yfilt_r; 89 }; 90 91 92 93 class Ladspa_UHJ_decoder : public LadspaPlugin 94 { 95 public: 96 97 enum { INP_L, INP_R, OUT_W, OUT_X, OUT_Y, OUT_Z, NPORT }; 98 99 Ladspa_UHJ_decoder (unsigned long fsam); 100 virtual void setport (unsigned long port, LADSPA_Data *data); 101 virtual void active (bool act); 102 virtual void runproc (unsigned long len, bool add); ~Ladspa_UHJ_decoder(void)103 virtual ~Ladspa_UHJ_decoder (void) {} 104 105 private: 106 107 float *_port [NPORT]; 108 bool _err; 109 Allpass22 _Lfilt_r, _Lfilt_i; 110 Allpass22 _Rfilt_r, _Rfilt_i; 111 }; 112 113 114 #endif 115