Chris@320: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@320: Chris@320: /* Chris@320: Sonic Visualiser Chris@320: An audio file viewer and annotation editor. Chris@320: Centre for Digital Music, Queen Mary, University of London. Chris@320: This file copyright 2006 Chris Cannam and QMUL. Chris@320: Chris@320: This program is free software; you can redistribute it and/or Chris@320: modify it under the terms of the GNU General Public License as Chris@320: published by the Free Software Foundation; either version 2 of the Chris@320: License, or (at your option) any later version. See the file Chris@320: COPYING included with this distribution for more information. Chris@320: */ Chris@320: Chris@328: #ifndef _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ Chris@328: #define _FEATURE_EXTRACTION_PLUGIN_TRANSFORMER_H_ Chris@320: Chris@328: #include "PluginTransformer.h" Chris@320: Chris@320: class DenseTimeValueModel; Chris@320: Chris@328: class FeatureExtractionPluginTransformer : public PluginTransformer Chris@320: { Chris@320: Q_OBJECT Chris@320: Chris@320: public: Chris@328: FeatureExtractionPluginTransformer(Model *inputModel, Chris@328: QString plugin, Chris@328: const ExecutionContext &context, Chris@328: QString configurationXml = "", Chris@328: QString outputName = ""); Chris@328: virtual ~FeatureExtractionPluginTransformer(); Chris@320: Chris@320: protected: Chris@320: virtual void run(); Chris@320: Chris@320: Vamp::Plugin *m_plugin; Chris@320: Vamp::Plugin::OutputDescriptor *m_descriptor; Chris@320: int m_outputFeatureNo; Chris@320: Chris@320: void addFeature(size_t blockFrame, Chris@320: const Vamp::Plugin::Feature &feature); Chris@320: Chris@320: void setCompletion(int); Chris@320: Chris@320: void getFrames(int channel, int channelCount, Chris@320: long startFrame, long size, float *buffer); Chris@320: Chris@320: // just casts Chris@320: DenseTimeValueModel *getInput(); Chris@320: template ModelClass *getOutput() { Chris@320: ModelClass *mc = dynamic_cast(m_output); Chris@320: if (!mc) { Chris@328: std::cerr << "FeatureExtractionPluginTransformer::getOutput: Output model not conformable" << std::endl; Chris@320: } Chris@320: return mc; Chris@320: } Chris@320: }; Chris@320: Chris@320: #endif Chris@320: