comparison runner/FeatureWriterFactory.cpp @ 1:92911f967a16

* some reorganisation
author Chris Cannam
date Thu, 11 Dec 2008 10:26:12 +0000
parents FeatureWriterFactory.cpp@581b1b150a4d
children 2260947be4aa
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
17 #include "FeatureWriterFactory.h"
18
19 #include "DefaultFeatureWriter.h"
20 #include "rdf/RDFFeatureWriter.h"
21 #include "AudioDBFeatureWriter.h"
22 #include "transform/CSVFeatureWriter.h"
23
24 set<string>
25 FeatureWriterFactory::getWriterTags()
26 {
27 set<string> tags;
28 tags.insert("default");
29 tags.insert("rdf");
30 tags.insert("audiodb");
31 tags.insert("csv");
32 return tags;
33 }
34
35 FeatureWriter *
36 FeatureWriterFactory::createWriter(string tag)
37 {
38 if (tag == "default") {
39 return new DefaultFeatureWriter();
40 } else if (tag == "rdf") {
41 return new RDFFeatureWriter();
42 } else if (tag == "audiodb") {
43 return new AudioDBFeatureWriter();
44 } else if (tag == "csv") {
45 return new CSVFeatureWriter();
46 }
47
48 return 0;
49 }