aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/timer.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-05 03:38:08 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-05 03:38:08 -0500
commitd1200faeea5dd513f6b02958f84669f6dde925fe (patch)
tree97be42181b1769075156f9024748bd20986fa89c /src/bin/ttyplay/timer.rs
parent8fae72f67707924118f965b9e14b5838e41cc3ad (diff)
downloadttyrec-bin-d1200faeea5dd513f6b02958f84669f6dde925fe.tar.gz
ttyrec-bin-d1200faeea5dd513f6b02958f84669f6dde925fe.zip
also allow setting the initial speed on the command line
Diffstat (limited to 'src/bin/ttyplay/timer.rs')
-rw-r--r--src/bin/ttyplay/timer.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/ttyplay/timer.rs b/src/bin/ttyplay/timer.rs
index db85001..f5cf2dc 100644
--- a/src/bin/ttyplay/timer.rs
+++ b/src/bin/ttyplay/timer.rs
@@ -7,6 +7,7 @@ pub fn spawn_task(
>,
timer_r: async_std::channel::Receiver<crate::event::TimerAction>,
pause_at_start: bool,
+ speed: u32,
) -> async_std::task::JoinHandle<()> {
async_std::task::spawn(async move {
let mut idx = 0;
@@ -17,7 +18,7 @@ pub fn spawn_task(
None
};
let mut force_update_time = false;
- let mut playback_ratio = 16;
+ let mut playback_ratio = 2_u32.pow(speed);
loop {
enum Res {
Wait(Option<vt100::Screen>),