// This is the entry point for the waveform update.
// This function tries to merge the samples added to the AudioBuffer
// since last extraction and adapts to the evolving conditions of
// the playback position and target rendering dimensions and
// resolution.
This is the entry point for the waveform update.
This function tries to merge the samples added to the AudioBuffer
since last extraction and adapts to the evolving conditions of
the playback position and target rendering dimensions and
resolution.
This is the entry point for the waveform update . This function tries to merge the samples added to the AudioBuffer since last extraction and adapts to the evolving conditions of the playback position and target rendering dimensions and resolution .
fn extract_samples(&mut self, audio_buffer: &AudioBuffer) {
        if self.req_sample_window == 0 {
            // conditions not defined yet
            return;
        }
        // Get the available sample range considering both
        // the waveform image and the AudioBuffer
        let (lower, upper) = self.get_sample_range(audio_buffer);
        self.image.render(audio_buffer, lower, upper);
        self.playback_needs_refresh = if audio_buffer.eos && !self.image.contains_eos {
            // there won't be any refresh on behalf of audio_buffer
            // and image will still need more sample if playback continues
            debug!(
                "{}_extract_samples setting playback_needs_refresh",
                self.image.id
            );
            true
        } else {
            if self.playback_needs_refresh {
                debug!(
                    "{}_extract_samples resetting playback_needs_refresh",
                    self.image.id
                );
            }
            false
        };
    }
fn extract_samples ( & mut self , audio_buffer : & AudioBuffer ) { if self . req_sample_window == 0 { // conditions not defined yet return ; } // Get the available sample range considering both // the waveform image and the AudioBuffer let ( lower , upper ) = self . get_sample_range ( audio_buffer ) ; self . image . render ( audio_buffer , lower , upper ) ; self . playback_needs_refresh = if audio_buffer . eos && ! self . image . contains_eos { // there won't be any refresh on behalf of audio_buffer // and image will still need more sample if playback continues debug ! ( " " self image id ) ; true } else { if self . playback_needs_refresh { debug ! ( " " self image id ) ; } false } ; }
This is the entry point for the waveform update.
This is the entry point for the waveform update .
&mut self
audio_buffer
&AudioBuffer