(&mut self, stream_info: &StreamInfo, _context: &mut ProcStreamCtx)
| 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 | |
| 1406 | struct LoadedSampleState { |
| 1407 | sample: SamplerNodeResource, |
nothing calls this directly
no test coverage detected