Chris@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@0: Sonic Annotator Chris@0: A utility for batch feature extraction from audio files. Chris@0: Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. Chris@0: Copyright 2007-2008 QMUL. Chris@0: Chris@0: This program is free software; you can redistribute it and/or Chris@0: modify it under the terms of the GNU General Public License as Chris@0: published by the Free Software Foundation; either version 2 of the Chris@0: License, or (at your option) any later version. See the file Chris@0: COPYING included with this distribution for more information. Chris@0: */ Chris@0: Chris@0: #ifndef _AUDIO_DB_FEATURE_WRITER_H_ Chris@0: #define _AUDIO_DB_FEATURE_WRITER_H_ Chris@0: Chris@0: #include Chris@0: #include Chris@0: Chris@0: using std::string; Chris@0: using std::map; Chris@0: Chris@0: #include "transform/FeatureWriter.h" Chris@0: Chris@0: class AudioDBFeatureWriter : public FeatureWriter Chris@0: { Chris@0: public: Chris@0: AudioDBFeatureWriter(); Chris@0: virtual ~AudioDBFeatureWriter(); Chris@0: Chris@0: virtual ParameterList getSupportedParameters() const; Chris@0: virtual void setParameters(map ¶ms); Chris@0: Chris@0: virtual void setCatalogueId(const string &); Chris@0: virtual void setBaseDirectory(const string &); Chris@0: Chris@0: virtual void write(QString trackid, Chris@0: const Transform &transform, Chris@0: const Vamp::Plugin::OutputDescriptor &output, Chris@0: const Vamp::Plugin::FeatureList &features, Chris@0: std::string summaryType = ""); Chris@0: Chris@0: virtual void finish() { } Chris@0: Chris@0: private: Chris@0: string catalogueId; Chris@0: string baseDir; Chris@0: Chris@0: static string catalogueIdParam; Chris@0: static string baseDirParam; Chris@0: Chris@0: struct TrackStream; Chris@0: map dbfiles; Chris@0: Chris@0: bool openDBFile(QString trackid, const string& identifier); Chris@0: bool replaceDBFile(QString trackid, const string& identifier); Chris@0: }; Chris@0: Chris@0: #endif