#include <DataFileReaderFactory.h>

Public Types

enum  Exception { ImportCancelled }
 

Static Public Member Functions

static QString getKnownExtensions ()
 Return the file extensions that we have data file readers for, in a format suitable for use with QFileDialog. More...
 
static DataFileReadercreateReader (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 for this path is available or the file cannot be opened. More...
 
static Modelload (QString path, MIDIFileImportPreferenceAcquirer *acquirer, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
 Read the given path, if a suitable reader is available. More...
 
static ModelloadNonCSV (QString path, MIDIFileImportPreferenceAcquirer *acquirer, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
 Read the given path, if a suitable reader is available. More...
 
static ModelloadCSV (QString path, CSVFormat format, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
 Read the given path using the CSV reader with the given format. More...
 

Static Protected Member Functions

static DataFileReadercreateReader (QString path, bool csv, MIDIFileImportPreferenceAcquirer *, CSVFormat format, sv_samplerate_t mainModelSampleRate, ProgressReporter *reporter=0)
 

Detailed Description

Definition at line 28 of file DataFileReaderFactory.h.

Member Enumeration Documentation

Enumerator
ImportCancelled 

Definition at line 31 of file DataFileReaderFactory.h.

Member Function Documentation

QString DataFileReaderFactory::getKnownExtensions ( )
static

Return the file extensions that we have data file readers for, in a format suitable for use with QFileDialog.

For example, "*.csv *.xml".

Definition at line 25 of file DataFileReaderFactory.cpp.

DataFileReader * DataFileReaderFactory::createReader ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
sv_samplerate_t  mainModelSampleRate,
ProgressReporter reporter = 0 
)
static

Return a data file reader initialised to the file at the given path, or NULL if no suitable reader for this path is available or the file cannot be opened.

Caller owns the returned object and must delete it after use.

Note that this function is non-interactive – the user is not asked for file format preferences.

Definition at line 66 of file DataFileReaderFactory.cpp.

Referenced by load(), loadCSV(), and loadNonCSV().

Model * DataFileReaderFactory::load ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
sv_samplerate_t  mainModelSampleRate,
ProgressReporter reporter = 0 
)
static

Read the given path, if a suitable reader is available.

Return NULL if no reader succeeded in reading this file.

Note that this function is non-interactive – the user is not asked for file format preferences. If the CSV file reader is used, it is with default format.

Definition at line 83 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

Model * DataFileReaderFactory::loadNonCSV ( QString  path,
MIDIFileImportPreferenceAcquirer acquirer,
sv_samplerate_t  mainModelSampleRate,
ProgressReporter reporter = 0 
)
static

Read the given path, if a suitable reader is available.

Return NULL if no reader succeeded in reading this file. Do not attempt the general CSV reader.

Definition at line 105 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

Model * DataFileReaderFactory::loadCSV ( QString  path,
CSVFormat  format,
sv_samplerate_t  mainModelSampleRate,
ProgressReporter reporter = 0 
)
static

Read the given path using the CSV reader with the given format.

Return NULL if it failed in reading this file.

Definition at line 128 of file DataFileReaderFactory.cpp.

References createReader(), and DataFileReader::load().

DataFileReader * DataFileReaderFactory::createReader ( QString  path,
bool  csv,
MIDIFileImportPreferenceAcquirer acquirer,
CSVFormat  format,
sv_samplerate_t  mainModelSampleRate,
ProgressReporter reporter = 0 
)
staticprotected

Definition at line 31 of file DataFileReaderFactory.cpp.

References DataFileReader::getError(), and DataFileReader::isOK().


The documentation for this class was generated from the following files: