Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc. More...
Classes | |
| struct | DeviceSetupDetails |
Public Member Functions | |
| const String & | getTypeName () const throw () |
| Returns the name of this type of driver that this object manages. | |
| virtual void | scanForDevices ()=0 |
| Refreshes the object's cached list of known devices. | |
| virtual const StringArray | getDeviceNames (bool wantInputNames=false) const =0 |
| Returns the list of available devices of this type. | |
| virtual int | getDefaultDeviceIndex (bool forInput) const =0 |
| Returns the name of the default device. | |
| virtual int | getIndexOfDevice (AudioIODevice *device, bool asInput) const =0 |
| Returns the index of a given device in the list of device names. | |
| virtual bool | hasSeparateInputsAndOutputs () const =0 |
| Returns true if two different devices can be used for the input and output. | |
| virtual AudioIODevice * | createDevice (const String &outputDeviceName, const String &inputDeviceName)=0 |
| Creates one of the devices of this type. | |
| virtual | ~AudioIODeviceType () |
| Destructor. | |
Protected Member Functions | |
| AudioIODeviceType (const String &typeName) | |
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]); ... } }
For an easier way of managing audio devices and their settings, have a look at the AudioDeviceManager class.
| virtual AudioIODeviceType::~AudioIODeviceType | ( | ) | [virtual] |
Destructor.
| AudioIODeviceType::AudioIODeviceType | ( | const String & | typeName | ) | [explicit, protected] |
| const String& AudioIODeviceType::getTypeName | ( | ) | const throw () |
Returns the name of this type of driver that this object manages.
This will be something like "DirectSound", "ASIO", "CoreAudio", "ALSA", etc.
| virtual void 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.
| virtual const StringArray 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.
| wantInputNames | only really used by DirectSound where devices are split up into inputs and outputs, this indicates whether to use the input or output name to refer to a pair of devices. |
| virtual int 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.
| forInput | if true, this means that a default input device should be returned; if false, it should return the default output |
| virtual int 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.
| virtual bool AudioIODeviceType::hasSeparateInputsAndOutputs | ( | ) | const [pure virtual] |
Returns true if two different devices can be used for the input and output.
| virtual AudioIODevice* 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.
1.6.3