Files
Syplheed-Reborn/crates/sylpheed-viewer/Cargo.toml
MechaCat02 91bd2543f4 feat(viewer): WMV cutscene player with scrub, keyboard + audio
Add an in-explorer video player for the dat/movie/*.wmv cutscenes.

Decode via the ffmpeg/ffprobe CLI (no libav linking): video streams from an
`ffmpeg -f rawvideo -pix_fmt rgba` pipe read into fixed w*h*4 frame chunks over
a bounded channel (paused/behind => ffmpeg back-pressures on its pipe); one
reused Image is overwritten in place each tick. Audio is best-effort: the track
is pre-decoded to a temp stereo WAV and played through a rodio Sink (volume /
play / pause / seek-via-skip_duration for free). Native-only under
cfg(not(wasm32)); VideoPreview registers unconditionally so the UI compiles for
wasm. Mirrors the .pak load pipeline (FileSelected -> bg thread ->
IsoLoaderMsg::VideoLoaded -> apply_loaded_video -> advance_video_playback), with
a single free_video teardown wired into every other viewer's reset.

Controls:
- play/pause button, click-on-frame toggle, Space / arrow (+-10s) shortcuts
- seekable timeline with mm:ss labels; volume slider (greyed when no audio)
- live scrubbing: a coalescing one-shot `ffmpeg -ss -frames:v 1` grabber always
  jumps to the knob's latest position, so dragging shows the frame under the
  knob in real time; that grabbed frame also bridges the gap after a commit-seek
  so there's no black flash while the streaming decoder catches up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 14:31:52 +02:00

55 lines
1.4 KiB
TOML

[package]
name = "sylpheed-viewer"
description = "Bevy-based asset viewer for Project Sylpheed: Arc of Deception"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
# Native binary entry point
[[bin]]
name = "sylpheed-viewer"
path = "src/main.rs"
# Library crate — also serves as the WASM entry point
[lib]
name = "sylpheed_viewer"
path = "src/lib.rs"
# cdylib is required for wasm-bindgen to produce a .wasm file
crate-type = ["cdylib", "rlib"]
[dependencies]
sylpheed-formats = { workspace = true }
bevy = { workspace = true, features = [
"bevy_asset",
"bevy_color",
"bevy_core_pipeline",
"bevy_pbr",
"bevy_render",
"bevy_window",
"bevy_winit",
"multi_threaded",
"png",
# Required for TonyMcMapFace tonemapping (default Camera3d tonemapper)
"tonemapping_luts",
# Linux display backends
"x11",
"wayland",
] }
bevy_egui = { workspace = true }
futures = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
[features]
# Enable Bevy dynamic linking for faster incremental recompiles in dev
dev = ["bevy/dynamic_linking"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tracing-subscriber = { workspace = true }
rfd = { workspace = true }
# Audio for the WMV video player (pulls cpal → alsa on Linux).
rodio = { workspace = true }