diff --git a/modules/juce_audio_basics/mpe/juce_MPEZone.cpp b/modules/juce_audio_basics/mpe/juce_MPEZone.cpp index 54b2fc2b48..e2f6030dfd 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZone.cpp +++ b/modules/juce_audio_basics/mpe/juce_MPEZone.cpp @@ -144,6 +144,20 @@ bool MPEZone::truncateToFit (MPEZone other) noexcept return true; } +//========================================================================== +bool MPEZone::operator== (const MPEZone& other) const noexcept +{ + return masterChannel == other.masterChannel + && numNoteChannels == other.numNoteChannels + && perNotePitchbendRange == other.perNotePitchbendRange + && masterPitchbendRange == other.masterPitchbendRange; +} + +bool MPEZone::operator!= (const MPEZone& other) const noexcept +{ + return ! operator== (other); +} + //============================================================================== //============================================================================== #if JUCE_UNIT_TESTS diff --git a/modules/juce_audio_basics/mpe/juce_MPEZone.h b/modules/juce_audio_basics/mpe/juce_MPEZone.h index b0471e2561..ebd1a2f640 100644 --- a/modules/juce_audio_basics/mpe/juce_MPEZone.h +++ b/modules/juce_audio_basics/mpe/juce_MPEZone.h @@ -120,6 +120,12 @@ struct JUCE_API MPEZone */ bool truncateToFit (MPEZone zoneToAvoid) noexcept; + /** @returns true if this zone is equal to the one passed in. */ + bool operator== (const MPEZone& other) const noexcept; + + /** @returns true if this zone is not equal to the one passed in. */ + bool operator!= (const MPEZone& other) const noexcept; + private: //========================================================================== int masterChannel;