diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-05-29 13:24:40 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-05-29 13:24:40 +0100 |
| commit | 296e1ecf1d4402166bb0d958980f8bf0faba4f5f (patch) | |
| tree | 589c36da53d07243f6cb3ae65d3d32a423785eba /src/ofxVamphost.h | |
| parent | 40aef5fefdb5e0f25ccd67d61e1556997560f396 (diff) | |
various
Diffstat (limited to 'src/ofxVamphost.h')
| -rw-r--r-- | src/ofxVamphost.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/ofxVamphost.h b/src/ofxVamphost.h new file mode 100644 index 0000000..245b7ff --- /dev/null +++ b/src/ofxVamphost.h @@ -0,0 +1,64 @@ +#ifndef OFXVAMPHOST_H_ +#define OFXVAMPHOST_H_ + +#include <vamp-hostsdk/PluginHostAdapter.h> +#include <vamp-hostsdk/PluginInputDomainAdapter.h> +#include <vamp-hostsdk/PluginLoader.h> + +#include <map> +#include <math.h> +#include <sndfile.h> + +using Vamp::Plugin; +using Vamp::PluginHostAdapter; +using Vamp::RealTime; +using Vamp::HostExt::PluginLoader; +using Vamp::HostExt::PluginWrapper; +using Vamp::HostExt::PluginInputDomainAdapter; + +#define HOST_VERSION "1.5" + +class Vamphost{ + //can load any vamp analysis plugin and present its data with a unified interface + public: + Vamphost(); + int init(const std::string &soname,const std::string &id,const int &_channels,const int &_rate,const int &_outputNo=0,const std::string &_output=""); + int init(int whichplugin,const int &_channels,const int &_rate,const int &_outputNo=0,const std::string &_output=""); + int init(const int &_channels,const int &_rate,const int &_outputNo=0,const std::string &_output=""); + int init(int whichplugin); + int init(); + void process_frame(float *data,int samples_in_frame); + void cleanup(); + + std::map<float,int> features; + //map<time,featureNo> + //this is the best way to store features: because map allows to search for the key below and above the present time + int getRT(); + + float avg; + int num; + int numFeat; + + PluginLoader::PluginKey key; + PluginLoader::PluginKeyList list; + + private: + + PluginLoader *loader; + Plugin *plugin; + RealTime rt; + int channels,bits,samples,rate; + int bytes,stride; + float scale; + int blockSize,stepSize,overlapSize,finalStepsRemaining,currentStep,outputNo; + int in_block,blocks_processed; + std::string output; + float **plugbuf; + + int featureNo; + + +}; + +#endif + |
