svcore
1.9
|
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 _DATA_FILE_READER_FACTORY_H_ 00017 #define _DATA_FILE_READER_FACTORY_H_ 00018 00019 #include <QString> 00020 00021 #include "CSVFormat.h" 00022 #include "MIDIFileReader.h" 00023 00024 class DataFileReader; 00025 class Model; 00026 00027 class DataFileReaderFactory 00028 { 00029 public: 00030 enum Exception { ImportCancelled }; 00031 00037 static QString getKnownExtensions(); 00038 00049 static DataFileReader *createReader(QString path, 00050 MIDIFileImportPreferenceAcquirer *, 00051 int mainModelSampleRate); 00052 00061 static Model *load(QString path, 00062 MIDIFileImportPreferenceAcquirer *acquirer, 00063 int mainModelSampleRate); 00064 00070 static Model *loadNonCSV(QString path, 00071 MIDIFileImportPreferenceAcquirer *acquirer, 00072 int mainModelSampleRate); 00073 00078 static Model *loadCSV(QString path, 00079 CSVFormat format, 00080 int mainModelSampleRate); 00081 00082 protected: 00083 static DataFileReader *createReader(QString path, bool csv, 00084 MIDIFileImportPreferenceAcquirer *, 00085 CSVFormat format, 00086 int mainModelSampleRate); 00087 }; 00088 00089 #endif 00090