|
|
@@ -456,26 +456,27 @@ public: |
|
|
bool playOnAllOutputChannels = false);
|
|
|
bool playOnAllOutputChannels = false);
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
//==============================================================================
|
|
|
/** Turns on level-measuring.
|
|
|
|
|
|
|
|
|
|
|
|
When enabled, the device manager will measure the peak input level
|
|
|
|
|
|
across all channels, and you can get this level by calling getCurrentInputLevel().
|
|
|
|
|
|
|
|
|
|
|
|
This is mainly intended for audio setup UI panels to use to create a mic
|
|
|
|
|
|
level display, so that the user can check that they've selected the right
|
|
|
|
|
|
device.
|
|
|
|
|
|
|
|
|
/** Turns on level-measuring for input channels.
|
|
|
|
|
|
@see getCurrentInputLevel()
|
|
|
|
|
|
*/
|
|
|
|
|
|
void enableInputLevelMeasurement (bool enableMeasurement) noexcept;
|
|
|
|
|
|
|
|
|
A simple filter is used to make the level decay smoothly, but this is
|
|
|
|
|
|
only intended for giving rough feedback, and not for any kind of accurate
|
|
|
|
|
|
measurement.
|
|
|
|
|
|
|
|
|
/** Turns on level-measuring for output channels.
|
|
|
|
|
|
@see getCurrentOutputLevel()
|
|
|
*/
|
|
|
*/
|
|
|
void enableInputLevelMeasurement (bool enableMeasurement);
|
|
|
|
|
|
|
|
|
void enableOutputLevelMeasurement (bool enableMeasurement) noexcept;
|
|
|
|
|
|
|
|
|
/** Returns the current input level.
|
|
|
/** Returns the current input level.
|
|
|
To use this, you must first enable it by calling enableInputLevelMeasurement().
|
|
|
To use this, you must first enable it by calling enableInputLevelMeasurement().
|
|
|
See enableInputLevelMeasurement() for more info.
|
|
|
|
|
|
|
|
|
@see enableInputLevelMeasurement()
|
|
|
|
|
|
*/
|
|
|
|
|
|
double getCurrentInputLevel() const noexcept;
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the current output level.
|
|
|
|
|
|
To use this, you must first enable it by calling enableOutputLevelMeasurement().
|
|
|
|
|
|
@see enableOutputLevelMeasurement()
|
|
|
*/
|
|
|
*/
|
|
|
double getCurrentInputLevel() const;
|
|
|
|
|
|
|
|
|
double getCurrentOutputLevel() const noexcept;
|
|
|
|
|
|
|
|
|
/** Returns the a lock that can be used to synchronise access to the audio callback.
|
|
|
/** Returns the a lock that can be used to synchronise access to the audio callback.
|
|
|
Obviously while this is locked, you're blocking the audio thread from running, so
|
|
|
Obviously while this is locked, you're blocking the audio thread from running, so
|
|
|
@@ -502,8 +503,6 @@ private: |
|
|
BigInteger inputChannels, outputChannels;
|
|
|
BigInteger inputChannels, outputChannels;
|
|
|
ScopedPointer<XmlElement> lastExplicitSettings;
|
|
|
ScopedPointer<XmlElement> lastExplicitSettings;
|
|
|
mutable bool listNeedsScanning;
|
|
|
mutable bool listNeedsScanning;
|
|
|
Atomic<int> inputLevelMeasurementEnabledCount;
|
|
|
|
|
|
double inputLevel;
|
|
|
|
|
|
AudioSampleBuffer tempBuffer;
|
|
|
AudioSampleBuffer tempBuffer;
|
|
|
|
|
|
|
|
|
struct MidiCallbackInfo
|
|
|
struct MidiCallbackInfo
|
|
|
@@ -522,6 +521,19 @@ private: |
|
|
|
|
|
|
|
|
double cpuUsageMs, timeToCpuScale;
|
|
|
double cpuUsageMs, timeToCpuScale;
|
|
|
|
|
|
|
|
|
|
|
|
struct LevelMeter
|
|
|
|
|
|
{
|
|
|
|
|
|
LevelMeter() noexcept;
|
|
|
|
|
|
void updateLevel (const float* const*, int numChannels, int numSamples) noexcept;
|
|
|
|
|
|
void setEnabled (bool) noexcept;
|
|
|
|
|
|
double getCurrentLevel() const noexcept;
|
|
|
|
|
|
|
|
|
|
|
|
Atomic<int> enabled;
|
|
|
|
|
|
double level;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
LevelMeter inputLevelMeter, outputLevelMeter;
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
//==============================================================================
|
|
|
class CallbackHandler;
|
|
|
class CallbackHandler;
|
|
|
friend class CallbackHandler;
|
|
|
friend class CallbackHandler;
|
|
|
|