Exemple #1
0
    //==============================================================================
    void testOverlapsWith (int masterChannelFirst, int numNoteChannelsFirst,
                           int masterChannelSecond, int numNoteChannelsSecond,
                           bool expectedRetVal)
    {
        MPEZone first (masterChannelFirst, numNoteChannelsFirst);
        MPEZone second (masterChannelSecond, numNoteChannelsSecond);

        expect (first.overlapsWith (second) == expectedRetVal);
        expect (second.overlapsWith (first) == expectedRetVal);
    }
Exemple #2
0
//==============================================================================
bool MPEZone::overlapsWith (MPEZone other) const noexcept
{
    if (masterChannel == other.masterChannel)
        return true;

    if (masterChannel > other.masterChannel)
        return other.overlapsWith (*this);

    return masterChannel + numNoteChannels >= other.masterChannel;
}