Mercurial > hg > vamp-aubio-plugins
comparison plugins/Silence.h @ 20:8c939fff7ee1
* First bit of Vamp v2 work -- add an optional duration to features in
a backward compatible way.
Warning: this code is unstable and experimental and may change
significantly in the coming weeks.
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 17 Jul 2008 08:51:13 +0000 |
parents | b85fbc77677b |
children | 2e979622bd93 |
comparison
equal
deleted
inserted
replaced
19:713c8b6fbf81 | 20:8c939fff7ee1 |
---|---|
21 #include <aubio/aubio.h> | 21 #include <aubio/aubio.h> |
22 | 22 |
23 class Silence : public Vamp::Plugin | 23 class Silence : public Vamp::Plugin |
24 { | 24 { |
25 public: | 25 public: |
26 Silence(float inputSampleRate); | 26 Silence(float inputSampleRate, unsigned int apiVersion); |
27 virtual ~Silence(); | 27 virtual ~Silence(); |
28 | 28 |
29 bool initialise(size_t channels, size_t stepSize, size_t blockSize); | 29 bool initialise(size_t channels, size_t stepSize, size_t blockSize); |
30 void reset(); | 30 void reset(); |
31 | 31 |
51 Vamp::RealTime timestamp); | 51 Vamp::RealTime timestamp); |
52 | 52 |
53 FeatureSet getRemainingFeatures(); | 53 FeatureSet getRemainingFeatures(); |
54 | 54 |
55 protected: | 55 protected: |
56 unsigned int m_apiVersion; | |
56 fvec_t *m_ibuf; | 57 fvec_t *m_ibuf; |
57 fvec_t *m_pbuf; | 58 fvec_t *m_pbuf; |
58 smpl_t **m_tmpptrs; | 59 smpl_t **m_tmpptrs; |
59 float m_threshold; | 60 float m_threshold; |
60 size_t m_stepSize; | 61 size_t m_stepSize; |
61 size_t m_blockSize; | 62 size_t m_blockSize; |
62 size_t m_channelCount; | 63 size_t m_channelCount; |
63 bool m_prevSilent; | 64 bool m_prevSilent; |
64 bool m_first; | 65 bool m_first; |
66 Vamp::RealTime m_lastChange; | |
67 Vamp::RealTime m_lastTimestamp; | |
65 }; | 68 }; |
66 | 69 |
67 | 70 |
68 #endif | 71 #endif |