JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::iOSAudioIODevice Class Reference

#include <juce_ios_Audio.h>

Inheritance diagram for juce::iOSAudioIODevice:
Collaboration diagram for juce::iOSAudioIODevice:

Public Member Functions

void close () override
 Closes and releases the device if it's open. More...
 
BigInteger getActiveInputChannels () const override
 Returns a mask showing which of the available input channels are currently enabled. More...
 
BigInteger getActiveOutputChannels () const override
 Returns a mask showing which of the available output channels are currently enabled. More...
 
AudioPlayHeadgetAudioPlayHead () const
 
Array< intgetAvailableBufferSizes () override
 Returns the set of buffer sizes that are available. More...
 
Array< double > getAvailableSampleRates () override
 Returns the set of sample-rates this device supports. More...
 
int getCurrentBitDepth () override
 Returns the device's current physical bit-depth. More...
 
int getCurrentBufferSizeSamples () override
 Returns the buffer size that the device is currently using. More...
 
double getCurrentSampleRate () override
 Returns the sample rate that the device is currently using. More...
 
int getDefaultBufferSize () override
 Returns the default buffer-size to use. More...
 
StringArray getInputChannelNames () override
 Returns the names of all the available input channels on this device. More...
 
int getInputLatencyInSamples () override
 Returns the device's input latency. More...
 
String getLastError () override
 Returns the last error that happened if anything went wrong. More...
 
const StringgetName () const noexcept
 Returns the device's name, (as set in the constructor). More...
 
StringArray getOutputChannelNames () override
 Returns the names of all the available output channels on this device. More...
 
int getOutputLatencyInSamples () override
 Returns the device's output latency. More...
 
const StringgetTypeName () const noexcept
 Returns the type of the device. More...
 
int getXRunCount () const noexcept override
 Returns the number of under- or over runs reported by the OS since playback/recording has started. More...
 
virtual bool hasControlPanel () const
 True if this device can show a pop-up control panel for editing its settings. More...
 
bool isInterAppAudioConnected () const
 
bool isOpen () override
 Returns true if the device is still open. More...
 
bool isPlaying () override
 Returns true if the device is still calling back. More...
 
String open (const BigInteger &, const BigInteger &, double, int) override
 Tries to open the device ready to play. More...
 
bool setAudioPreprocessingEnabled (bool) override
 On devices which support it, this allows automatic gain control or other mic processing to be disabled. More...
 
void setMidiMessageCollector (MidiMessageCollector *)
 
virtual bool showControlPanel ()
 Shows a device-specific control panel if there is one. More...
 
void start (AudioIODeviceCallback *) override
 Starts the device actually playing. More...
 
void stop () override
 Stops the device playing. More...
 
void switchApplication ()
 

Protected Attributes

String name
 
String typeName
 

Private Member Functions

 iOSAudioIODevice (iOSAudioIODeviceType *, const String &, const String &)
 

Private Attributes

std::unique_ptr< Pimplpimpl
 

Friends

struct AudioSessionHolder
 
class iOSAudioIODeviceType
 
struct Pimpl
 

Constructor & Destructor Documentation

◆ iOSAudioIODevice()

juce::iOSAudioIODevice::iOSAudioIODevice ( iOSAudioIODeviceType ,
const String ,
const String  
)
private

Member Function Documentation

◆ close()

void juce::iOSAudioIODevice::close ( )
overridevirtual

Closes and releases the device if it's open.

Implements juce::AudioIODevice.

◆ getActiveInputChannels()

BigInteger juce::iOSAudioIODevice::getActiveInputChannels ( ) const
overridevirtual

Returns a mask showing which of the available input channels are currently enabled.

See also
getInputChannelNames

Implements juce::AudioIODevice.

◆ getActiveOutputChannels()

BigInteger juce::iOSAudioIODevice::getActiveOutputChannels ( ) const
overridevirtual

Returns a mask showing which of the available output channels are currently enabled.

See also
getOutputChannelNames

Implements juce::AudioIODevice.

◆ getAudioPlayHead()

AudioPlayHead* juce::iOSAudioIODevice::getAudioPlayHead ( ) const

◆ getAvailableBufferSizes()

Array<int> juce::iOSAudioIODevice::getAvailableBufferSizes ( )
overridevirtual

Returns the set of buffer sizes that are available.

See also
getCurrentBufferSizeSamples, getDefaultBufferSize

Implements juce::AudioIODevice.

◆ getAvailableSampleRates()

Array<double> juce::iOSAudioIODevice::getAvailableSampleRates ( )
overridevirtual

Returns the set of sample-rates this device supports.

See also
getCurrentSampleRate

Implements juce::AudioIODevice.

◆ getCurrentBitDepth()

int juce::iOSAudioIODevice::getCurrentBitDepth ( )
overridevirtual

Returns the device's current physical bit-depth.

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

Implements juce::AudioIODevice.

◆ getCurrentBufferSizeSamples()

int juce::iOSAudioIODevice::getCurrentBufferSizeSamples ( )
overridevirtual

Returns the buffer size that the device is currently using.

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

Implements juce::AudioIODevice.

◆ getCurrentSampleRate()

double juce::iOSAudioIODevice::getCurrentSampleRate ( )
overridevirtual

Returns the sample rate that the device is currently using.

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

Implements juce::AudioIODevice.

◆ getDefaultBufferSize()

int juce::iOSAudioIODevice::getDefaultBufferSize ( )
overridevirtual

Returns the default buffer-size to use.

Returns
a number of samples
See also
getAvailableBufferSizes

Implements juce::AudioIODevice.

◆ getInputChannelNames()

StringArray juce::iOSAudioIODevice::getInputChannelNames ( )
overridevirtual

Returns the names of all the available input channels on this device.

To find out which of these are currently in use, call getActiveInputChannels().

Implements juce::AudioIODevice.

◆ getInputLatencyInSamples()

int juce::iOSAudioIODevice::getInputLatencyInSamples ( )
overridevirtual

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.

Implements juce::AudioIODevice.

◆ getLastError()

String juce::iOSAudioIODevice::getLastError ( )
overridevirtual

Returns the last error that happened if anything went wrong.

Implements juce::AudioIODevice.

◆ getName()

const String& juce::AudioIODevice::getName ( ) const
inlinenoexceptinherited

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

◆ getOutputChannelNames()

StringArray juce::iOSAudioIODevice::getOutputChannelNames ( )
overridevirtual

Returns the names of all the available output channels on this device.

To find out which of these are currently in use, call getActiveOutputChannels().

Implements juce::AudioIODevice.

◆ getOutputLatencyInSamples()

int juce::iOSAudioIODevice::getOutputLatencyInSamples ( )
overridevirtual

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.

Implements juce::AudioIODevice.

◆ getTypeName()

const String& juce::AudioIODevice::getTypeName ( ) const
inlinenoexceptinherited

Returns the type of the device.

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

References juce::BlocksProtocol::deviceName.

◆ getXRunCount()

int juce::iOSAudioIODevice::getXRunCount ( ) const
overridevirtualnoexcept

Returns the number of under- or over runs reported by the OS since playback/recording has started.

This number may be different than determining the Xrun count manually (by measuring the time spent in the audio callback) as the OS may be doing some buffering internally - especially on mobile devices.

Returns -1 if playback/recording has not started yet or if getting the underrun count is not supported for this device (Android SDK 23 and lower).

Reimplemented from juce::AudioIODevice.

◆ hasControlPanel()

virtual bool juce::AudioIODevice::hasControlPanel ( ) const
virtualinherited

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.

◆ isInterAppAudioConnected()

bool juce::iOSAudioIODevice::isInterAppAudioConnected ( ) const

◆ isOpen()

bool juce::iOSAudioIODevice::isOpen ( )
overridevirtual

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.

Implements juce::AudioIODevice.

◆ isPlaying()

bool juce::iOSAudioIODevice::isPlaying ( )
overridevirtual

Returns true if the device is still calling back.

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

Implements juce::AudioIODevice.

◆ open()

String juce::iOSAudioIODevice::open ( const BigInteger inputChannels,
const BigInteger outputChannels,
double  sampleRate,
int  bufferSizeSamples 
)
overridevirtual

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

Implements juce::AudioIODevice.

◆ setAudioPreprocessingEnabled()

bool juce::iOSAudioIODevice::setAudioPreprocessingEnabled ( bool  shouldBeEnabled)
overridevirtual

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 from juce::AudioIODevice.

◆ setMidiMessageCollector()

void juce::iOSAudioIODevice::setMidiMessageCollector ( MidiMessageCollector )

◆ showControlPanel()

virtual bool juce::AudioIODevice::showControlPanel ( )
virtualinherited

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

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

◆ start()

void juce::iOSAudioIODevice::start ( AudioIODeviceCallback callback)
overridevirtual

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

Implements juce::AudioIODevice.

◆ stop()

void juce::iOSAudioIODevice::stop ( )
overridevirtual

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.

Implements juce::AudioIODevice.

◆ switchApplication()

void juce::iOSAudioIODevice::switchApplication ( )

Friends And Related Function Documentation

◆ AudioSessionHolder

friend struct AudioSessionHolder
friend

◆ iOSAudioIODeviceType

friend class iOSAudioIODeviceType
friend

◆ Pimpl

friend struct Pimpl
friend

Member Data Documentation

◆ name

String juce::AudioIODevice::name
protectedinherited

◆ pimpl

std::unique_ptr<Pimpl> juce::iOSAudioIODevice::pimpl
private

◆ typeName

String juce::AudioIODevice::typeName
protectedinherited

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