Mercurial > hg > devuvuzelator
comparison devuvuzelator-vst.h @ 9:a1539d4e3b08
* Tidy code, start doc
author | Chris Cannam |
---|---|
date | Sat, 12 Jun 2010 13:08:33 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
8:e15ebd222c63 | 9:a1539d4e3b08 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 #ifndef _DEVUVUZELATOR_VST_H_ | |
4 #define _DEVUVUZELATOR_VST_H_ | |
5 | |
6 #include "public.sdk/source/vst2.x/audioeffect.h" | |
7 #include "median.h" | |
8 | |
9 class Devuvuzelator : public AudioEffect | |
10 { | |
11 enum { | |
12 FundamentalParam = 0, | |
13 BandwidthParam = 1, | |
14 HarmonicsParam = 2, | |
15 ReductionParam = 3, | |
16 NumParams = 4 | |
17 }; | |
18 | |
19 public: | |
20 Devuvuzelator(audioMasterCallback cb); | |
21 ~Devuvuzelator(); | |
22 | |
23 virtual void getEffectName(char *n) { | |
24 vst_strncpy(n, "Devuvuzelator", kVstMaxEffectNameLen); | |
25 } | |
26 virtual void getProductString(char *n) { | |
27 vst_strncpy(n, "Devuvuzelator", kVstMaxProductStrLen); | |
28 } | |
29 virtual void getVendorString(char *n) { | |
30 vst_strncpy(n, "Queen Mary, University of London", kVstMaxVendorStrLen); | |
31 } | |
32 | |
33 virtual void setParameter(VstInt32 index, float value); | |
34 virtual float getParameter(VstInt32 index); | |
35 virtual void getParameterLabel(VstInt32 index, char* label); | |
36 virtual void getParameterDisplay(VstInt32 index, char* text); | |
37 virtual void getParameterName(VstInt32 index, char* text); | |
38 | |
39 virtual void setSampleRate (float sampleRate) { | |
40 m_sampleRate = sampleRate; | |
41 AudioEffect::setSampleRate(sampleRate); | |
42 } | |
43 | |
44 virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) { | |
45 m_input = inputs[0]; | |
46 m_output = outputs[0]; | |
47 runImpl(sampleFrames); | |
48 } | |
49 | |
50 void reset(); | |
51 void window(float *); | |
52 void runImpl(unsigned long); | |
53 void processFrame(); | |
54 void processSpectralFrame(); | |
55 | |
56 static void fft(unsigned int n, bool inverse, | |
57 double *ri, double *ii, double *ro, double *io); | |
58 | |
59 float m_sampleRate; | |
60 float *m_input; | |
61 float *m_output; | |
62 | |
63 float m_fundamental; | |
64 float m_bandwidth; | |
65 int m_harmonics; | |
66 float m_reduction; | |
67 | |
68 const int m_fftsize; | |
69 const int m_winsize; | |
70 const int m_increment; | |
71 const float m_filtersecs; | |
72 int m_fill; | |
73 int m_read; | |
74 float *m_buffer; | |
75 float *m_outacc; | |
76 double *m_frame; | |
77 double *m_spare; | |
78 double *m_real; | |
79 double *m_imag; | |
80 double *m_window; | |
81 MedianFilter<double> **m_medians; | |
82 }; | |
83 | |
84 #endif |