AudioFileReaderFactory.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 AUDIO_FILE_READER_FACTORY_H
17 #define AUDIO_FILE_READER_FACTORY_H
18 
19 #include <QString>
20 
21 #include "FileSource.h"
22 #include "base/BaseTypes.h"
23 
24 class AudioFileReader;
25 class ProgressReporter;
26 
28 {
29 public:
35  static QString getKnownExtensions();
36 
37  enum class Normalisation {
38 
42  None,
43 
47  Peak
48  };
49 
50  enum class GaplessMode {
51 
61  Gapless,
62 
72  Gappy
73  };
74 
75  enum class ThreadingMode {
76 
81  NotThreaded,
82 
89  Threaded
90  };
91 
92  struct Parameters {
93 
102 
107 
112 
117 
119  targetRate(0),
120  normalisation(Normalisation::None),
121  gaplessMode(GaplessMode::Gapless),
122  threadingMode(ThreadingMode::NotThreaded)
123  { }
124  };
125 
141  static AudioFileReader *createReader(FileSource source,
142  Parameters parameters,
143  ProgressReporter *reporter = 0);
144 
152  static bool isSupported(FileSource source);
153 };
154 
155 #endif
156 
double sv_samplerate_t
Sample rate.
Definition: BaseTypes.h:51
static bool isSupported(FileSource source)
Return true if the given source has a file extension that indicates a supported file type...
GaplessMode gaplessMode
Gapless mode to use.
static QString getKnownExtensions()
Return the file extensions that we have audio file readers for, in a format suitable for use with QFi...
sv_samplerate_t targetRate
Sample rate to open the file at.
static AudioFileReader * createReader(FileSource source, Parameters parameters, ProgressReporter *reporter=0)
Return an audio file reader initialised to the file at the given path, or NULL if no suitable reader ...
Normalise file data to abs(max) == 1.0.
FileSource is a class used to refer to the contents of a file that may be either local or at a remote...
Definition: FileSource.h:59
Normalisation normalisation
Normalisation to use.
ThreadingMode threadingMode
Threading mode.