Loading...
Searching...
No Matches
juce_AudioIODeviceType.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API AudioIODeviceType
{
public:
//==============================================================================
const String& getTypeName() const noexcept { return typeName; }
//==============================================================================
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;
//==============================================================================
class Listener
{
public:
virtual ~Listener() = default;
virtual void audioDeviceListChanged() = 0;
};
void addListener (Listener* listener);
void removeListener (Listener* listener);
//==============================================================================
virtual ~AudioIODeviceType();
//==============================================================================
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();
#ifndef DOXYGEN
[[deprecated ("You should call the method which takes a WASAPIDeviceMode instead.")]]
static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode);
#endif
protected:
explicit AudioIODeviceType (const String& typeName);
void callDeviceChangeListeners();
private:
String typeName;
ListenerList<Listener> listeners;
JUCE_DECLARE_NON_COPYABLE (AudioIODeviceType)
};
} // namespace juce
juce::AudioIODeviceType::Listener
Definition juce_AudioIODeviceType.h:126
juce::AudioIODeviceType::Listener::audioDeviceListChanged
virtual void audioDeviceListChanged()=0
juce::AudioIODeviceType::createAudioIODeviceType_WASAPI
static AudioIODeviceType * createAudioIODeviceType_WASAPI(WASAPIDeviceMode deviceMode)
Definition juce_AudioIODeviceType.cpp:75
juce::AudioIODeviceType::getDefaultDeviceIndex
virtual int getDefaultDeviceIndex(bool forInput) const =0
juce::AudioIODeviceType::createAudioIODeviceType_ASIO
static AudioIODeviceType * createAudioIODeviceType_ASIO()
Definition juce_AudioIODeviceType.cpp:88
juce::AudioIODeviceType::createAudioIODeviceType_Oboe
static AudioIODeviceType * createAudioIODeviceType_Oboe()
Definition juce_AudioIODeviceType.cpp:143
juce::AudioIODeviceType::createAudioIODeviceType_JACK
static AudioIODeviceType * createAudioIODeviceType_JACK()
Definition juce_AudioIODeviceType.cpp:100
juce::AudioIODeviceType::createAudioIODeviceType_DirectSound
static AudioIODeviceType * createAudioIODeviceType_DirectSound()
Definition juce_AudioIODeviceType.cpp:82
juce::AudioIODeviceType::removeListener
void removeListener(Listener *listener)
Definition juce_AudioIODeviceType.cpp:37
juce::AudioIODeviceType::createAudioIODeviceType_Android
static AudioIODeviceType * createAudioIODeviceType_Android()
Definition juce_AudioIODeviceType.cpp:125
juce::AudioIODeviceType::createAudioIODeviceType_OpenSLES
static AudioIODeviceType * createAudioIODeviceType_OpenSLES()
Definition juce_AudioIODeviceType.cpp:134
juce::AudioIODeviceType::createAudioIODeviceType_CoreAudio
static AudioIODeviceType * createAudioIODeviceType_CoreAudio()
Definition juce_AudioIODeviceType.cpp:48
juce::AudioIODeviceType::hasSeparateInputsAndOutputs
virtual bool hasSeparateInputsAndOutputs() const =0
juce::AudioIODeviceType::getDeviceNames
virtual StringArray getDeviceNames(bool wantInputNames=false) const =0
juce::AudioIODeviceType::callDeviceChangeListeners
void callDeviceChangeListeners()
Definition juce_AudioIODeviceType.cpp:39
juce::AudioIODeviceType::scanForDevices
virtual void scanForDevices()=0
juce::AudioIODeviceType::getIndexOfDevice
virtual int getIndexOfDevice(AudioIODevice *device, bool asInput) const =0
juce::AudioIODeviceType::getTypeName
const String & getTypeName() const noexcept
Definition juce_AudioIODeviceType.h:69
juce::AudioIODeviceType::createAudioIODeviceType_Bela
static AudioIODeviceType * createAudioIODeviceType_Bela()
Definition juce_AudioIODeviceType.cpp:106
juce::AudioIODeviceType::addListener
void addListener(Listener *listener)
Definition juce_AudioIODeviceType.cpp:36
juce::AudioIODeviceType::createAudioIODeviceType_ALSA
static AudioIODeviceType * createAudioIODeviceType_ALSA()
Definition juce_AudioIODeviceType.cpp:94
juce::AudioIODeviceType::createDevice
virtual AudioIODevice * createDevice(const String &outputDeviceName, const String &inputDeviceName)=0
juce::AudioIODeviceType::createAudioIODeviceType_iOSAudio
static AudioIODeviceType * createAudioIODeviceType_iOSAudio()
Definition juce_AudioIODeviceType.cpp:54
juce::AudioIODevice
Definition juce_AudioIODevice.h:151
juce::ListenerList
Definition juce_ListenerList.h:81
juce::StringArray
Definition juce_StringArray.h:35
juce::String
Definition juce_String.h:53