|
|
@@ -209,10 +209,9 @@ public: |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Returns the current device properties that are in use.
|
|
|
|
|
|
|
|
@see setAudioDeviceSetup
|
|
|
|
*/
|
|
|
|
void getAudioDeviceSetup (AudioDeviceSetup& setup);
|
|
|
|
void getAudioDeviceSetup (AudioDeviceSetup& result);
|
|
|
|
|
|
|
|
/** Changes the current device or its settings.
|
|
|
|
|
|
|
@@ -261,9 +260,7 @@ public: |
|
|
|
void setCurrentAudioDeviceType (const String& type,
|
|
|
|
bool treatAsChosenDevice);
|
|
|
|
|
|
|
|
|
|
|
|
/** Closes the currently-open device.
|
|
|
|
|
|
|
|
You can call restartLastAudioDevice() later to reopen it in the same state
|
|
|
|
that it was just in.
|
|
|
|
*/
|
|
|
@@ -305,8 +302,8 @@ public: |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Returns the average proportion of available CPU being spent inside the audio callbacks.
|
|
|
|
|
|
|
|
Returns a value between 0 and 1.0
|
|
|
|
@returns A value between 0 and 1.0 to indicate the approximate proportion of CPU
|
|
|
|
time spent in the callbacks.
|
|
|
|
*/
|
|
|
|
double getCpuUsage() const;
|
|
|
|
|
|
|
@@ -333,16 +330,16 @@ public: |
|
|
|
void setMidiInputEnabled (const String& midiInputDeviceName, bool enabled);
|
|
|
|
|
|
|
|
/** Returns true if a given midi input device is being used.
|
|
|
|
|
|
|
|
@see setMidiInputEnabled
|
|
|
|
*/
|
|
|
|
bool isMidiInputEnabled (const String& midiInputDeviceName) const;
|
|
|
|
|
|
|
|
/** Registers a listener for callbacks when midi events arrive from a midi input.
|
|
|
|
|
|
|
|
The device name can be empty to indicate that it wants events from whatever the
|
|
|
|
current "default" device is. Or it can be the name of one of the midi input devices
|
|
|
|
(see MidiInput::getDevices() for the names).
|
|
|
|
The device name can be empty to indicate that it wants to receive all incoming
|
|
|
|
events from all the enabled MIDI inputs. Or it can be the name of one of the
|
|
|
|
MIDI input devices if it just wants the events from that device. (see
|
|
|
|
MidiInput::getDevices() for the list of device names).
|
|
|
|
|
|
|
|
Only devices which are enabled (see the setMidiInputEnabled() method) will have their
|
|
|
|
events forwarded on to listeners.
|
|
|
@@ -350,8 +347,7 @@ public: |
|
|
|
void addMidiInputCallback (const String& midiInputDeviceName,
|
|
|
|
MidiInputCallback* callback);
|
|
|
|
|
|
|
|
/** Removes a listener that was previously registered with addMidiInputCallback().
|
|
|
|
*/
|
|
|
|
/** Removes a listener that was previously registered with addMidiInputCallback(). */
|
|
|
|
void removeMidiInputCallback (const String& midiInputDeviceName,
|
|
|
|
MidiInputCallback* callback);
|
|
|
|
|
|
|
@@ -371,22 +367,17 @@ public: |
|
|
|
void setDefaultMidiOutput (const String& deviceName);
|
|
|
|
|
|
|
|
/** Returns the name of the default midi output.
|
|
|
|
|
|
|
|
@see setDefaultMidiOutput, getDefaultMidiOutput
|
|
|
|
*/
|
|
|
|
String getDefaultMidiOutputName() const { return defaultMidiOutputName; }
|
|
|
|
const String& getDefaultMidiOutputName() const noexcept { return defaultMidiOutputName; }
|
|
|
|
|
|
|
|
/** Returns the current default midi output device.
|
|
|
|
|
|
|
|
If no device has been selected, or the device can't be opened, this will
|
|
|
|
return 0.
|
|
|
|
|
|
|
|
If no device has been selected, or the device can't be opened, this will return nullptr.
|
|
|
|
@see getDefaultMidiOutputName
|
|
|
|
*/
|
|
|
|
MidiOutput* getDefaultMidiOutput() const noexcept { return defaultMidiOutput; }
|
|
|
|
|
|
|
|
/** Returns a list of the types of device supported.
|
|
|
|
*/
|
|
|
|
/** Returns a list of the types of device supported. */
|
|
|
|
const OwnedArray<AudioIODeviceType>& getAvailableDeviceTypes();
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
@@ -429,9 +420,7 @@ public: |
|
|
|
void enableInputLevelMeasurement (bool enableMeasurement);
|
|
|
|
|
|
|
|
/** Returns the current input level.
|
|
|
|
|
|
|
|
To use this, you must first enable it by calling enableInputLevelMeasurement().
|
|
|
|
|
|
|
|
See enableInputLevelMeasurement() for more info.
|
|
|
|
*/
|
|
|
|
double getCurrentInputLevel() const;
|
|
|
@@ -468,10 +457,16 @@ private: |
|
|
|
int testSoundPosition;
|
|
|
|
AudioSampleBuffer tempBuffer;
|
|
|
|
|
|
|
|
struct MidiCallbackInfo
|
|
|
|
{
|
|
|
|
String deviceName;
|
|
|
|
MidiInputCallback* callback;
|
|
|
|
};
|
|
|
|
|
|
|
|
StringArray midiInsFromXml;
|
|
|
|
OwnedArray<MidiInput> enabledMidiInputs;
|
|
|
|
Array<MidiInputCallback*> midiCallbacks;
|
|
|
|
StringArray midiCallbackDevices;
|
|
|
|
Array<MidiCallbackInfo> midiCallbacks;
|
|
|
|
|
|
|
|
String defaultMidiOutputName;
|
|
|
|
ScopedPointer<MidiOutput> defaultMidiOutput;
|
|
|
|
CriticalSection audioCallbackLock, midiCallbackLock;
|
|
|
|