annotate runner/AudioDBFeatureWriter.h @ 100:010fbf2a3fba

Merge from branch start-duration
author Chris Cannam
date Wed, 01 Oct 2014 14:35:01 +0100
parents 18c42fbc1335
children b3d73c08b6ce
rev   line source
Chris@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@0 4 Sonic Annotator
Chris@0 5 A utility for batch feature extraction from audio files.
Chris@0 6 Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London.
Chris@0 7 Copyright 2007-2008 QMUL.
Chris@0 8
Chris@0 9 This program is free software; you can redistribute it and/or
Chris@0 10 modify it under the terms of the GNU General Public License as
Chris@0 11 published by the Free Software Foundation; either version 2 of the
Chris@0 12 License, or (at your option) any later version. See the file
Chris@0 13 COPYING included with this distribution for more information.
Chris@0 14 */
Chris@0 15
Chris@0 16 #ifndef _AUDIO_DB_FEATURE_WRITER_H_
Chris@0 17 #define _AUDIO_DB_FEATURE_WRITER_H_
Chris@0 18
Chris@0 19 #include <string>
Chris@0 20 #include <map>
Chris@0 21
Chris@0 22 using std::string;
Chris@0 23 using std::map;
Chris@0 24
Chris@0 25 #include "transform/FeatureWriter.h"
Chris@0 26
Chris@0 27 class AudioDBFeatureWriter : public FeatureWriter
Chris@0 28 {
Chris@0 29 public:
Chris@0 30 AudioDBFeatureWriter();
Chris@0 31 virtual ~AudioDBFeatureWriter();
Chris@0 32
Chris@0 33 virtual ParameterList getSupportedParameters() const;
Chris@0 34 virtual void setParameters(map<string, string> &params);
Chris@0 35
Chris@0 36 virtual void setCatalogueId(const string &);
Chris@0 37 virtual void setBaseDirectory(const string &);
Chris@0 38
Chris@0 39 virtual void write(QString trackid,
Chris@0 40 const Transform &transform,
Chris@0 41 const Vamp::Plugin::OutputDescriptor &output,
Chris@0 42 const Vamp::Plugin::FeatureList &features,
Chris@0 43 std::string summaryType = "");
Chris@0 44
Chris@0 45 virtual void finish() { }
Chris@0 46
Chris@24 47 virtual QString getWriterTag() const { return "audiodb"; }
Chris@24 48
Chris@0 49 private:
Chris@0 50 string catalogueId;
Chris@0 51 string baseDir;
Chris@0 52
Chris@0 53 static string catalogueIdParam;
Chris@0 54 static string baseDirParam;
Chris@0 55
Chris@0 56 struct TrackStream;
Chris@0 57 map<string, TrackStream> dbfiles;
Chris@0 58
Chris@0 59 bool openDBFile(QString trackid, const string& identifier);
Chris@0 60 bool replaceDBFile(QString trackid, const string& identifier);
Chris@0 61 };
Chris@0 62
Chris@0 63 #endif