OpenShot Audio Library | OpenShotAudio: juce_AudioIODevice.h Source File

OpenShot Audio Library | OpenShotAudio 0.3.0

Loading...
Searching...
No Matches
juce_AudioIODevice.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26class AudioIODevice;
27
28
29//==============================================================================
42 class JUCE_API AudioIODeviceCallback
43{
44public:
46 virtual ~AudioIODeviceCallback() = default;
47
86 virtual void audioDeviceIOCallback (const float** inputChannelData,
87 int numInputChannels,
88 float** outputChannelData,
89 int numOutputChannels,
90 int numSamples) = 0;
91
106 virtual void audioDeviceAboutToStart (AudioIODevice* device) = 0;
107
109 virtual void audioDeviceStopped() = 0;
110
115 virtual void audioDeviceError (const String& errorMessage);
116};
117
118
119//==============================================================================
136 class JUCE_API AudioIODevice
137{
138public:
140 virtual ~AudioIODevice();
141
142 //==============================================================================
144 const String& getName() const noexcept { return name; }
145
150 const String& getTypeName() const noexcept { return typeName; }
151
152 //==============================================================================
156 virtual StringArray getOutputChannelNames() = 0;
157
161 virtual StringArray getInputChannelNames() = 0;
162
163 //==============================================================================
167 virtual Array<double> getAvailableSampleRates() = 0;
168
172 virtual Array<int> getAvailableBufferSizes() = 0;
173
178 virtual int getDefaultBufferSize() = 0;
179
180 //==============================================================================
195 virtual String open (const BigInteger& inputChannels,
196 const BigInteger& outputChannels,
197 double sampleRate,
198 int bufferSizeSamples) = 0;
199
201 virtual void close() = 0;
202
208 virtual bool isOpen() = 0;
209
217 virtual void start (AudioIODeviceCallback* callback) = 0;
218
224 virtual void stop() = 0;
225
231 virtual bool isPlaying() = 0;
232
234 virtual String getLastError() = 0;
235
236 //==============================================================================
241 virtual int getCurrentBufferSizeSamples() = 0;
242
247 virtual double getCurrentSampleRate() = 0;
248
253 virtual int getCurrentBitDepth() = 0;
254
259 virtual BigInteger getActiveOutputChannels() const = 0;
260
265 virtual BigInteger getActiveInputChannels() const = 0;
266
272 virtual int getOutputLatencyInSamples() = 0;
273
279 virtual int getInputLatencyInSamples() = 0;
280
281
282 //==============================================================================
288 virtual bool hasControlPanel() const;
289
294 virtual bool showControlPanel();
295
300 virtual bool setAudioPreprocessingEnabled (bool shouldBeEnabled);
301
302 //==============================================================================
313 virtual int getXRunCount() const noexcept;
314
315 //==============================================================================
316protected:
318 AudioIODevice (const String& deviceName,
319 const String& typeName);
320
322 String name, typeName;
323};
324
325} // namespace juce
juce::Array
Definition: juce_Array.h:56
juce::AudioIODeviceCallback
Definition: juce_AudioIODevice.h:43
juce::AudioIODeviceCallback::audioDeviceIOCallback
virtual void audioDeviceIOCallback(const float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples)=0
juce::AudioIODeviceCallback::~AudioIODeviceCallback
virtual ~AudioIODeviceCallback()=default
juce::AudioIODeviceCallback::audioDeviceAboutToStart
virtual void audioDeviceAboutToStart(AudioIODevice *device)=0
juce::AudioIODeviceCallback::audioDeviceStopped
virtual void audioDeviceStopped()=0
juce::AudioIODevice
Definition: juce_AudioIODevice.h:137
juce::AudioIODevice::getCurrentSampleRate
virtual double getCurrentSampleRate()=0
juce::AudioIODevice::getCurrentBitDepth
virtual int getCurrentBitDepth()=0
juce::AudioIODevice::close
virtual void close()=0
juce::AudioIODevice::isPlaying
virtual bool isPlaying()=0
juce::AudioIODevice::getTypeName
const String & getTypeName() const noexcept
Definition: juce_AudioIODevice.h:150
juce::AudioIODevice::getOutputChannelNames
virtual StringArray getOutputChannelNames()=0
juce::AudioIODevice::getInputChannelNames
virtual StringArray getInputChannelNames()=0
juce::AudioIODevice::getAvailableBufferSizes
virtual Array< int > getAvailableBufferSizes()=0
juce::AudioIODevice::getActiveInputChannels
virtual BigInteger getActiveInputChannels() const =0
juce::AudioIODevice::stop
virtual void stop()=0
juce::AudioIODevice::getActiveOutputChannels
virtual BigInteger getActiveOutputChannels() const =0
juce::AudioIODevice::getAvailableSampleRates
virtual Array< double > getAvailableSampleRates()=0
juce::AudioIODevice::getInputLatencyInSamples
virtual int getInputLatencyInSamples()=0
juce::AudioIODevice::getCurrentBufferSizeSamples
virtual int getCurrentBufferSizeSamples()=0
juce::AudioIODevice::getName
const String & getName() const noexcept
Definition: juce_AudioIODevice.h:144
juce::AudioIODevice::getDefaultBufferSize
virtual int getDefaultBufferSize()=0
juce::AudioIODevice::start
virtual void start(AudioIODeviceCallback *callback)=0
juce::AudioIODevice::getLastError
virtual String getLastError()=0
juce::AudioIODevice::open
virtual String open(const BigInteger &inputChannels, const BigInteger &outputChannels, double sampleRate, int bufferSizeSamples)=0
juce::AudioIODevice::getOutputLatencyInSamples
virtual int getOutputLatencyInSamples()=0
juce::AudioIODevice::isOpen
virtual bool isOpen()=0
juce::BigInteger
Definition: juce_BigInteger.h:39
juce::StringArray
Definition: juce_StringArray.h:35
juce::String
Definition: juce_String.h:39