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);
204 std::unique_ptr<XmlElement> createStateXml()
const;
262 void setCurrentAudioDeviceType (
const String& type,
bool treatAsChosenDevice);
268 void closeAudioDevice();
278 void restartLastAudioDevice();
309 double getCpuUsage()
const;
331 void setMidiInputDeviceEnabled (
const String& deviceIdentifier,
bool enabled);
337 bool isMidiInputDeviceEnabled (
const String& deviceIdentifier)
const;
349 void addMidiInputDeviceCallback (
const String& deviceIdentifier,
353 void removeMidiInputDeviceCallback (
const String& deviceIdentifier,
369 void setDefaultMidiOutputDevice (
const String& deviceIdentifier);
399 void addAudioDeviceType (std::unique_ptr<AudioIODeviceType> newDeviceType);
410 void playTestSound();
425 double getCurrentLevel()
const noexcept;
433 void updateLevel (
const float*
const*,
int numChannels,
int numSamples) noexcept;
470 int getXRunCount()
const noexcept;
474 void setMidiInputEnabled (
const String&,
bool);
476 bool isMidiInputEnabled (
const String&)
const;
482 void setDefaultMidiOutput (
const String&);
492 std::unique_ptr<AudioIODevice> currentAudioDevice;
494 int numInputChansNeeded = 0, numOutputChansNeeded = 2;
495 String preferredDeviceName, currentDeviceType;
496 std::unique_ptr<XmlElement> lastExplicitSettings;
497 mutable bool listNeedsScanning =
true;
500 struct MidiCallbackInfo
507 std::vector<std::unique_ptr<MidiInput>> enabledMidiInputs;
511 std::unique_ptr<MidiOutput> defaultMidiOutput;
514 std::unique_ptr<AudioBuffer<float>> testSound;
515 int testSoundPosition = 0;
524 std::unique_ptr<CallbackHandler> callbackHandler;
526 void audioDeviceIOCallbackInt (
const float** inputChannelData,
int totalNumInputChannels,
527 float** outputChannelData,
int totalNumOutputChannels,
int numSamples);
529 void audioDeviceStoppedInt();
530 void audioDeviceErrorInt (
const String&);
532 void audioDeviceListChanged();
534 String restartDevice (
int blockSizeToUse,
double sampleRateToUse,
540 void createDeviceTypesIfNeeded();
541 void scanDevicesIfNeeded();
542 void deleteCurrentDevice();
543 double chooseBestSampleRate (
double preferred)
const;
544 int chooseBestBufferSize (
int preferred)
const;
547 String initialiseFromXML (
const XmlElement&,
bool selectDefaultDeviceOnFailure,
LevelMeter::Ptr getOutputLevelGetter() noexcept
Returns a reference-counted object that can be used to get the current output level.
One of these is passed to an AudioIODevice object to stream the audio data in and out...
BigInteger outputChannels
The set of active output channels.
#define JUCE_API
This macro is added to all JUCE public class declarations.
Encapsulates a MIDI message.
String getCurrentAudioDeviceType() const
Returns the type of audio device currently in use.
String outputDeviceName
The name of the audio device used for output.
Used to build a tree of elements representing an XML document.
AudioIODevice * getCurrentAudioDevice() const noexcept
Returns the currently-active audio device.
CriticalSection & getMidiCallbackLock() noexcept
Returns the a lock that can be used to synchronise access to the midi callback.
CriticalSection & getAudioCallbackLock() noexcept
Returns the a lock that can be used to synchronise access to the audio callback.
BigInteger inputChannels
The set of active input channels.
An arbitrarily large integer class.
const String & getDefaultMidiOutputName() const noexcept
Deprecated.
This struct contains information about a MIDI input or output device.
Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.
Holds a list of ChangeListeners, and sends messages to them when instructed.
String inputDeviceName
The name of the audio device used for input.
Holds a resizable array of primitive or copy-by-value objects.
Base class for an audio device with synchronised input and output channels.
This structure holds a set of properties describing the current audio setup.
Maintains an ongoing measurement of the proportion of time which is being spent inside an audio callb...
Represents a midi output device.
const String & getDefaultMidiOutputIdentifier() const noexcept
Returns the name of the default midi output.
MidiOutput * getDefaultMidiOutput() const noexcept
Returns the current default midi output device.
An array designed for holding objects.
A base class which provides methods for reference-counting.
A simple reference-counted struct that holds a level-meter value that can be read using getCurrentLev...
Manages the state of some audio and midi i/o devices.
LevelMeter::Ptr getInputLevelGetter() noexcept
Returns a reference-counted object that can be used to get the current input level.