Add TAL-Reverb-II plugin to test
[juce-lv2.git] / juce / source / src / audio / audio_file_formats / juce_WavAudioFormat.h
blob0bc3e67aade45c01fa4e099154044febbd166901
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
27 #define __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
29 #include "juce_AudioFormat.h"
32 //==============================================================================
33 /**
34 Reads and Writes WAV format audio files.
36 @see AudioFormat
38 class JUCE_API WavAudioFormat : public AudioFormat
40 public:
41 //==============================================================================
42 /** Creates a format object. */
43 WavAudioFormat();
45 /** Destructor. */
46 ~WavAudioFormat();
48 //==============================================================================
49 /** Metadata property name used by wav readers and writers for adding
50 a BWAV chunk to the file.
52 @see AudioFormatReader::metadataValues, createWriterFor
54 static const char* const bwavDescription;
56 /** Metadata property name used by wav readers and writers for adding
57 a BWAV chunk to the file.
59 @see AudioFormatReader::metadataValues, createWriterFor
61 static const char* const bwavOriginator;
63 /** Metadata property name used by wav readers and writers for adding
64 a BWAV chunk to the file.
66 @see AudioFormatReader::metadataValues, createWriterFor
68 static const char* const bwavOriginatorRef;
70 /** Metadata property name used by wav readers and writers for adding
71 a BWAV chunk to the file.
73 Date format is: yyyy-mm-dd
75 @see AudioFormatReader::metadataValues, createWriterFor
77 static const char* const bwavOriginationDate;
79 /** Metadata property name used by wav readers and writers for adding
80 a BWAV chunk to the file.
82 Time format is: hh-mm-ss
84 @see AudioFormatReader::metadataValues, createWriterFor
86 static const char* const bwavOriginationTime;
88 /** Metadata property name used by wav readers and writers for adding
89 a BWAV chunk to the file.
91 This is the number of samples from the start of an edit that the
92 file is supposed to begin at. Seems like an obvious mistake to
93 only allow a file to occur in an edit once, but that's the way
94 it is..
96 @see AudioFormatReader::metadataValues, createWriterFor
98 static const char* const bwavTimeReference;
100 /** Metadata property name used by wav readers and writers for adding
101 a BWAV chunk to the file.
103 This is a
105 @see AudioFormatReader::metadataValues, createWriterFor
107 static const char* const bwavCodingHistory;
109 /** Utility function to fill out the appropriate metadata for a BWAV file.
111 This just makes it easier than using the property names directly, and it
112 fills out the time and date in the right format.
114 static StringPairArray createBWAVMetadata (const String& description,
115 const String& originator,
116 const String& originatorRef,
117 const Time& dateAndTime,
118 const int64 timeReferenceSamples,
119 const String& codingHistory);
121 //==============================================================================
122 const Array <int> getPossibleSampleRates();
123 const Array <int> getPossibleBitDepths();
124 bool canDoStereo();
125 bool canDoMono();
127 //==============================================================================
128 AudioFormatReader* createReaderFor (InputStream* sourceStream,
129 bool deleteStreamIfOpeningFails);
131 AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
132 double sampleRateToUse,
133 unsigned int numberOfChannels,
134 int bitsPerSample,
135 const StringPairArray& metadataValues,
136 int qualityOptionIndex);
138 //==============================================================================
139 /** Utility function to replace the metadata in a wav file with a new set of values.
141 If possible, this cheats by overwriting just the metadata region of the file, rather
142 than by copying the whole file again.
144 bool replaceMetadataInFile (const File& wavFile, const StringPairArray& newMetadata);
147 private:
148 JUCE_LEAK_DETECTOR (WavAudioFormat);
152 #endif // __JUCE_WAVAUDIOFORMAT_JUCEHEADER__