From 44c92e95c0d4977c1e42e61144b72821bcfe5a31 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 12 Aug 2020 14:01:43 +0100 Subject: [PATCH] Defined AudioPlayHead::CurrentPositionInfo methods inline --- .../audio_play_head/juce_AudioPlayHead.h | 31 +++++++++++++++++-- .../processors/juce_AudioProcessor.cpp | 31 ------------------- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h b/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h index f12ea65d11..ebbb68d931 100644 --- a/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h +++ b/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h @@ -122,10 +122,35 @@ public: bool isLooping; //============================================================================== - bool operator== (const CurrentPositionInfo& other) const noexcept; - bool operator!= (const CurrentPositionInfo& other) const noexcept; + bool operator== (const CurrentPositionInfo& other) const noexcept + { + return timeInSamples == other.timeInSamples + && ppqPosition == other.ppqPosition + && editOriginTime == other.editOriginTime + && ppqPositionOfLastBarStart == other.ppqPositionOfLastBarStart + && frameRate == other.frameRate + && isPlaying == other.isPlaying + && isRecording == other.isRecording + && bpm == other.bpm + && timeSigNumerator == other.timeSigNumerator + && timeSigDenominator == other.timeSigDenominator + && ppqLoopStart == other.ppqLoopStart + && ppqLoopEnd == other.ppqLoopEnd + && isLooping == other.isLooping; + } - void resetToDefault(); + bool operator!= (const CurrentPositionInfo& other) const noexcept + { + return ! operator== (other); + } + + void resetToDefault() + { + zerostruct (*this); + timeSigNumerator = 4; + timeSigDenominator = 4; + bpm = 120; + } }; //============================================================================== diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp index caa55b6180..c805991315 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp @@ -1563,35 +1563,4 @@ void AudioProcessorParameter::removeListener (AudioProcessorParameter::Listener* listeners.removeFirstMatchingValue (listenerToRemove); } -//============================================================================== -bool AudioPlayHead::CurrentPositionInfo::operator== (const CurrentPositionInfo& other) const noexcept -{ - return timeInSamples == other.timeInSamples - && ppqPosition == other.ppqPosition - && editOriginTime == other.editOriginTime - && ppqPositionOfLastBarStart == other.ppqPositionOfLastBarStart - && frameRate == other.frameRate - && isPlaying == other.isPlaying - && isRecording == other.isRecording - && bpm == other.bpm - && timeSigNumerator == other.timeSigNumerator - && timeSigDenominator == other.timeSigDenominator - && ppqLoopStart == other.ppqLoopStart - && ppqLoopEnd == other.ppqLoopEnd - && isLooping == other.isLooping; -} - -bool AudioPlayHead::CurrentPositionInfo::operator!= (const CurrentPositionInfo& other) const noexcept -{ - return ! operator== (other); -} - -void AudioPlayHead::CurrentPositionInfo::resetToDefault() -{ - zerostruct (*this); - timeSigNumerator = 4; - timeSigDenominator = 4; - bpm = 120; -} - } // namespace juce