openshot-audio  0.1.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AudioIODevice Class Referenceabstract

#include <juce_AudioIODevice.h>

Inheritance diagram for AudioIODevice:
AndroidAudioIODevice ASIOAudioIODevice CoreAudioClasses::AudioIODeviceCombiner CoreAudioClasses::CoreAudioIODevice iOSAudioIODevice JackAudioIODevice OpenSLAudioIODevice WasapiClasses::WASAPIAudioIODevice

Public Member Functions

virtual ~AudioIODevice ()
 
const StringgetName () const noexcept
 
const StringgetTypeName () const noexcept
 
virtual StringArray getOutputChannelNames ()=0
 
virtual StringArray getInputChannelNames ()=0
 
virtual Array< double > getAvailableSampleRates ()=0
 
virtual Array< int > getAvailableBufferSizes ()=0
 
virtual int getDefaultBufferSize ()=0
 
virtual String open (const BigInteger &inputChannels, const BigInteger &outputChannels, double sampleRate, int bufferSizeSamples)=0
 
virtual void close ()=0
 
virtual bool isOpen ()=0
 
virtual void start (AudioIODeviceCallback *callback)=0
 
virtual void stop ()=0
 
virtual bool isPlaying ()=0
 
virtual String getLastError ()=0
 
virtual int getCurrentBufferSizeSamples ()=0
 
virtual double getCurrentSampleRate ()=0
 
virtual int getCurrentBitDepth ()=0
 
virtual BigInteger getActiveOutputChannels () const =0
 
virtual BigInteger getActiveInputChannels () const =0
 
virtual int getOutputLatencyInSamples ()=0
 
virtual int getInputLatencyInSamples ()=0
 
virtual bool hasControlPanel () const
 
virtual bool showControlPanel ()
 
virtual bool setAudioPreprocessingEnabled (bool shouldBeEnabled)
 

Protected Member Functions

 AudioIODevice (const String &deviceName, const String &typeName)
 

Protected Attributes

String name
 
String typeName
 

Detailed Description

Base class for an audio device with synchronised input and output channels.

Subclasses of this are used to implement different protocols such as DirectSound, ASIO, CoreAudio, etc.

To create one of these, you'll need to use the AudioIODeviceType class - see the documentation for that class for more info.

For an easier way of managing audio devices and their settings, have a look at the AudioDeviceManager class.

See also
AudioIODeviceType, AudioDeviceManager

Constructor & Destructor Documentation

◆ ~AudioIODevice()

AudioIODevice::~AudioIODevice ( )
virtual

Destructor.

◆ AudioIODevice()

AudioIODevice::AudioIODevice ( const String deviceName,
const String typeName 
)
protected

Creates a device, setting its name and type member variables.

Member Function Documentation

◆ close()

virtual void AudioIODevice::close ( )
pure virtual

◆ getActiveInputChannels()

virtual BigInteger AudioIODevice::getActiveInputChannels ( ) const
pure virtual

◆ getActiveOutputChannels()

virtual BigInteger AudioIODevice::getActiveOutputChannels ( ) const
pure virtual

◆ getAvailableBufferSizes()

virtual Array<int> AudioIODevice::getAvailableBufferSizes ( )
pure virtual

◆ getAvailableSampleRates()

virtual Array<double> AudioIODevice::getAvailableSampleRates ( )
pure virtual

◆ getCurrentBitDepth()

virtual int AudioIODevice::getCurrentBitDepth ( )
pure virtual

Returns the device's current physical bit-depth.

If the device isn't actually open, this value doesn't really mean much.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ getCurrentBufferSizeSamples()

virtual int AudioIODevice::getCurrentBufferSizeSamples ( )
pure virtual

Returns the buffer size that the device is currently using.

If the device isn't actually open, this value doesn't really mean much.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, AndroidAudioIODevice, JackAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ getCurrentSampleRate()

virtual double AudioIODevice::getCurrentSampleRate ( )
pure virtual

Returns the sample rate that the device is currently using.

If the device isn't actually open, this value doesn't really mean much.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, AndroidAudioIODevice, JackAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ getDefaultBufferSize()

virtual int AudioIODevice::getDefaultBufferSize ( )
pure virtual

◆ getInputChannelNames()

virtual StringArray AudioIODevice::getInputChannelNames ( )
pure virtual

Returns the names of all the available input channels on this device. To find out which of these are currently in use, call getActiveInputChannels().

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, OpenSLAudioIODevice, and iOSAudioIODevice.

◆ getInputLatencyInSamples()

virtual int AudioIODevice::getInputLatencyInSamples ( )
pure virtual

Returns the device's input latency.

This is the delay in samples between some audio actually arriving at the soundcard, and the callback getting passed this block of data.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ getLastError()

virtual String AudioIODevice::getLastError ( )
pure virtual

◆ getName()

const String& AudioIODevice::getName ( ) const
inlinenoexcept

Returns the device's name, (as set in the constructor).

◆ getOutputChannelNames()

virtual StringArray AudioIODevice::getOutputChannelNames ( )
pure virtual

Returns the names of all the available output channels on this device. To find out which of these are currently in use, call getActiveOutputChannels().

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, OpenSLAudioIODevice, and iOSAudioIODevice.

◆ getOutputLatencyInSamples()

virtual int AudioIODevice::getOutputLatencyInSamples ( )
pure virtual

Returns the device's output latency.

This is the delay in samples between a callback getting a block of data, and that data actually getting played.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ getTypeName()

const String& AudioIODevice::getTypeName ( ) const
inlinenoexcept

Returns the type of the device.

E.g. "CoreAudio", "ASIO", etc. - this comes from the AudioIODeviceType that created it.

◆ hasControlPanel()

bool AudioIODevice::hasControlPanel ( ) const
virtual

True if this device can show a pop-up control panel for editing its settings.

This is generally just true of ASIO devices. If true, you can call showControlPanel() to display it.

Reimplemented in ASIOAudioIODevice.

◆ isOpen()

virtual bool AudioIODevice::isOpen ( )
pure virtual

Returns true if the device is still open.

A device might spontaneously close itself if something goes wrong, so this checks if it's still open.

Implemented in WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::AudioIODeviceCombiner, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ isPlaying()

virtual bool AudioIODevice::isPlaying ( )
pure virtual

Returns true if the device is still calling back.

The device might mysteriously stop, so this checks whether it's still playing.

Implemented in WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::AudioIODeviceCombiner, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ open()

virtual String AudioIODevice::open ( const BigInteger inputChannels,
const BigInteger outputChannels,
double  sampleRate,
int  bufferSizeSamples 
)
pure virtual

Tries to open the device ready to play.

Parameters
inputChannelsa BigInteger in which a set bit indicates that the corresponding input channel should be enabled
outputChannelsa BigInteger in which a set bit indicates that the corresponding output channel should be enabled
sampleRatethe sample rate to try to use - to find out which rates are available, see getAvailableSampleRates()
bufferSizeSamplesthe size of i/o buffer to use - to find out the available buffer sizes, see getAvailableBufferSizes()
Returns
an error description if there's a problem, or an empty string if it succeeds in opening the device
See also
close

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, OpenSLAudioIODevice, and iOSAudioIODevice.

◆ setAudioPreprocessingEnabled()

bool AudioIODevice::setAudioPreprocessingEnabled ( bool  shouldBeEnabled)
virtual

On devices which support it, this allows automatic gain control or other mic processing to be disabled. If the device doesn't support this operation, it'll return false.

Reimplemented in iOSAudioIODevice, and OpenSLAudioIODevice.

◆ showControlPanel()

bool AudioIODevice::showControlPanel ( )
virtual

Shows a device-specific control panel if there is one.

This should only be called for devices which return true from hasControlPanel().

Reimplemented in ASIOAudioIODevice.

◆ start()

virtual void AudioIODevice::start ( AudioIODeviceCallback callback)
pure virtual

Starts the device actually playing.

This must be called after the device has been opened.

Parameters
callbackthe callback to use for streaming the data.
See also
AudioIODeviceCallback, open

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

◆ stop()

virtual void AudioIODevice::stop ( )
pure virtual

Stops the device playing.

Once a device has been started, this will stop it. Any pending calls to the callback class will be flushed before this method returns.

Implemented in CoreAudioClasses::AudioIODeviceCombiner, WasapiClasses::WASAPIAudioIODevice, CoreAudioClasses::CoreAudioIODevice, ASIOAudioIODevice, JackAudioIODevice, AndroidAudioIODevice, iOSAudioIODevice, and OpenSLAudioIODevice.

Member Data Documentation

◆ name

String AudioIODevice::name
protected

◆ typeName

String AudioIODevice::typeName
protected

The documentation for this class was generated from the following files: