fn redraw(
        &mut self,
        exposed_image: cairo::ImageSurface,
        secondary_image: cairo::ImageSurface,
        audio_buffer: &AudioBuffer,
        lower: usize,
        upper: usize,
    ) {
        let cr = cairo::Context::new(&exposed_image);
        self.exposed_image = Some(exposed_image);
        self.secondary_image = Some(secondary_image);

        cr.set_source_rgb(BACKGROUND_COLOR.0, BACKGROUND_COLOR.1, BACKGROUND_COLOR.2);
        cr.paint();

        self.set_scale(&cr);

        match self.draw_samples(&cr, audio_buffer, lower, upper, 0f64) {
            Some((first, last)) => {
                self.draw_amplitude_0(&cr, 0f64, last.x);

                self.first = Some(first);
                self.last = Some(last);

                self.lower = lower;
                self.upper = upper;
                self.force_redraw = false;
            }
            None => {
                self.force_redraw = true;
                warn!("{}_redraw: iter out of range {}, {}", self.id, lower, upper);
            }
        };

        debug!(
            "{}_redraw smpl_stp {}, lower {}, upper {}",
            self.id, self.sample_step, self.lower, self.upper
        );
    }
// Redraw the whole sample range on a clean image
Redraw the whole sample range on a clean image
Redraw the whole sample range on a clean image
fn redraw(
        &mut self,
        exposed_image: cairo::ImageSurface,
        secondary_image: cairo::ImageSurface,
        audio_buffer: &AudioBuffer,
        lower: usize,
        upper: usize,
    ) {
        let cr = cairo::Context::new(&exposed_image);
        self.exposed_image = Some(exposed_image);
        self.secondary_image = Some(secondary_image);
        cr.set_source_rgb(BACKGROUND_COLOR.0, BACKGROUND_COLOR.1, BACKGROUND_COLOR.2);
        cr.paint();
        self.set_scale(&cr);
        match self.draw_samples(&cr, audio_buffer, lower, upper, 0f64) {
            Some((first, last)) => {
                self.draw_amplitude_0(&cr, 0f64, last.x);
                self.first = Some(first);
                self.last = Some(last);
                self.lower = lower;
                self.upper = upper;
                self.force_redraw = false;
            }
            None => {
                self.force_redraw = true;
                warn!("{}_redraw: iter out of range {}, {}", self.id, lower, upper);
            }
        };
        debug!(
            "{}_redraw smpl_stp {}, lower {}, upper {}",
            self.id, self.sample_step, self.lower, self.upper
        );
    }
fn redraw ( & mut self , exposed_image : cairo :: ImageSurface , secondary_image : cairo :: ImageSurface , audio_buffer : & AudioBuffer , lower : usize , upper : usize , ) { let cr = cairo :: Context :: new ( & exposed_image ) ; self . exposed_image = Some ( exposed_image ) ; self . secondary_image = Some ( secondary_image ) ; cr . set_source_rgb ( BACKGROUND_COLOR . 0 , BACKGROUND_COLOR . 1 , BACKGROUND_COLOR . 2 ) ; cr . paint ( ) ; self . set_scale ( & cr ) ; match self . draw_samples ( & cr , audio_buffer , lower , upper , 0f64 ) { Some ( ( first , last ) ) => { self . draw_amplitude_0 ( & cr , 0f64 , last . x ) ; self . first = Some ( first ) ; self . last = Some ( last ) ; self . lower = lower ; self . upper = upper ; self . force_redraw = false ; } None => { self . force_redraw = true ; warn ! ( " " self id lower upper ) ; } } ; debug ! ( " " self id self sample_step self lower self upper ) ; }
Redraw the whole sample range on a clean image
Redraw the whole sample range on a clean image
&mut self
exposed_image
cairo::ImageSurface
secondary_image
cairo::ImageSurface
audio_buffer
&AudioBuffer
lower
usize
upper
usize
&mut self
exposed_image
cairo::ImageSurface
secondary_image
cairo::ImageSurface
audio_buffer
&AudioBuffer
lower
usize
upper
usize