comparison runner/LabFeatureWriter.h @ 160:2a399bed0184

Merge from branch "labfile"
author Chris Cannam
date Wed, 15 Oct 2014 11:23:05 +0100
parents 946115b8badd
children 59abb58b1855
comparison
equal deleted inserted replaced
148:04945e74d314 160:2a399bed0184
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6
7 Sonic Annotator
8 A utility for batch feature extraction from audio files.
9
10 Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London.
11 Copyright 2007-2008 QMUL.
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version. See the file
17 COPYING included with this distribution for more information.
18 */
19
20 #ifndef _LAB_FEATURE_WRITER_H_
21 #define _LAB_FEATURE_WRITER_H_
22
23 #include <string>
24 #include <map>
25 #include <set>
26
27 #include <QString>
28
29 #include "transform/FileFeatureWriter.h"
30
31 using std::string;
32 using std::map;
33
34 class QTextStream;
35 class QFile;
36
37 class LabFeatureWriter : public FileFeatureWriter
38 {
39 public:
40 LabFeatureWriter();
41 virtual ~LabFeatureWriter();
42
43 virtual string getDescription() const;
44
45 virtual ParameterList getSupportedParameters() const;
46 virtual void setParameters(map<string, string> &params);
47
48 virtual void write(QString trackid,
49 const Transform &transform,
50 const Vamp::Plugin::OutputDescriptor &output,
51 const Vamp::Plugin::FeatureList &features,
52 std::string summaryType = "");
53
54 virtual void finish();
55
56 virtual QString getWriterTag() const { return "lab"; }
57
58 private:
59 bool m_forceEnd;
60
61 typedef map<TrackTransformPair, Vamp::Plugin::Feature> PendingFeatures;
62 PendingFeatures m_pending;
63
64 void writeFeature(QTextStream &,
65 const Vamp::Plugin::Feature &f,
66 const Vamp::Plugin::Feature *optionalNextFeature);
67 };
68
69 #endif