annotate runner/FeatureWriterFactory.cpp @ 168:3e30dbb68ca2 jams

Write time or start/end based simply on whether the feature has them or not, let's not get clever
author Chris Cannam
date Wed, 15 Oct 2014 15:20:16 +0100
parents 4b19d824a213
children f35bbb3e4d41
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
Chris@0 17 #include "FeatureWriterFactory.h"
Chris@0 18
Chris@0 19 #include "DefaultFeatureWriter.h"
Chris@154 20
Chris@0 21 #include "rdf/RDFFeatureWriter.h"
Chris@154 22 #include "transform/CSVFeatureWriter.h"
Chris@154 23
Chris@0 24 #include "AudioDBFeatureWriter.h"
Chris@136 25 #include "MIDIFeatureWriter.h"
Chris@145 26 #include "JAMSFeatureWriter.h"
Chris@154 27 #include "LabFeatureWriter.h"
Chris@0 28
Chris@0 29 set<string>
Chris@0 30 FeatureWriterFactory::getWriterTags()
Chris@0 31 {
Chris@0 32 set<string> tags;
Chris@0 33 tags.insert("default");
Chris@0 34 tags.insert("rdf");
Chris@0 35 tags.insert("audiodb");
Chris@0 36 tags.insert("csv");
Chris@154 37 tags.insert("lab");
Chris@136 38 tags.insert("midi");
Chris@145 39 tags.insert("json");
Chris@0 40 return tags;
Chris@0 41 }
Chris@0 42
Chris@0 43 FeatureWriter *
Chris@0 44 FeatureWriterFactory::createWriter(string tag)
Chris@0 45 {
Chris@0 46 if (tag == "default") {
Chris@0 47 return new DefaultFeatureWriter();
Chris@0 48 } else if (tag == "rdf") {
Chris@0 49 return new RDFFeatureWriter();
Chris@0 50 } else if (tag == "audiodb") {
Chris@0 51 return new AudioDBFeatureWriter();
Chris@0 52 } else if (tag == "csv") {
Chris@0 53 return new CSVFeatureWriter();
Chris@154 54 } else if (tag == "lab") {
Chris@154 55 return new LabFeatureWriter();
Chris@136 56 } else if (tag == "midi") {
Chris@136 57 return new MIDIFeatureWriter();
Chris@145 58 } else if (tag == "json") {
Chris@145 59 return new JAMSFeatureWriter();
Chris@0 60 }
Chris@0 61
Chris@0 62 return 0;
Chris@0 63 }