openshot-audio  0.1.6
juce_AudioIODevice.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_AUDIOIODEVICE_H_INCLUDED
26 #define JUCE_AUDIOIODEVICE_H_INCLUDED
27 
28 class AudioIODevice;
29 
30 
31 //==============================================================================
43 {
44 public:
47 
84  virtual void audioDeviceIOCallback (const float** inputChannelData,
85  int numInputChannels,
86  float** outputChannelData,
87  int numOutputChannels,
88  int numSamples) = 0;
89 
104  virtual void audioDeviceAboutToStart (AudioIODevice* device) = 0;
105 
107  virtual void audioDeviceStopped() = 0;
108 
113  virtual void audioDeviceError (const String& errorMessage);
114 };
115 
116 
117 //==============================================================================
133 {
134 public:
136  virtual ~AudioIODevice();
137 
138  //==============================================================================
140  const String& getName() const noexcept { return name; }
141 
146  const String& getTypeName() const noexcept { return typeName; }
147 
148  //==============================================================================
152  virtual StringArray getOutputChannelNames() = 0;
153 
157  virtual StringArray getInputChannelNames() = 0;
158 
159  //==============================================================================
163  virtual Array<double> getAvailableSampleRates() = 0;
164 
168  virtual Array<int> getAvailableBufferSizes() = 0;
169 
174  virtual int getDefaultBufferSize() = 0;
175 
176  //==============================================================================
191  virtual String open (const BigInteger& inputChannels,
192  const BigInteger& outputChannels,
193  double sampleRate,
194  int bufferSizeSamples) = 0;
195 
197  virtual void close() = 0;
198 
204  virtual bool isOpen() = 0;
205 
213  virtual void start (AudioIODeviceCallback* callback) = 0;
214 
220  virtual void stop() = 0;
221 
227  virtual bool isPlaying() = 0;
228 
230  virtual String getLastError() = 0;
231 
232  //==============================================================================
237  virtual int getCurrentBufferSizeSamples() = 0;
238 
243  virtual double getCurrentSampleRate() = 0;
244 
249  virtual int getCurrentBitDepth() = 0;
250 
255  virtual BigInteger getActiveOutputChannels() const = 0;
256 
261  virtual BigInteger getActiveInputChannels() const = 0;
262 
268  virtual int getOutputLatencyInSamples() = 0;
269 
275  virtual int getInputLatencyInSamples() = 0;
276 
277 
278  //==============================================================================
284  virtual bool hasControlPanel() const;
285 
290  virtual bool showControlPanel();
291 
296  virtual bool setAudioPreprocessingEnabled (bool shouldBeEnabled);
297 
298  //==============================================================================
299 protected:
301  AudioIODevice (const String& deviceName,
302  const String& typeName);
303 
306 };
307 
308 
309 #endif // JUCE_AUDIOIODEVICE_H_INCLUDED
Definition: juce_BigInteger.h:43
Definition: juce_AudioIODevice.h:42
#define noexcept
Definition: juce_CompilerSupport.h:141
const String & getTypeName() const noexcept
Definition: juce_AudioIODevice.h:146
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
Definition: juce_StringArray.h:39
const String & getName() const noexcept
Definition: juce_AudioIODevice.h:140
virtual ~AudioIODeviceCallback()
Definition: juce_AudioIODevice.h:46
String typeName
Definition: juce_AudioIODevice.h:305
Definition: juce_AudioIODevice.h:132