tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_AudioFormatManager.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
18{
19public:
22
23 //==============================================================================
24 const juce::Array<juce::AudioFormat*>& getWriteFormats() const { return writeFormats; }
25
26 void addLameFormat (std::unique_ptr<juce::AudioFormat> lameForArray,
28
29 void addFormat (std::function<juce::AudioFormat*()> formatCreator, bool isWritable, bool isMemoryMappable);
30
31 //==============================================================================
32 juce::AudioFormat* getFormatFromFileName (const juce::File&) const;
33 juce::AudioFormat* getNamedFormat (const juce::String& formatName) const;
34
35 bool canOpen (const juce::File&) const;
36 juce::String getValidFileExtensions() const;
37
38 juce::AudioFormat* getDefaultFormat() const { return wavFormat.get(); }
39 juce::AudioFormat* getWavFormat() const { return wavFormat.get(); }
40 juce::AudioFormat* getAiffFormat() const { return aiffFormat.get(); }
41 juce::AudioFormat* getFrozenFileFormat() const { return floatFormat.get(); }
42 juce::AudioFormat* getOggFormat() const { return oggFormat.get(); }
43 juce::AudioFormat* getFlacFormat() const { return flacFormat.get(); }
44 juce::AudioFormat* getNativeAudioFormat() const { return nativeAudioFormat.get(); }
45 juce::AudioFormat* getLameFormat() const { return lameFormat.get(); }
46
47 #if TRACKTION_ENABLE_REX
48 juce::AudioFormat* getRexFormat() const { return rexFormat.get(); }
49 #endif
50
51 juce::AudioFormatManager readFormatManager, writeFormatManager, memoryMappedFormatManager;
52
53private:
54 juce::Array<juce::AudioFormat*> allFormats, readFormats, writeFormats;
56
57 std::unique_ptr<juce::AudioFormat> wavFormat, aiffFormat, floatFormat, nativeAudioFormat,
58 mp3ReadFormat, oggFormat, flacFormat, lameFormat;
59
60 #if TRACKTION_ENABLE_REX
62 #endif
63};
64
65}} // namespace tracktion { inline namespace engine
Keeps a list of available wave formats and can create a format object for a file.
T get(T... args)