svcore  1.9
DataFileReaderFactory.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
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 #ifndef _DATA_FILE_READER_FACTORY_H_
17 #define _DATA_FILE_READER_FACTORY_H_
18 
19 #include <QString>
20 
21 #include "CSVFormat.h"
22 #include "MIDIFileReader.h"
23 
24 class DataFileReader;
25 class Model;
26 
28 {
29 public:
31 
37  static QString getKnownExtensions();
38 
49  static DataFileReader *createReader(QString path,
51  int mainModelSampleRate);
52 
61  static Model *load(QString path,
63  int mainModelSampleRate);
64 
70  static Model *loadNonCSV(QString path,
72  int mainModelSampleRate);
73 
78  static Model *loadCSV(QString path,
79  CSVFormat format,
80  int mainModelSampleRate);
81 
82 protected:
83  static DataFileReader *createReader(QString path, bool csv,
85  CSVFormat format,
86  int mainModelSampleRate);
87 };
88 
89 #endif
90 
static QString getKnownExtensions()
Return the file extensions that we have data file readers for, in a format suitable for use with QFil...
static Model * loadCSV(QString path, CSVFormat format, int mainModelSampleRate)
Read the given path using the CSV reader with the given format.
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:35
static Model * load(QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate)
Read the given path, if a suitable reader is available.
static Model * loadNonCSV(QString path, MIDIFileImportPreferenceAcquirer *acquirer, int mainModelSampleRate)
Read the given path, if a suitable reader is available.
static DataFileReader * createReader(QString path, MIDIFileImportPreferenceAcquirer *, int mainModelSampleRate)
Return a data file reader initialised to the file at the given path, or NULL if no suitable reader fo...