Skip to content

Commit

Permalink
Stay paused if seeking while paused
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaydax committed Apr 30, 2024
1 parent 3d8fa9c commit a3f4c5d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/midi/shared/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ impl TimeKeeper {
}

pub fn seek(&mut self, time: Duration) {
self.current_state = TimerState::Running {
continue_time: Instant::now(),
time_offset: time,
};
if self.current_state.is_paused() {
self.current_state = TimerState::Paused { time_offset: time };
} else {
self.current_state = TimerState::Running {
continue_time: Instant::now(),
time_offset: time,
};
}
self.notify_listeners(true);
}
}
Expand Down

0 comments on commit a3f4c5d

Please sign in to comment.