Repository navigation
Plan phases without FL: background loads, undo steps, sample view, saved view, layout header - #19
Merged
Merged
Conversation
A file opened, dropped, pasted or reloaded in the editor was read and its precomputed copy built on the message thread, and so was tempo detection: a long file held the host's window. The processor has one worker thread now. The load is split in two: a file is read into a sample (decodeSample, which touches nothing of the processor's but the format manager) and the sample is put in place (applySample, on the message thread, one edit). The editor's paths read and build on the worker and apply when both are ready; a later request, or a sample put in place meanwhile, replaces one still reading. A project, a preset, the history and the tests keep the call that has the sample in place when it returns. The worker is joined when the plug-in goes away, and no completion runs afterwards. The UI test drops a file on the editor: the drop returned with the sample loaded before, and returns first now. It also covers a file that cannot be read, a plug-in removed in the middle of a read, and two files asked for one after the other. An imported preset still reads its sample on the message thread. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The sample's tempo was a state property outside every step: undo of a sample change left the tempo of the sample that went, and a tempo set with Detect tempo made no step and did not tell the host that the state changed. The history's snapshot and step hold the tempo now, restored after the sample, and Detect tempo sets it as one edit. A value set from a knob's menu ended its gesture before what follows it ran (the linked loop END, PITCH switching Resample to Auto), which made a second step. The follow-up runs inside the gesture now, as in a drag. The UI tests: the tempo after undo of a sample change was 0 and is 120; a PITCH value from the menu made 2 steps and makes 1; a change of the tempo is one step. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
While a note plays the view repainted whole up to 60 times a second, and the wave drawing read the audio of every pixel column each time, for the main view and the overview. The timer now repaints the play bar's two strips (where it was and where it is) unless a marker moved, and the wave drawing reads only the columns inside the area being painted, with eight more on either side so that the shape's edge there is the one a whole repaint draws. The spectrum image was keyed by the sample's address, so a new sample at a freed address could show the old image; it is told by the sample itself now. The UI test paints a 25 px strip: it read 1,061 of 1,061 columns before and reads 82 now, with every pixel of the strip equal to a whole repaint, for the filled shape and for the zoomed-in line. The seven screenshots are identical. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The sheet, the Tools / Effects tab, the envelope target page and the sample view's zoom were lost when the editor closed. They are state properties now (viewSheet, viewEffectsTab, viewTarget, viewFrom, viewTo), written when the user changes them and read when the editor opens, so they come back with a project and with a preset. A state without them shows what the editor showed before: the first sheet, Tools, the Volume page and the whole sample. The UI test saves a state with the INS sheet, Effects, Mod Y and a zoom of 0.25 to 0.5 and opens it in another instance: it came back as the first sheet at full zoom before, and comes back as saved now. The seven screenshots are identical. The on-screen keyboard's scroll position is not saved. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The editor placed everything by numbers in its own source. The canvas, the top bar, the three sheets, every panel and every page are tokens of plugin/Source/ui/Layout.h now (23 boxes, namespace cs::layout), and the editor places them by name. A script read the numbers from the editor's own calls, so the header holds exactly what the editor placed: the seven screenshots are identical. The controls inside a panel are still placed in the editor, beside the control they place. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Clang on macOS warns when a lambda's capture has the name of the parameter it is moved from (-Wshadow-uncaptured-local): the completion of a background load in the processor, and the estimate's completion in the sample view's tempo detection. The zero-warnings gate failed the macOS job on both. The captures have names of their own now. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The test that paints a strip of the sample view compared it with a whole repaint on the platform's image type. On macOS that is CoreGraphics, where 57 and 85 of 3,350 pixels differed and the test failed; on Windows and Linux none did. The comparison that decides the test now runs on JUCE's own renderer, the same on every platform. The platform's renderer is painted too and its result printed as a NOTE line: how many pixels differ, by how much at most, and where, so that the macOS log says what the difference is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The NOTE line that was to say what macOS makes of a strip of the sample view reaches no log: ctest prints the output of a failing test only. The platform's renderer is a test of its own now: the strip may differ from a whole repaint by at most 3 of 255 in a channel, which is anti-aliasing rounded another way. JUCE's own renderer stays at no difference at all. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The rest of the review's plan that needs no FL Studio, as five stacked commits. No commit changes the sound: the
render regression is 21 of 21 at the tip.
7f61cb3): a file opened, dropped, pasted or reloaded in the editor is read andits precomputed copy built on a worker thread of the processor, and tempo detection runs there too. The sample
changes on the message thread when it is ready. A project, a preset and the history keep the call that has the
sample in place when it returns.
9e52f78): the sample's tempo belongs to the steps, and a tempo set with Detect tempo is a stepthat tells the host the state changed. A value set from a knob's menu and what follows it (the linked loop END,
PITCH switching Resample to Auto) are one step.
db30cd1): while a note plays only the play bar's strips are repainted, and the wave drawingreads only the columns inside the area being painted. The spectrum image is told by the sample itself, not by
its address.
20d8834), new: the sheet, the Tools / Effects tab, the envelope target page and thesample view's zoom are saved with a project and a preset.
9fe4fa2): the canvas, the top bar, the sheets, the panels and the pages are tokens ofplugin/Source/ui/Layout.h.How it was checked
scripts\check.ps1 -KeepFlafter each commit: repo, lint, build, zero warnings, ctest 9 of 9 and the renderregression all ok.
now), the tempo after undo of a sample change (0, now 120), a PITCH value from the menu (2 steps, now 1), a 25 px
strip of the sample view (1,061 of 1,061 columns read, now 82, every pixel equal to a whole repaint), the view
after a state round trip (the first sheet at full zoom, now as saved).
the other, a change of the tempo as one step, a state with no view.
docs/screenshots, regenerated after commits 3, 4 and 5, are identical to the committed ones.Not in this pull request: an imported preset still reads its sample on the message thread; the on-screen keyboard's
scroll position is not saved; the controls inside a panel are still placed in the editor.
ctestpasses and the render regression is green (CI runs both)CHANGELOG.mdunder## Unreleased🤖 Generated with Claude Code