app: keep a paused clip's layer picture on the pixels it played on

The vendored rune's layer rounded its size and sat at it 1:1, while the
window draws a paused clip itself at the exact fractional rect: pausing
moved the picture by up to a pixel. The layer's visual now sits at that
rect and stretches its buffer onto it (SetTransform2), and the vendored
rune takes windows-numerics for the matrix.

Also snapshot hooks: LR_DEMO_PLAY starts the demo clip and
LR_DEMO_PAUSE_AT pauses it once the clock passes a time.
This commit is contained in:
vhaudiquet committed 2026-11-23 18:11:02 +01:00
1 parent 5cbf284841
commit f3e44a2132
8 files changed
+57 -13

No files matched your search

+16
View File
@@ -962,6 +962,17 @@ impl App {
// ---------------------------------------------------------------------------
pub fn poll(app: &mut App, t: f64, tx: &mut Tx) -> bool {
// Snapshot hook: pause the demo clip when its clock passes `LR_DEMO_PAUSE_AT` seconds.
if let Some(at) = std::env::var("LR_DEMO_PAUSE_AT")
.ok()
.and_then(|v| v.parse::<f64>().ok())
{
if let Some(player) = &app.review.player {
if player.is_playing() && player.time() >= at {
app.review.playback();
}
}
}
app.handle_poll(t, tx)
}
@@ -1337,6 +1348,11 @@ pub fn demo_review(app: &mut App) {
player.set_looping(false);
app.review.player = Some(player);
app.review.error = None;
if std::env::var("LR_DEMO_PLAY").is_ok()
&& let Some(player) = &app.review.player
{
player.play();
}
if let Ok(tracks) = std::env::var("LR_DEMO_TRACKS") {
if let Some(game) = app.review.game.as_mut() {
game.audio_tracks = tracks