#include #include #include #include "Poco/Mutex.h" #include #include #include #include #include #include #include "system.h" #include /* 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 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 ¶ms); void process_frame(uint8_t *data,int samples_in_frame); void cleanup(); map features; //map //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& 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& out, float& progress); void rotorGetFeatures(int frame, int sr, int output,Plugin::FeatureSet features, vector& out, float& progress); }