diff --git a/src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp b/src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp index 13e14875f1..88f382a52b 100644 --- a/src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp +++ b/src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp @@ -173,17 +173,17 @@ void MidiMessageSequence::deleteEvent (const int index, void MidiMessageSequence::addSequence (const MidiMessageSequence& other, double timeAdjustment, double firstAllowableTime, - double lastAllowableTime) + double endOfAllowableDestTimes) { firstAllowableTime -= timeAdjustment; - lastAllowableTime -= timeAdjustment; + endOfAllowableDestTimes -= timeAdjustment; for (int i = 0; i < other.list.size(); ++i) { const MidiMessage& m = other.list.getUnchecked(i)->message; const double t = m.getTimeStamp(); - if (t >= firstAllowableTime && t < lastAllowableTime) + if (t >= firstAllowableTime && t < endOfAllowableDestTimes) { MidiEventHolder* const newOne = new MidiEventHolder (m); newOne->message.setTimeStamp (timeAdjustment + t); diff --git a/src/juce_appframework/audio/midi/juce_MidiMessageSequence.h b/src/juce_appframework/audio/midi/juce_MidiMessageSequence.h index 218f6a089c..de18804907 100644 --- a/src/juce_appframework/audio/midi/juce_MidiMessageSequence.h +++ b/src/juce_appframework/audio/midi/juce_MidiMessageSequence.h @@ -188,15 +188,17 @@ public: @param other the sequence to add from @param timeAdjustmentDelta an amount to add to the timestamps of the midi events as they are read from the other sequence - @param firstAllowableDestTime events being added will be discarded if they - are earlier than this time - @param lastAllowableDestTime events being added will be discarded if they - are later than this time + @param firstAllowableDestTime events will not be added if their time is earlier + than this time. (This is after their time has been adjusted + by the timeAdjustmentDelta) + @param endOfAllowableDestTimes events will not be added if their time is equal to + or greater than this time. (This is after their time has + been adjusted by the timeAdjustmentDelta) */ void addSequence (const MidiMessageSequence& other, double timeAdjustmentDelta, double firstAllowableDestTime, - double lastAllowableDestTime); + double endOfAllowableDestTimes); //============================================================================== /** Makes sure all the note-on and note-off pairs are up-to-date.