diff options
| author | Comment <tim@gray.(none)> | 2013-07-26 22:46:17 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-07-26 22:46:17 +0100 |
| commit | f4170d6bfb763ad0af4002277a37dcd1692534d5 (patch) | |
| tree | db32d9753de780063e3afeb64764e13e5c4f5087 /rotord/src/vampHost.h | |
| parent | 3d7eea02aa7a155b84c8c74ecbfd55a1941a9297 (diff) | |
tidy files
Diffstat (limited to 'rotord/src/vampHost.h')
| -rw-r--r-- | rotord/src/vampHost.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/rotord/src/vampHost.h b/rotord/src/vampHost.h new file mode 100644 index 0000000..d1dfc81 --- /dev/null +++ b/rotord/src/vampHost.h @@ -0,0 +1,92 @@ +#include <vamp-hostsdk/PluginHostAdapter.h> +#include <vamp-hostsdk/PluginInputDomainAdapter.h> +#include <vamp-hostsdk/PluginLoader.h> + +#include "Poco/Mutex.h" + +#include <iostream> +#include <fstream> +#include <set> +#include <sndfile.h> + +#include <cstring> +#include <cstdlib> + +#include "system.h" + +#include <cmath> + +/* +line 366: is returnValue the fail/succeed return value? +*/ + +using namespace std; + +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" + +namespace vampHost { + + class Settings{ + public: + Settings(string _so="",string _filter="",string _input="") { + soname=_so; + filtername=_filter; + inputFile=_input; + } + string soname; + string filtername; + string inputFile; + }; + class QMAnalyser{ + public: + int process(const string soundfile); + float get_progress(); + vector<float> beats; + private: + float progress; + Poco::Mutex mutex; //lock for progress data + }; + class Analyser{ + //can load any vamp analysis plugin and present its data with a unified interface + public: + bool init(const string &soname,const string &id,const int &_channels,const int &_bits,const int &_samples,const int &_rate,int outputNo,const map<string,float> ¶ms); + void process_frame(uint8_t *data,int samples_in_frame); + void cleanup(); + + map<double,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 + + private: + PluginLoader *loader; + PluginLoader::PluginKey key; + 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; + string output; + float **plugbuf; + + int featureNo; + + }; + + string getQMBeats(const string soundfile); + void printFeatures(int, int, int, Plugin::FeatureSet, ostream &, bool frames); + void getTimestamps(int output,Plugin::FeatureSet features, vector<float>& out); + int runPlugin(string myname, string soname, string id, string output,int outputNo, string inputFile, ostream& out, bool frames); + + int rotorRunPlugin(string soname, string id, string output,int outputNo, string inputFile, vector<float>& out, float& progress); + void rotorGetFeatures(int frame, int sr, int output,Plugin::FeatureSet features, vector<float>& out, float& progress); + +} |
