1 /* ======================================== 2 * Compresaturator - Compresaturator.h 3 * Created 8/12/11 by SPIAdmin 4 * Copyright (c) 2011 __MyCompanyName__, All rights reserved 5 * ======================================== */ 6 7 #ifndef __Compresaturator_H 8 #define __Compresaturator_H 9 10 #ifndef __audioeffect__ 11 #include "airwindows/AirWinBaseClass.h" 12 #endif 13 14 #include <set> 15 #include <string> 16 #include <math.h> 17 18 namespace Compresaturator { 19 20 enum { 21 kParamA = 0, 22 kParamB = 1, 23 kParamC = 2, 24 kParamD = 3, 25 kParamE = 4, 26 kNumParameters = 5 27 }; // 28 29 const int kNumPrograms = 0; 30 const int kNumInputs = 2; 31 const int kNumOutputs = 2; 32 const unsigned long kUniqueId = 'cmsr'; //Change this to what the AU identity is! 33 34 class Compresaturator : 35 public AudioEffectX 36 { 37 public: 38 Compresaturator(audioMasterCallback audioMaster); 39 ~Compresaturator(); 40 virtual bool getEffectName(char* name); // The plug-in name 41 virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in 42 virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg 43 virtual bool getVendorString(char* text); // Vendor info 44 virtual VstInt32 getVendorVersion(); // Version number 45 virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); 46 virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); 47 virtual void getProgramName(char *name); // read the name from the host 48 virtual void setProgramName(char *name); // changes the name of the preset displayed in the host 49 virtual VstInt32 getChunk (void** data, bool isPreset); 50 virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); 51 virtual float getParameter(VstInt32 index); // get the parameter value at the specified index 52 virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value 53 virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) 54 virtual void getParameterName(VstInt32 index, char *text); // name of the parameter 55 virtual void getParameterDisplay(VstInt32 index, char *text, float extVal, bool isExternal); // text description of the current value 56 virtual VstInt32 canDo(char *text); 57 bool parseParameterValueFromString(VstInt32 index, const char* txt, float& f); 58 bool isParameterBipolar(VstInt32 index); 59 60 private: 61 char _programName[kVstMaxProgNameLen + 1]; 62 std::set< std::string > _canDo; 63 64 uint32_t fpd; 65 //default stuff 66 67 int dCount; 68 69 float dL[11000]; 70 int lastWidthL; 71 double padFactorL; 72 73 float dR[11000]; 74 int lastWidthR; 75 double padFactorR; 76 77 float A; 78 float B; 79 float C; 80 float D; 81 float E; //parameters. Always 0-1, and we scale/alter them elsewhere. 82 83 }; 84 85 } // end namespace Compresaturator 86 87 #endif 88