Browse Source

Optimisation to AudioDeviceSelectorComponent.

tags/2021-05-28
jules 11 years ago
parent
commit
a8f9fdc54b
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp

+ 11
- 4
modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -40,12 +40,19 @@ public:
void timerCallback() override
{
const float newLevel = (float) manager.getCurrentInputLevel();
if (isShowing())
{
const float newLevel = (float) manager.getCurrentInputLevel();
if (std::abs (level - newLevel) > 0.005f)
if (std::abs (level - newLevel) > 0.005f)
{
level = newLevel;
repaint();
}
}
else
{
level = newLevel;
repaint();
level = 0;
}
}


Loading…
Cancel
Save