mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Removed some unnecessary locking from AudioDeviceManager.
This commit is contained in:
parent
ba2dc52b34
commit
06fcb55ea6
2 changed files with 3 additions and 10 deletions
|
|
@ -94,7 +94,6 @@ AudioDeviceManager::AudioDeviceManager()
|
|||
numOutputChansNeeded (2),
|
||||
listNeedsScanning (true),
|
||||
useInputNames (false),
|
||||
inputLevelMeasurementEnabledCount (0),
|
||||
inputLevel (0),
|
||||
tempBuffer (2, 2),
|
||||
cpuUsageMs (0),
|
||||
|
|
@ -615,13 +614,9 @@ void AudioDeviceManager::updateXml()
|
|||
const StringArray availableMidiDevices (MidiInput::getDevices());
|
||||
|
||||
for (int i = 0; i < midiInsFromXml.size(); ++i)
|
||||
{
|
||||
if (! availableMidiDevices.contains (midiInsFromXml[i], true))
|
||||
{
|
||||
lastExplicitSettings->createNewChildElement ("MIDIINPUT")
|
||||
->setAttribute ("name", midiInsFromXml[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultMidiOutputName.isNotEmpty())
|
||||
|
|
@ -670,7 +665,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
|
|||
{
|
||||
const ScopedLock sl (audioCallbackLock);
|
||||
|
||||
if (inputLevelMeasurementEnabledCount > 0 && numInputChannels > 0)
|
||||
if (inputLevelMeasurementEnabledCount.get() > 0 && numInputChannels > 0)
|
||||
{
|
||||
for (int j = 0; j < numSamples; ++j)
|
||||
{
|
||||
|
|
@ -950,8 +945,6 @@ void AudioDeviceManager::playTestSound()
|
|||
|
||||
void AudioDeviceManager::enableInputLevelMeasurement (const bool enableMeasurement)
|
||||
{
|
||||
const ScopedLock sl (audioCallbackLock);
|
||||
|
||||
if (enableMeasurement)
|
||||
++inputLevelMeasurementEnabledCount;
|
||||
else
|
||||
|
|
@ -962,6 +955,6 @@ void AudioDeviceManager::enableInputLevelMeasurement (const bool enableMeasureme
|
|||
|
||||
double AudioDeviceManager::getCurrentInputLevel() const
|
||||
{
|
||||
jassert (inputLevelMeasurementEnabledCount > 0); // you need to call enableInputLevelMeasurement() before using this!
|
||||
jassert (inputLevelMeasurementEnabledCount.get() > 0); // you need to call enableInputLevelMeasurement() before using this!
|
||||
return inputLevel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ private:
|
|||
ScopedPointer <XmlElement> lastExplicitSettings;
|
||||
mutable bool listNeedsScanning;
|
||||
bool useInputNames;
|
||||
int inputLevelMeasurementEnabledCount;
|
||||
Atomic<int> inputLevelMeasurementEnabledCount;
|
||||
double inputLevel;
|
||||
ScopedPointer <AudioSampleBuffer> testSound;
|
||||
int testSoundPosition;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue