comparison examples/SpectralCentroid.cpp @ 21:16eeab18bf72

* tidy * build to vamp-example-plugins.so
author cannam
date Fri, 14 Apr 2006 09:37:46 +0000
parents 08ee18123f5a
children 3bbe244611bb
comparison
equal deleted inserted replaced
20:68b8b32a2070 21:16eeab18bf72
45 45
46 46
47 SpectralCentroid::SpectralCentroid(float inputSampleRate) : 47 SpectralCentroid::SpectralCentroid(float inputSampleRate) :
48 Plugin(inputSampleRate), 48 Plugin(inputSampleRate),
49 m_stepSize(0), 49 m_stepSize(0),
50 m_blockSize(0), 50 m_blockSize(0)
51 m_workBuffer(0)
52 { 51 {
53 } 52 }
54 53
55 SpectralCentroid::~SpectralCentroid() 54 SpectralCentroid::~SpectralCentroid()
56 { 55 {
57 delete m_workBuffer;
58 } 56 }
59 57
60 string 58 string
61 SpectralCentroid::getName() const 59 SpectralCentroid::getName() const
62 { 60 {
94 channels > getMaxChannelCount()) return false; 92 channels > getMaxChannelCount()) return false;
95 93
96 m_stepSize = stepSize; 94 m_stepSize = stepSize;
97 m_blockSize = blockSize; 95 m_blockSize = blockSize;
98 96
99 delete m_workBuffer;
100 m_workBuffer = new double[m_blockSize * 4];
101
102 return true; 97 return true;
103 } 98 }
104 99
105 void 100 void
106 SpectralCentroid::reset() 101 SpectralCentroid::reset()
107 { 102 {
108 delete m_workBuffer;
109 m_workBuffer = new double[m_blockSize * 4];
110 } 103 }
111 104
112 SpectralCentroid::OutputList 105 SpectralCentroid::OutputList
113 SpectralCentroid::getOutputDescriptors() const 106 SpectralCentroid::getOutputDescriptors() const
114 { 107 {