Skip to content

Commit 71712e2

Browse files
committed
v0.8.9: fix macOS release build and harden async state updates
1 parent 37bc7c5 commit 71712e2

8 files changed

Lines changed: 356 additions & 94 deletions

File tree

src/PluginEditor.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ IntersectEditor::IntersectEditor (IntersectProcessor& p)
6161

6262
setWantsKeyboardFocus (true);
6363
setSize (kBaseW, kBaseH);
64+
lastUiSnapshotVersion = processor.getUiSliceSnapshotVersion();
6465
startTimerHz (30);
6566
}
6667

@@ -249,6 +250,14 @@ bool IntersectEditor::keyPressed (const juce::KeyPress& key)
249250
void IntersectEditor::timerCallback()
250251
{
251252
waveformView.rebuildCacheIfNeeded();
253+
bool uiChanged = false;
254+
255+
const auto snapshotVersion = processor.getUiSliceSnapshotVersion();
256+
if (snapshotVersion != lastUiSnapshotVersion)
257+
{
258+
lastUiSnapshotVersion = snapshotVersion;
259+
uiChanged = true;
260+
}
252261

253262
// Check if scale changed (lastScale starts at -1 so first tick always applies)
254263
float scale = processor.apvts.getRawParameterValue (ParamIds::uiScale)->load();
@@ -258,9 +267,21 @@ void IntersectEditor::timerCallback()
258267
setTransform (juce::AffineTransform::scale (scale));
259268
IntersectLookAndFeel::setMenuScale (scale);
260269
saveUserSettings (scale, getTheme().name);
270+
uiChanged = true;
261271
}
262272

263-
repaint();
273+
// Waveform cursor/playhead animation updates continuously.
274+
waveformView.repaint();
275+
276+
// Other components only need repaint when snapshot/theme/scale changes.
277+
if (uiChanged)
278+
{
279+
headerBar.repaint();
280+
sliceLane.repaint();
281+
scrollZoomBar.repaint();
282+
sliceControlBar.repaint();
283+
actionPanel.repaint();
284+
}
264285
}
265286

266287
void IntersectEditor::ensureDefaultThemes()

src/PluginEditor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class IntersectEditor : public juce::AudioProcessorEditor,
3232
IntersectProcessor& processor;
3333
float lastScale = -1.0f; // sentinel so first timer tick always applies
3434
float savedScale = -1.0f;
35+
uint32_t lastUiSnapshotVersion = 0;
3536

3637
IntersectLookAndFeel lnf;
3738
HeaderBar headerBar;

0 commit comments

Comments
 (0)