aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/timer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ttyplay/timer.rs')
-rw-r--r--src/bin/ttyplay/timer.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/ttyplay/timer.rs b/src/bin/ttyplay/timer.rs
index 62bbff9..0cd66a6 100644
--- a/src/bin/ttyplay/timer.rs
+++ b/src/bin/ttyplay/timer.rs
@@ -123,6 +123,12 @@ pub fn spawn_task(
playback_ratio /= 2;
let now = std::time::Instant::now();
start_time = now - (now - start_time) / 2;
+ event_w
+ .send(crate::event::Event::Speed(
+ playback_ratio,
+ ))
+ .await
+ .unwrap();
}
}
crate::event::TimerAction::SlowDown => {
@@ -130,6 +136,12 @@ pub fn spawn_task(
playback_ratio *= 2;
let now = std::time::Instant::now();
start_time = now - (now - start_time) * 2;
+ event_w
+ .send(crate::event::Event::Speed(
+ playback_ratio,
+ ))
+ .await
+ .unwrap();
}
}
crate::event::TimerAction::DefaultSpeed => {
@@ -137,6 +149,10 @@ pub fn spawn_task(
start_time = now
- (((now - start_time) * 16) / playback_ratio);
playback_ratio = 16;
+ event_w
+ .send(crate::event::Event::Speed(playback_ratio))
+ .await
+ .unwrap();
}
crate::event::TimerAction::Search(s, backwards) => {
if let Some(new_idx) =