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 SV_DATA_FILE_READER_FACTORY_H
17 #define SV_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 class ProgressReporter;
27 
29 {
30 public:
32 
38  static QString getKnownExtensions();
39 
50  static DataFileReader *createReader(QString path,
52  sv_samplerate_t mainModelSampleRate,
53  ProgressReporter *reporter = 0);
54 
63  static Model *load(QString path,
65  sv_samplerate_t mainModelSampleRate,
66  ProgressReporter *reporter = 0);
67 
73  static Model *loadNonCSV(QString path,
75  sv_samplerate_t mainModelSampleRate,
76  ProgressReporter *reporter = 0);
77 
82  static Model *loadCSV(QString path,
83  CSVFormat format,
84  sv_samplerate_t mainModelSampleRate,
85  ProgressReporter *reporter = 0);
86 
87 protected:
88  static DataFileReader *createReader(QString path, bool csv,
90  CSVFormat format,
91  sv_samplerate_t mainModelSampleRate,
92  ProgressReporter *reporter = 0);
93 };
94 
95 #endif
96 
static QString getKnownExtensions()
Return the file extensions that we have data file readers for, in a format suitable for use with QFil...
double sv_samplerate_t
Sample rate.
Definition: BaseTypes.h:51
static Model * loadNonCSV(QString path, MIDIFileImportPreferenceAcquirer *acquirer, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
Read the given path, if a suitable reader is available.
static Model * loadCSV(QString path, CSVFormat format, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
Read the given path using the CSV reader with the given format.
static Model * load(QString path, MIDIFileImportPreferenceAcquirer *acquirer, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
Read the given path, if a suitable reader is available.
Model is the base class for all data models that represent any sort of data on a time scale based on ...
Definition: Model.h:51
static DataFileReader * createReader(QString path, MIDIFileImportPreferenceAcquirer *, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
Return a data file reader initialised to the file at the given path, or NULL if no suitable reader fo...