annotate 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
rev   line source
cannam@17 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@17 2
cannam@17 3 /*
cannam@17 4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
cannam@17 5
cannam@17 6 Centre for Digital Music, Queen Mary, University of London.
cannam@17 7 This file copyright 2006 Chris Cannam.
cannam@17 8
cannam@17 9 This program is free software; you can redistribute it and/or
cannam@17 10 modify it under the terms of the GNU General Public License as
cannam@17 11 published by the Free Software Foundation; either version 2 of the
cannam@17 12 License, or (at your option) any later version. See the file
cannam@17 13 COPYING included with this distribution for more information.
cannam@17 14
cannam@17 15 */
cannam@17 16
cannam@17 17 #ifndef _SILENCE_PLUGIN_H_
cannam@17 18 #define _SILENCE_PLUGIN_H_
cannam@17 19
cannam@17 20 #include <vamp-sdk/Plugin.h>
cannam@17 21 #include <aubio/aubio.h>
cannam@17 22
cannam@17 23 class Silence : public Vamp::Plugin
cannam@17 24 {
cannam@17 25 public:
cannam@20 26 Silence(float inputSampleRate, unsigned int apiVersion);
cannam@17 27 virtual ~Silence();
cannam@17 28
cannam@17 29 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@17 30 void reset();
cannam@17 31
cannam@17 32 InputDomain getInputDomain() const { return TimeDomain; }
cannam@17 33
cannam@17 34 std::string getIdentifier() const;
cannam@17 35 std::string getName() const;
cannam@17 36 std::string getDescription() const;
cannam@17 37 std::string getMaker() const;
cannam@17 38 int getPluginVersion() const;
cannam@17 39 std::string getCopyright() const;
cannam@17 40
cannam@17 41 ParameterList getParameterDescriptors() const;
cannam@17 42 float getParameter(std::string) const;
cannam@17 43 void setParameter(std::string, float);
cannam@17 44
cannam@17 45 size_t getPreferredStepSize() const;
cannam@17 46 size_t getPreferredBlockSize() const;
cannam@17 47
cannam@17 48 OutputList getOutputDescriptors() const;
cannam@17 49
cannam@17 50 FeatureSet process(const float *const *inputBuffers,
cannam@17 51 Vamp::RealTime timestamp);
cannam@17 52
cannam@17 53 FeatureSet getRemainingFeatures();
cannam@17 54
cannam@17 55 protected:
cannam@20 56 unsigned int m_apiVersion;
cannam@17 57 fvec_t *m_ibuf;
cannam@17 58 fvec_t *m_pbuf;
cannam@17 59 smpl_t **m_tmpptrs;
cannam@17 60 float m_threshold;
cannam@17 61 size_t m_stepSize;
cannam@17 62 size_t m_blockSize;
cannam@17 63 size_t m_channelCount;
cannam@17 64 bool m_prevSilent;
cannam@17 65 bool m_first;
cannam@20 66 Vamp::RealTime m_lastChange;
cannam@20 67 Vamp::RealTime m_lastTimestamp;
cannam@17 68 };
cannam@17 69
cannam@17 70
cannam@17 71 #endif