115 double sampleRate = 0;
134 bool useDefaultInputChannels =
true;
147 bool useDefaultOutputChannels =
true;
185 String initialise (
int numInputChannelsNeeded,
186 int numOutputChannelsNeeded,
188 bool selectDefaultDeviceOnFailure,
193 String initialiseWithDefaultDevices (
int numInputChannelsNeeded,
194 int numOutputChannelsNeeded);
262 void setCurrentAudioDeviceType (
const String& type,
bool treatAsChosenDevice);
268 void closeAudioDevice();
278 void restartLastAudioDevice();
309 double getCpuUsage()
const;
331 void setMidiInputEnabled (
const String& midiInputDeviceName,
bool enabled);
336 bool isMidiInputEnabled (
const String& midiInputDeviceName)
const;
348 void addMidiInputCallback (
const String& midiInputDeviceName,
352 void removeMidiInputCallback (
const String& midiInputDeviceName,
368 void setDefaultMidiOutput (
const String& deviceName);
406 void playTestSound();
421 double getCurrentLevel()
const noexcept;
429 void updateLevel (
const float*
const*,
int numChannels,
int numSamples)
noexcept;
466 int getXRunCount() const noexcept;
471 OwnedArray<AudioDeviceSetup> lastDeviceTypeConfigs;
473 AudioDeviceSetup currentSetup;
476 int numInputChansNeeded = 0, numOutputChansNeeded = 2;
477 String preferredDeviceName, currentDeviceType;
479 std::unique_ptr<
XmlElement> lastExplicitSettings;
480 mutable
bool listNeedsScanning = true;
483 struct MidiCallbackInfo
489 StringArray midiInsFromXml;
490 OwnedArray<MidiInput> enabledMidiInputs;
491 Array<MidiCallbackInfo> midiCallbacks;
493 String defaultMidiOutputName;
494 std::unique_ptr<MidiOutput> defaultMidiOutput;
495 CriticalSection audioCallbackLock, midiCallbackLock;
497 std::unique_ptr<AudioBuffer<float>> testSound;
498 int testSoundPosition = 0;
500 AudioProcessLoadMeasurer loadMeasurer;
502 LevelMeter::Ptr inputLevelGetter {
new LevelMeter() },
503 outputLevelGetter {
new LevelMeter() };
506 class CallbackHandler;
507 std::unique_ptr<CallbackHandler> callbackHandler;
509 void audioDeviceIOCallbackInt (
const float** inputChannelData,
int totalNumInputChannels,
510 float** outputChannelData,
int totalNumOutputChannels,
int numSamples);
511 void audioDeviceAboutToStartInt (AudioIODevice*);
512 void audioDeviceStoppedInt();
513 void audioDeviceErrorInt (
const String&);
514 void handleIncomingMidiMessageInt (MidiInput*,
const MidiMessage&);
515 void audioDeviceListChanged();
517 String restartDevice (
int blockSizeToUse,
double sampleRateToUse,
518 const BigInteger& ins,
const BigInteger& outs);
523 void createDeviceTypesIfNeeded();
524 void scanDevicesIfNeeded();
525 void deleteCurrentDevice();
526 double chooseBestSampleRate (
double preferred)
const;
527 int chooseBestBufferSize (
int preferred)
const;
528 void insertDefaultDeviceNames (AudioDeviceSetup&)
const;
529 String initialiseDefault (
const String& preferredDefaultDeviceName,
const AudioDeviceSetup*);
530 String initialiseFromXML (
const XmlElement&,
bool selectDefaultDeviceOnFailure,
531 const String& preferredDefaultDeviceName,
const AudioDeviceSetup*);
533 AudioIODeviceType* findType (
const String& inputName,
const String& outputName);
534 AudioIODeviceType* findType (
const String& typeName);
536 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioDeviceManager)
Holds a resizable array of primitive or copy-by-value objects.
A multi-channel buffer containing floating point audio samples.
Manages the state of some audio and midi i/o devices.
const String & getDefaultMidiOutputName() const noexcept
Returns the name of the default midi output.
MidiOutput * getDefaultMidiOutput() const noexcept
Returns the current default midi output device.
LevelMeter::Ptr getInputLevelGetter() noexcept
Returns a reference-counted object that can be used to get the current input level.
CriticalSection & getMidiCallbackLock() noexcept
Returns the a lock that can be used to synchronise access to the midi callback.
LevelMeter::Ptr getOutputLevelGetter() noexcept
Returns a reference-counted object that can be used to get the current output level.
AudioIODevice * getCurrentAudioDevice() const noexcept
Returns the currently-active audio device.
String getCurrentAudioDeviceType() const
Returns the type of audio device currently in use.
CriticalSection & getAudioCallbackLock() noexcept
Returns the a lock that can be used to synchronise access to the audio callback.
One of these is passed to an AudioIODevice object to stream the audio data in and out.
Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.
Base class for an audio device with synchronised input and output channels.
An arbitrarily large integer class.
Holds a list of ChangeListeners, and sends messages to them when instructed.
Controls a physical MIDI output device.
An array designed for holding objects.
A base class which provides methods for reference-counting.
Used to build a tree of elements representing an XML document.
#define JUCE_API
This macro is added to all JUCE public class declarations.
A simple wrapper around std::atomic.
This structure holds a set of properties describing the current audio setup.
String outputDeviceName
The name of the audio device used for output.
String inputDeviceName
The name of the audio device used for input.
BigInteger outputChannels
The set of active output channels.
BigInteger inputChannels
The set of active input channels.
A simple reference-counted struct that holds a level-meter value that can be read using getCurrentLev...