comparison runner/AudioDBFeatureWriter.h @ 1:92911f967a16

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