Browse Source

Added a flag JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING which can be used to avoid sanity-checks on plugin parameter gestures

tags/2021-05-28
jules 10 years ago
parent
commit
dccd4f0393
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
  2. +1
    -1
      modules/juce_audio_processors/processors/juce_AudioProcessor.h

+ 3
- 3
modules/juce_audio_processors/processors/juce_AudioProcessor.cpp View File

@@ -48,7 +48,7 @@ AudioProcessor::~AudioProcessor()
// that it refers to is deleted.. // that it refers to is deleted..
jassert (activeEditor == nullptr); jassert (activeEditor == nullptr);
#if JUCE_DEBUG
#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
// This will fail if you've called beginParameterChangeGesture() for one // This will fail if you've called beginParameterChangeGesture() for one
// or more parameters without having made a corresponding call to endParameterChangeGesture... // or more parameters without having made a corresponding call to endParameterChangeGesture...
jassert (changingParams.countNumberOfSetBits() == 0); jassert (changingParams.countNumberOfSetBits() == 0);
@@ -142,7 +142,7 @@ void AudioProcessor::beginParameterChangeGesture (int parameterIndex)
{ {
if (isPositiveAndBelow (parameterIndex, getNumParameters())) if (isPositiveAndBelow (parameterIndex, getNumParameters()))
{ {
#if JUCE_DEBUG
#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
// This means you've called beginParameterChangeGesture twice in succession without a matching // This means you've called beginParameterChangeGesture twice in succession without a matching
// call to endParameterChangeGesture. That might be fine in most hosts, but better to avoid doing it. // call to endParameterChangeGesture. That might be fine in most hosts, but better to avoid doing it.
jassert (! changingParams [parameterIndex]); jassert (! changingParams [parameterIndex]);
@@ -163,7 +163,7 @@ void AudioProcessor::endParameterChangeGesture (int parameterIndex)
{ {
if (isPositiveAndBelow (parameterIndex, getNumParameters())) if (isPositiveAndBelow (parameterIndex, getNumParameters()))
{ {
#if JUCE_DEBUG
#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
// This means you've called endParameterChangeGesture without having previously called // This means you've called endParameterChangeGesture without having previously called
// beginParameterChangeGesture. That might be fine in most hosts, but better to keep the // beginParameterChangeGesture. That might be fine in most hosts, but better to keep the
// calls matched correctly. // calls matched correctly.


+ 1
- 1
modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -682,7 +682,7 @@ private:
OwnedArray<AudioProcessorParameter> managedParameters; OwnedArray<AudioProcessorParameter> managedParameters;
AudioProcessorParameter* getParamChecked (int) const noexcept; AudioProcessorParameter* getParamChecked (int) const noexcept;
#if JUCE_DEBUG
#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
BigInteger changingParams; BigInteger changingParams;
#endif #endif


Loading…
Cancel
Save