JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_AudioIODeviceType.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
61class JUCE_API AudioIODeviceType
62{
63public:
64 //==============================================================================
69 const String& getTypeName() const noexcept { return typeName; }
70
71 //==============================================================================
77 virtual void scanForDevices() = 0;
78
86 virtual StringArray getDeviceNames (bool wantInputNames = false) const = 0;
87
95 virtual int getDefaultDeviceIndex (bool forInput) const = 0;
96
101 virtual int getIndexOfDevice (AudioIODevice* device, bool asInput) const = 0;
102
105 virtual bool hasSeparateInputsAndOutputs() const = 0;
106
112 virtual AudioIODevice* createDevice (const String& outputDeviceName,
113 const String& inputDeviceName) = 0;
114
115 //==============================================================================
126 {
127 public:
128 virtual ~Listener() = default;
129
131 virtual void audioDeviceListChanged() = 0;
132 };
133
137 void addListener (Listener* listener);
138
140 void removeListener (Listener* listener);
141
142 //==============================================================================
144 virtual ~AudioIODeviceType();
145
146 //==============================================================================
148 static AudioIODeviceType* createAudioIODeviceType_CoreAudio();
150 static AudioIODeviceType* createAudioIODeviceType_iOSAudio();
152 static AudioIODeviceType* createAudioIODeviceType_WASAPI (WASAPIDeviceMode deviceMode);
154 static AudioIODeviceType* createAudioIODeviceType_DirectSound();
156 static AudioIODeviceType* createAudioIODeviceType_ASIO();
158 static AudioIODeviceType* createAudioIODeviceType_ALSA();
160 static AudioIODeviceType* createAudioIODeviceType_JACK();
162 static AudioIODeviceType* createAudioIODeviceType_Android();
164 static AudioIODeviceType* createAudioIODeviceType_OpenSLES();
166 static AudioIODeviceType* createAudioIODeviceType_Oboe();
168 static AudioIODeviceType* createAudioIODeviceType_Bela();
169
170 #ifndef DOXYGEN
171 [[deprecated ("You should call the method which takes a WASAPIDeviceMode instead.")]]
172 static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode);
173 #endif
174
175protected:
176 explicit AudioIODeviceType (const String& typeName);
177
179 void callDeviceChangeListeners();
180
181private:
182 String typeName;
183 ListenerList<Listener> listeners;
184
186};
187
188} // namespace juce
A class for receiving events when audio devices are inserted or removed.
virtual void audioDeviceListChanged()=0
Called when the list of available audio devices changes.
Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.
virtual int getDefaultDeviceIndex(bool forInput) const =0
Returns the name of the default device.
virtual bool hasSeparateInputsAndOutputs() const =0
Returns true if two different devices can be used for the input and output.
virtual StringArray getDeviceNames(bool wantInputNames=false) const =0
Returns the list of available devices of this type.
virtual void scanForDevices()=0
Refreshes the object's cached list of known devices.
virtual int getIndexOfDevice(AudioIODevice *device, bool asInput) const =0
Returns the index of a given device in the list of device names.
const String & getTypeName() const noexcept
Returns the name of this type of driver that this object manages.
virtual AudioIODevice * createDevice(const String &outputDeviceName, const String &inputDeviceName)=0
Creates one of the devices of this type.
Base class for an audio device with synchronised input and output channels.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
#define JUCE_DECLARE_NON_COPYABLE(className)
This is a shorthand macro for deleting a class's copy constructor and copy assignment operator.
JUCE Namespace.
WASAPIDeviceMode
Available modes for the WASAPI audio device.