Fix beat clips being created with a lenght of 0 in the pattern editor#8355
Conversation
… the pattern editor
|
Could we get a little explanation as to why this works? It'd help with the code review! |
|
I asked GH Copilot and got this, so feel free to expand on this. Issue #8101 is about the pattern editor showing blank tracks (no steps) for newly created sample tracks. The error messages you're seeing (called The original saveJournallingState(false);
updateLength();
restoreJournallingState();This happens for all When a new
The PR wraps the problematic code in a conditional check: if (getTrack()->trackContainer() != Engine::patternStore())
{
saveJournallingState(false);
updateLength();
restoreJournallingState();
}This means:
By skipping these operations for pattern store clips, the code avoids triggering clip access during initialization, preventing the "Clip doesn't exist" errors. The pattern store handles its own initialization separately, so this code path isn't needed there anyway. This is why the PR works! It prevents the premature clip access that was causing blank pattern editor tracks. |
|
Copilot (almost) got it perfectly right ! As I detailed in my original comment on #8101, (And no, this PR should not affect journalling in any way, I think copilot hallucinated this point) |
|
Thanks for the awesome explanation! |
bratpeki
left a comment
There was a problem hiding this comment.
Approved for code and testing. Will merge soon.
regulus79
left a comment
There was a problem hiding this comment.
I tested this, and it seems to work fine.
|
Okay, testing now! |
closes #8101
The context and motivations for this pr can be found in the issue's thread