|
@@ -195,11 +195,11 @@ void PlaybackScreen::toggleOnMessage(std::shared_ptr<midi::NoteOnMessage> onMsg_
|
|
const BeatSequenceNoteInformation& noteInfo
|
|
const BeatSequenceNoteInformation& noteInfo
|
|
= sequencer.beats.getNoteInfo(onMsg_ptr->channel, onMsg_ptr->pitch);
|
|
= sequencer.beats.getNoteInfo(onMsg_ptr->channel, onMsg_ptr->pitch);
|
|
|
|
|
|
- const midi::MessageList& beat = sequencer.beats[beatIndex];
|
|
|
|
- midi::MessageList::const_iterator beatOnMsg_it = beat.find(*onMsg_ptr);
|
|
|
|
|
|
+ midi::MessageList& beat = sequencer.beats[beatIndex];
|
|
|
|
+ midi::MessageList::iterator beatOnMsg_it = beat.find(*onMsg_ptr);
|
|
if(beatOnMsg_it == beat.end()) {
|
|
if(beatOnMsg_it == beat.end()) {
|
|
// further steps depend on whether a off message has been inserted at the current position
|
|
// further steps depend on whether a off message has been inserted at the current position
|
|
- midi::MessageList::const_iterator beatOffMsg_it = beat.find(onMsg_ptr->toOffMessage(0));
|
|
|
|
|
|
+ midi::MessageList::iterator beatOffMsg_it = beat.find(onMsg_ptr->toOffMessage(0));
|
|
BeatIndex nextBeatIndex = (beatIndex + 1) % sequencer.beats.size();
|
|
BeatIndex nextBeatIndex = (beatIndex + 1) % sequencer.beats.size();
|
|
if(beatOffMsg_it == beat.end()) {
|
|
if(beatOffMsg_it == beat.end()) {
|
|
// is there a ongoing msg, that has to be stopped first?
|
|
// is there a ongoing msg, that has to be stopped first?
|
|
@@ -222,9 +222,9 @@ void PlaybackScreen::toggleOnMessage(std::shared_ptr<midi::NoteOnMessage> onMsg_
|
|
sequencer.beats.pushFrontMessage(beatIndex, std::shared_ptr<midi::Message>(new midi::NoteOffMessage(offMsg)));
|
|
sequencer.beats.pushFrontMessage(beatIndex, std::shared_ptr<midi::Message>(new midi::NoteOffMessage(offMsg)));
|
|
// since the new note will be stopped on the next beat,
|
|
// since the new note will be stopped on the next beat,
|
|
// remove this extra off message, which no longer stops the preceding note.
|
|
// remove this extra off message, which no longer stops the preceding note.
|
|
- const midi::MessageList& precedingOnFollowingOffBeat
|
|
|
|
|
|
+ midi::MessageList& precedingOnFollowingOffBeat
|
|
= sequencer.beats[*precedingOnFollowingOffMsgBeatIndex_it];
|
|
= sequencer.beats[*precedingOnFollowingOffMsgBeatIndex_it];
|
|
- const midi::MessageList::const_iterator precedingOnFollowingOffMsg_it
|
|
|
|
|
|
+ const midi::MessageList::iterator precedingOnFollowingOffMsg_it
|
|
= precedingOnFollowingOffBeat.find(offMsg);
|
|
= precedingOnFollowingOffBeat.find(offMsg);
|
|
assert(precedingOnFollowingOffMsg_it != precedingOnFollowingOffBeat.end());
|
|
assert(precedingOnFollowingOffMsg_it != precedingOnFollowingOffBeat.end());
|
|
sequencer.beats.eraseMessage(
|
|
sequencer.beats.eraseMessage(
|
|
@@ -253,8 +253,8 @@ void PlaybackScreen::toggleOnMessage(std::shared_ptr<midi::NoteOnMessage> onMsg_
|
|
assert(*offPrecedingOnBeatIndex_it >= beatIndex);
|
|
assert(*offPrecedingOnBeatIndex_it >= beatIndex);
|
|
if(*offPrecedingOnBeatIndex_it == beatIndex) {
|
|
if(*offPrecedingOnBeatIndex_it == beatIndex) {
|
|
// no relevant on message before off found. so off may be removed.
|
|
// no relevant on message before off found. so off may be removed.
|
|
- const midi::MessageList& followingOffBeat = sequencer.beats[followingOffBeatIndex];
|
|
|
|
- midi::MessageList::const_iterator followingOffMsg_it = followingOffBeat.find(offMsg);
|
|
|
|
|
|
+ midi::MessageList& followingOffBeat = sequencer.beats[followingOffBeatIndex];
|
|
|
|
+ midi::MessageList::iterator followingOffMsg_it = followingOffBeat.find(offMsg);
|
|
assert(followingOffMsg_it != followingOffBeat.end());
|
|
assert(followingOffMsg_it != followingOffBeat.end());
|
|
sequencer.beats.eraseMessage(*followingOffBeatIndex_it, followingOffMsg_it);
|
|
sequencer.beats.eraseMessage(*followingOffBeatIndex_it, followingOffMsg_it);
|
|
}
|
|
}
|