Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/audiomixerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static bool midiPickupShouldApply ( int midiValue, int currentValue, int toleran
// Handles the case where rapid movement causes MIDI values to "skip over" the software value
if ( recentMidiValues.size() >= 2 )
{
int prevMidi = recentMidiValues.back();
int prevMidi = recentMidiValues[recentMidiValues.size() - 2];
Comment thread
pljones marked this conversation as resolved.
// Check if current and previous MIDI values bracket the software value
if ( ( prevMidi <= currentValue && midiValue >= currentValue ) || ( prevMidi >= currentValue && midiValue <= currentValue ) )
return true;
Expand All @@ -117,7 +117,11 @@ static bool midiPickupTryApply ( int midiValue, int currentValue, int tolerance,
tempPickup.push_back ( midiValue );

if ( !midiPickupShouldApply ( midiValue, currentValue, tolerance, tempPickup ) )
{
// keep this value: the next message needs it to detect a crossing
pickupBuffer = tempPickup;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's pickupBuffer defined and used? (Maybe hint that in the comment - but if it's obvious, this comment is fine.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcfnord please have a look at the PRs you/your agent looked at and comment...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI: pickupBuffer is a parameter name, not an object: midiPickupTryApply takes the caller's deque by reference, and midiPickupInactivityCheck takes the same deque to clear it. The objects behind it are the two per-channel deques in MidiPickupState: SetFaderLevel passes recentFader, SetPanValue passes recentPan. The name is unchanged from 97799184; this PR only adds the write-back under the comment.

Naming the referent:

// still waiting: keep this value in the channel's recentFader/recentPan
// history so the next message can detect a crossing

Not pushed — the branch still carries the one-line form.

return true; // Still waiting for pickup
}

// Picked up. Stop waiting
waitingForPickup = false;
Expand Down
Loading