app: unmute the review player and add a volume control
rune starts a video muted and the review never told it otherwise, so every recording played silent however loud its audio track was. The player now unmutes at eight tenths, and the transport bar has Mute/Unmute and a slider beside the clock. The level carries from one recording to the next, since a viewer sets it once.
This commit is contained in:
1 parent
543b489b11
commit
1e7e9dfc41
2 files changed
+91
-2
No files matched your search
+13
-1
@@ -203,9 +203,21 @@ pub fn slider(
|
||||
label: &'static str,
|
||||
value: u32,
|
||||
on_change: impl Fn(&mut App, u32) + Send + Sync + 'static,
|
||||
) -> El {
|
||||
slider_width(p, key, label, 180.0, value, on_change)
|
||||
}
|
||||
|
||||
/// [`slider`] at a given width, for the player bar where 180 points is too much.
|
||||
pub fn slider_width(
|
||||
p: Paint,
|
||||
key: impl Into<String>,
|
||||
label: &'static str,
|
||||
width: f32,
|
||||
value: u32,
|
||||
on_change: impl Fn(&mut App, u32) + Send + Sync + 'static,
|
||||
) -> El {
|
||||
let key = key.into();
|
||||
let (w, h, k, bar) = (180.0, 22.0, 18.0, 4.0);
|
||||
let (w, h, k, bar) = (width, 22.0, 18.0, 4.0);
|
||||
let travel = w - k;
|
||||
let v = (value.min(100) as f32 / 100.0).clamp(0.0, 1.0);
|
||||
let to_value = move |x: f32| (((x - k / 2.0) / travel).clamp(0.0, 1.0) * 100.0).round() as u32;
|
||||
|
||||
Reference in new issue
Block a user