Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meowgli's tweak https://github.com/milkytracker/MilkyTracker/issues/304 #313

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions src/tracker/RecorderLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,18 @@ void RecorderLogic::sendNoteDownToPatternEditor(PPEvent* event, pp_int32 note, P
event->cancel();
return;
}

bool record = (tracker.editMode == EditModeMilkyTracker ? tracker.screen->hasFocus(patternEditorControl) : recordMode);
bool releasePlay = false;
bool isLiveRecording = playerController->isPlaying() &&
!playerController->isPlayingRowOnly() &&
record &&
tracker.shouldFollowSong();

// when we're not live recording, we need to decide if we're editing
if (!isLiveRecording)
{
releasePlay = !record;
}
// if we're live recording this is a "release" play, it means that the
// note will not be repeated on a key being pressed, it will stay on
// 'till the key is released, but only when the current selected column
// is the note column
else
{
releasePlay = patternEditorControl->getCursorPosInner() == 0;
}

!playerController->isPlayingRowOnly() &&
record &&
tracker.shouldFollowSong();
// separated out releaseplay filtering from the currently in use isLiveRecording to break as few things as possible while filtering note key repeats from the OS
//
// Key repeat suppression is enabled when we are looking at a note column (wider suppression than previously done with isLiveRecording)
releasePlay = patternEditorControl->getCursorPosInner() == 0;

if (releasePlay)
{
// Somewhere editing of text in an edit field takes place,
Expand All @@ -126,16 +116,17 @@ void RecorderLogic::sendNoteDownToPatternEditor(PPEvent* event, pp_int32 note, P
// this key is already pressed, we won't play that note again
if (isPressed)
{
// If we're live recording, this event should not be routed anywhere else
// If we're recording, this event should not be routed anywhere else
// it terminates HERE! (event shall not be routed to the pattern editor)
if (isLiveRecording && event)
if (!playerController->isPlayingRowOnly() && record && event)
event->cancel();
return;
}

// if we're not recording, cycle through the channels
// use jam-channels for playing if requested
if (!isLiveRecording)
// use jam-channels for playing if requested,
// use jam channels when recording/demoing notes under playback when not following song.
if (!(playerController->isPlaying() && record) || !tracker.shouldFollowSong())
{
chn = playerController->getNextPlayingChannel(chn);
}
Expand All @@ -145,7 +136,6 @@ void RecorderLogic::sendNoteDownToPatternEditor(PPEvent* event, pp_int32 note, P
// next channel is the current channel within the pattern editor
chn = playerController->getNextRecordingChannel(chn);
}

}
else
{
Expand Down