svcore  1.9
CSVFeatureWriter.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006 
00007     Sonic Annotator
00008     A utility for batch feature extraction from audio files.
00009 
00010     Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London.
00011     Copyright 2007-2008 QMUL.
00012 
00013     This program is free software; you can redistribute it and/or
00014     modify it under the terms of the GNU General Public License as
00015     published by the Free Software Foundation; either version 2 of the
00016     License, or (at your option) any later version.  See the file
00017     COPYING included with this distribution for more information.
00018 */
00019 
00020 #ifndef _CSV_FEATURE_WRITER_H_
00021 #define _CSV_FEATURE_WRITER_H_
00022 
00023 #include <string>
00024 #include <map>
00025 #include <set>
00026 
00027 #include <QString>
00028 
00029 #include "FileFeatureWriter.h"
00030 
00031 using std::string;
00032 using std::map;
00033 
00034 class QTextStream;
00035 class QFile;
00036 
00037 class CSVFeatureWriter : public FileFeatureWriter
00038 {
00039 public:
00040     CSVFeatureWriter();
00041     virtual ~CSVFeatureWriter();
00042 
00043     virtual ParameterList getSupportedParameters() const;
00044     virtual void setParameters(map<string, string> &params);
00045 
00046     virtual void write(QString trackid,
00047                        const Transform &transform,
00048                        const Vamp::Plugin::OutputDescriptor &output,
00049                        const Vamp::Plugin::FeatureList &features,
00050                        std::string summaryType = "");
00051 
00052     virtual QString getWriterTag() const { return "csv"; }
00053 
00054 private:
00055     QString m_separator;
00056     bool m_sampleTiming;
00057     QString m_prevPrintedTrackId;
00058 };
00059 
00060 #endif