Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
84da4b0622
2 changed files with 10 additions and 8 deletions
  1. +3
    -3
      src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp
  2. +7
    -5
      src/juce_appframework/audio/midi/juce_MidiMessageSequence.h

+ 3
- 3
src/juce_appframework/audio/midi/juce_MidiMessageSequence.cpp View File

@@ -173,17 +173,17 @@ void MidiMessageSequence::deleteEvent (const int index,
void MidiMessageSequence::addSequence (const MidiMessageSequence& other, void MidiMessageSequence::addSequence (const MidiMessageSequence& other,
double timeAdjustment, double timeAdjustment,
double firstAllowableTime, double firstAllowableTime,
double lastAllowableTime)
double endOfAllowableDestTimes)
{ {
firstAllowableTime -= timeAdjustment; firstAllowableTime -= timeAdjustment;
lastAllowableTime -= timeAdjustment;
endOfAllowableDestTimes -= timeAdjustment;
for (int i = 0; i < other.list.size(); ++i) for (int i = 0; i < other.list.size(); ++i)
{ {
const MidiMessage& m = other.list.getUnchecked(i)->message; const MidiMessage& m = other.list.getUnchecked(i)->message;
const double t = m.getTimeStamp(); const double t = m.getTimeStamp();
if (t >= firstAllowableTime && t < lastAllowableTime)
if (t >= firstAllowableTime && t < endOfAllowableDestTimes)
{ {
MidiEventHolder* const newOne = new MidiEventHolder (m); MidiEventHolder* const newOne = new MidiEventHolder (m);
newOne->message.setTimeStamp (timeAdjustment + t); newOne->message.setTimeStamp (timeAdjustment + t);


+ 7
- 5
src/juce_appframework/audio/midi/juce_MidiMessageSequence.h View File

@@ -188,15 +188,17 @@ public:
@param other the sequence to add from @param other the sequence to add from
@param timeAdjustmentDelta an amount to add to the timestamps of the midi events @param timeAdjustmentDelta an amount to add to the timestamps of the midi events
as they are read from the other sequence 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, void addSequence (const MidiMessageSequence& other,
double timeAdjustmentDelta, double timeAdjustmentDelta,
double firstAllowableDestTime, double firstAllowableDestTime,
double lastAllowableDestTime);
double endOfAllowableDestTimes);
//============================================================================== //==============================================================================
/** Makes sure all the note-on and note-off pairs are up-to-date. /** Makes sure all the note-on and note-off pairs are up-to-date.


Loading…
Cancel
Save