Loading...
Searching...
No Matches
juce::AudioIODeviceType Class Referenceabstract

`#include <juce_AudioIODeviceType.h>`

## Classes

class | Listener

## Public Member Functions

const String & | getTypeName () const noexcept
virtual void | scanForDevices ()=0
virtual StringArray | getDeviceNames (bool wantInputNames=false) const =0
virtual int | getDefaultDeviceIndex (bool forInput) const =0
virtual int | getIndexOfDevice (AudioIODevice *device, bool asInput) const =0
virtual bool | hasSeparateInputsAndOutputs () const =0
virtual AudioIODevice * | createDevice (const String &outputDeviceName, const String &inputDeviceName)=0
void | addListener (Listener *listener)
void | removeListener (Listener *listener)
virtual | ~AudioIODeviceType ()

## Static Public Member Functions

static AudioIODeviceType * | createAudioIODeviceType_CoreAudio ()
static AudioIODeviceType * | createAudioIODeviceType_iOSAudio ()
static AudioIODeviceType * | createAudioIODeviceType_WASAPI (WASAPIDeviceMode deviceMode)
static AudioIODeviceType * | createAudioIODeviceType_DirectSound ()
static AudioIODeviceType * | createAudioIODeviceType_ASIO ()
static AudioIODeviceType * | createAudioIODeviceType_ALSA ()
static AudioIODeviceType * | createAudioIODeviceType_JACK ()
static AudioIODeviceType * | createAudioIODeviceType_Android ()
static AudioIODeviceType * | createAudioIODeviceType_OpenSLES ()
static AudioIODeviceType * | createAudioIODeviceType_Oboe ()
static AudioIODeviceType * | createAudioIODeviceType_Bela ()
static AudioIODeviceType * | createAudioIODeviceType_WASAPI (bool exclusiveMode)

## Protected Member Functions

| AudioIODeviceType (const String &typeName)
void | callDeviceChangeListeners ()

## Detailed Description

Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.

To get a list of available audio driver types, use the AudioDeviceManager::createAudioDeviceTypes() method. Each of the objects returned can then be used to list the available devices of that type. E.g.

OwnedArray<AudioIODeviceType> types;
myAudioDeviceManager.createAudioDeviceTypes (types);
for (int i = 0; i < types.size(); ++i)
{
String typeName (types[i]->getTypeName()); // This will be things like "DirectSound", "CoreAudio", etc.
types[i]->scanForDevices(); // This must be called before getting the list of devices
StringArray deviceNames (types[i]->getDeviceNames()); // This will now return a list of available devices of this type
for (int j = 0; j < deviceNames.size(); ++j)
{
AudioIODevice* device = types[i]->createDevice (deviceNames [j]);
...
}
}
juce::AudioIODeviceType::getDeviceNames
virtual StringArray getDeviceNames(bool wantInputNames=false) const =0
juce::AudioIODeviceType::getTypeName
const String & getTypeName() const noexcept
Definition juce_AudioIODeviceType.h:69
juce::AudioIODevice
Definition juce_AudioIODevice.h:151
juce::OwnedArray
Definition juce_OwnedArray.h:50
juce::OwnedArray::size
int size() const noexcept
Definition juce_OwnedArray.h:129
juce::StringArray
Definition juce_StringArray.h:35
juce::String
Definition juce_String.h:53

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

See also
  AudioIODevice, AudioDeviceManager

Definition at line 61 of file juce_AudioIODeviceType.h.

## Constructor & Destructor Documentation

## ~AudioIODeviceType()

juce::AudioIODeviceType::~AudioIODeviceType | ( |  | ) |

virtual

Destructor.

Definition at line 31 of file juce_AudioIODeviceType.cpp.

Referenced by ~AudioIODeviceType().

## AudioIODeviceType()

juce::AudioIODeviceType::AudioIODeviceType | ( | const String & | typeName | ) |

explicit protected

Definition at line 26 of file juce_AudioIODeviceType.cpp.

## Member Function Documentation

## addListener()

void juce::AudioIODeviceType::addListener | ( | Listener * | listener | ) |

Adds a listener that will be called when this type of device is added or removed from the system.

Definition at line 36 of file juce_AudioIODeviceType.cpp.

Referenced by addListener().

## callDeviceChangeListeners()

void juce::AudioIODeviceType::callDeviceChangeListeners | ( |  | ) |

protected

Synchronously calls all the registered device list change listeners.

Definition at line 39 of file juce_AudioIODeviceType.cpp.

Referenced by callDeviceChangeListeners().

## createAudioIODeviceType_ALSA()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_ALSA | ( |  | ) |

static

Creates an ALSA device type if it's available on this platform, or returns null.

Definition at line 94 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_ALSA().

## createAudioIODeviceType_Android()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_Android | ( |  | ) |

static

Creates an Android device type if it's available on this platform, or returns null.

Definition at line 125 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_Android().

## createAudioIODeviceType_ASIO()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_ASIO | ( |  | ) |

static

Creates an ASIO device type if it's available on this platform, or returns null.

Definition at line 88 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_ASIO().

## createAudioIODeviceType_Bela()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_Bela | ( |  | ) |

static

Creates a Bela device type if it's available on this platform, or returns null.

Definition at line 106 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_Bela().

## createAudioIODeviceType_CoreAudio()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_CoreAudio | ( |  | ) |

static

Creates a CoreAudio device type if it's available on this platform, or returns null.

Definition at line 48 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_CoreAudio().

## createAudioIODeviceType_DirectSound()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_DirectSound | ( |  | ) |

static

Creates a DirectSound device type if it's available on this platform, or returns null.

Definition at line 82 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_DirectSound().

## createAudioIODeviceType_iOSAudio()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_iOSAudio | ( |  | ) |

static

Creates an iOS device type if it's available on this platform, or returns null.

Definition at line 54 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_iOSAudio().

## createAudioIODeviceType_JACK()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_JACK | ( |  | ) |

static

Creates a JACK device type if it's available on this platform, or returns null.

Definition at line 100 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_JACK().

## createAudioIODeviceType_Oboe()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_Oboe | ( |  | ) |

static

Creates an Oboe device type if it's available on this platform, or returns null.

Definition at line 143 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_Oboe().

## createAudioIODeviceType_OpenSLES()

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_OpenSLES | ( |  | ) |

static

Creates an Android OpenSLES device type if it's available on this platform, or returns null.

Definition at line 134 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_OpenSLES().

## createAudioIODeviceType_WASAPI() [1/2]

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_WASAPI | ( | bool | exclusiveMode | ) |

static

Definition at line 76 of file juce_AudioIODeviceType.cpp.

## createAudioIODeviceType_WASAPI() [2/2]

AudioIODeviceType * juce::AudioIODeviceType::createAudioIODeviceType_WASAPI | ( | WASAPIDeviceMode | deviceMode | ) |

static

Creates a WASAPI device type in the specified mode if it's available on this platform, or returns null.

Definition at line 75 of file juce_AudioIODeviceType.cpp.

Referenced by juce::AudioDeviceManager::createAudioDeviceTypes(), and createAudioIODeviceType_WASAPI().

## createDevice()

virtual AudioIODevice * juce::AudioIODeviceType::createDevice | ( | const String & | outputDeviceName,
|  | const String & | inputDeviceName )

pure virtual

Creates one of the devices of this type.

The deviceName must be one of the strings returned by getDeviceNames(), and scanForDevices() must have been called before this method is used.

## getDefaultDeviceIndex()

virtual int juce::AudioIODeviceType::getDefaultDeviceIndex | ( | bool | forInput | ) | const

pure virtual

Returns the name of the default device.

This will be one of the names from the getDeviceNames() list.

Parameters

  forInput | if true, this means that a default input device should be returned; if false, it should return the default output

## getDeviceNames()

virtual StringArray juce::AudioIODeviceType::getDeviceNames | ( | bool | wantInputNames = false | ) | const

pure virtual

Returns the list of available devices of this type.

The scanForDevices() method must have been called to create this list.

Parameters

  wantInputNames | for devices which have separate inputs and outputs this determines which list of names is returned

## getIndexOfDevice()

virtual int juce::AudioIODeviceType::getIndexOfDevice | ( | AudioIODevice * | device,
|  | bool | asInput ) const

pure virtual

Returns the index of a given device in the list of device names. If asInput is true, it shows the index in the inputs list, otherwise it looks for it in the outputs list.

## getTypeName()

const String & juce::AudioIODeviceType::getTypeName | ( |  | ) | const

inline noexcept

Returns the name of this type of driver that this object manages.

This will be something like "DirectSound", "ASIO", "CoreAudio", "ALSA", etc.

Definition at line 69 of file juce_AudioIODeviceType.h.

## hasSeparateInputsAndOutputs()

virtual bool juce::AudioIODeviceType::hasSeparateInputsAndOutputs | ( |  | ) | const

pure virtual

Returns true if two different devices can be used for the input and output.

## removeListener()

void juce::AudioIODeviceType::removeListener | ( | Listener * | listener | ) |

Removes a listener that was previously added with addListener().

Definition at line 37 of file juce_AudioIODeviceType.cpp.

Referenced by removeListener().

## scanForDevices()

virtual void juce::AudioIODeviceType::scanForDevices | ( |  | ) |

pure virtual

Refreshes the object's cached list of known devices.

This must be called at least once before calling getDeviceNames() or any of the other device creation methods.

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

- juce_AudioIODeviceType.h
- juce_AudioIODeviceType.cpp