openshot-audio  0.1.7
juce_AudioFormat.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_AUDIOFORMAT_H_INCLUDED
26 #define JUCE_AUDIOFORMAT_H_INCLUDED
27 
28 
29 //==============================================================================
37 {
38 public:
39  //==============================================================================
41  virtual ~AudioFormat();
42 
43  //==============================================================================
47  const String& getFormatName() const;
48 
56  const StringArray& getFileExtensions() const;
57 
58  //==============================================================================
65  virtual bool canHandleFile (const File& fileToTest);
66 
68  virtual Array<int> getPossibleSampleRates() = 0;
69 
71  virtual Array<int> getPossibleBitDepths() = 0;
72 
74  virtual bool canDoStereo() = 0;
75 
77  virtual bool canDoMono() = 0;
78 
80  virtual bool isCompressed();
81 
90  virtual StringArray getQualityOptions();
91 
92  //==============================================================================
108  virtual AudioFormatReader* createReaderFor (InputStream* sourceStream,
109  bool deleteStreamIfOpeningFails) = 0;
110 
114  virtual MemoryMappedAudioFormatReader* createMemoryMappedReader (const File& file);
115 
148  virtual AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
149  double sampleRateToUse,
150  unsigned int numberOfChannels,
151  int bitsPerSample,
152  const StringPairArray& metadataValues,
153  int qualityOptionIndex) = 0;
154 
155 protected:
161  AudioFormat (String formatName, StringArray fileExtensions);
162 
169  AudioFormat (StringRef formatName, StringRef fileExtensions);
170 
171 private:
172  //==============================================================================
173  String formatName;
174  StringArray fileExtensions;
175 };
176 
177 
178 #endif // JUCE_AUDIOFORMAT_H_INCLUDED
Definition: juce_StringPairArray.h:39
Definition: juce_MemoryMappedAudioFormatReader.h:44
Definition: juce_InputStream.h:41
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_AudioFormatWriter.h:41
Definition: juce_AudioFormatReader.h:38
Definition: juce_OutputStream.h:42
Definition: juce_AudioFormat.h:36
Definition: juce_StringArray.h:39
Definition: juce_File.h:45
Definition: juce_StringRef.h:65