this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ‘ฉโ€๐Ÿ’ปโ€ Give entire context to engine controller

+5 -6
+5 -6
src/video/engine.rs
··· 10 10 pub fn render( 11 11 &self, 12 12 output: SyncSender<(Duration, String)>, 13 - controller: impl Fn(usize) -> EngineControl, 13 + controller: impl Fn(&Context<AdditionalContext>) -> EngineControl, 14 14 ) -> Result<usize> { 15 15 debug_time!("render"); 16 16 ··· 46 46 context.beat = context.beat_fractional as usize; 47 47 context.frame = self.fps * context.ms / 1000; 48 48 49 - let control = controller(context.frame); 49 + let control = controller(&context); 50 50 51 51 if control.stop_rendering_beforehand() { 52 52 println!( ··· 152 152 ) -> Result<(Duration, String)> { 153 153 let (tx, rx) = std::sync::mpsc::sync_channel::<(Duration, String)>(2); 154 154 155 - self.render(tx, |n| { 156 - if n == frame_no { 157 - println!("Rendering frame #{n}"); 155 + self.render(tx, |ctx| { 156 + if ctx.frame == frame_no { 158 157 EngineControl::Finish 159 - } else if n < frame_no { 158 + } else if ctx.frame < frame_no { 160 159 EngineControl::Skip 161 160 } else { 162 161 EngineControl::Stop