sync midi by frames rather than useconds

This commit is contained in:
🪞👃🪞 2024-07-05 20:44:31 +03:00
parent 63b5eb3740
commit b1e4ec3a88
4 changed files with 29 additions and 17 deletions

View file

@ -32,7 +32,7 @@ pub struct App {
/// Current position according to transport
pub playhead: usize,
/// Position of T0 for this playback within global timeline
pub play_started: Option<usize>,
pub play_started: Option<(usize, usize)>,
/// Current sample rate and tempo.
pub timebase: Arc<Timebase>,
/// Display mode of grid section
@ -86,7 +86,10 @@ process!(App |self, _client, scope| {
if self.playing != Some(transport.state) {
match transport.state {
TransportState::Rolling => {
self.play_started = Some(current_usecs as usize);
self.play_started = Some((
current_frames as usize,
current_usecs as usize,
));
},
TransportState::Stopped => {
self.play_started = None;