MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / new_stream

Method new_stream

crates/firewheel-nodes/src/sampler.rs:1384–1404  ·  view source on GitHub ↗
(&mut self, stream_info: &StreamInfo, _context: &mut ProcStreamCtx)

Source from the content-addressed store, hash-verified

1382
1383 fn new_stream(&mut self, stream_info: &StreamInfo, _context: &mut ProcStreamCtx) {
1384 if stream_info.sample_rate != stream_info.prev_sample_rate {
1385 self.stop_declicker_buffers = if self.config.num_declickers == 0 {
1386 None
1387 } else {
1388 Some(InstanceBuffer::<f32>::new(
1389 self.config.num_declickers as usize,
1390 NonZeroUsize::new(self.config.channels.get().get() as usize).unwrap(),
1391 stream_info.declick_frames.get() as usize,
1392 ))
1393 };
1394
1395 // The sample rate has changed, meaning that the sample resources now have
1396 // the incorrect sample rate and the user must reload them.
1397 self.loaded_sample_state = None;
1398 self.playing = false;
1399 self.paused = false;
1400 self.proc_state.playback_state = PlaybackState::Stopped;
1401 self.sync_proc_state();
1402 }
1403 }
1404}
1405
1406struct LoadedSampleState {
1407 sample: SamplerNodeResource,

Callers

nothing calls this directly

Calls 2

sync_proc_stateMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected