svcore  1.9
CSVFileReader.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     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Chris Cannam.
00008     
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _CSV_FILE_READER_H_
00017 #define _CSV_FILE_READER_H_
00018 
00019 #include "DataFileReader.h"
00020 
00021 #include "CSVFormat.h"
00022 
00023 #include <QList>
00024 #include <QStringList>
00025 
00026 class QFile;
00027 
00028 class CSVFileReader : public DataFileReader
00029 {
00030 public:
00031     CSVFileReader(QString path, CSVFormat format, int mainModelSampleRate);
00032     virtual ~CSVFileReader();
00033 
00034     virtual bool isOK() const;
00035     virtual QString getError() const;
00036     virtual Model *load() const;
00037 
00038 protected:
00039     CSVFormat m_format;
00040     QFile *m_file;
00041     QString m_error;
00042     mutable int m_warnings;
00043     int m_mainModelSampleRate;
00044 
00045     int convertTimeValue(QString, int lineno, int sampleRate,
00046                             int windowSize) const;
00047 };
00048 
00049 
00050 #endif
00051