Skip to content

Commit

Permalink
more clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Nov 14, 2024
1 parent d5d708d commit 7a1b230
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 64 deletions.
6 changes: 3 additions & 3 deletions src/delay_tap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use nih_plug::prelude::*;
pub struct DelayTap {
/// The identifier for this delay tap. Polyphonic modulation events are linked to a delay tap based on
/// these IDs. If the host doesn't provide these IDs, then this is computed through
/// `compute_fallback_delay_tap_id()`. In that case polyphonic modulation will not work, but the
/// `compute_fallback_id()`. In that case polyphonic modulation will not work, but the
/// basic note events will still have an effect.
pub delay_tap_id: i32,
pub id: i32,
/// The note's channel, in `0..16`. Only used for the delay tap terminated event.
pub channel: u8,
/// The note's key/note, in `0..128`. Only used for the delay tap terminated event.
pub note: u8,
/// The delay taps internal ID. Each delay tap has an internal delay tap ID one higher than the previous
/// delay tap. This is used to steal the last delay tap in case all 16 delay taps are in use.
pub internal_delay_tap_id: u64,
pub internal_id: u64,
/// The note's velocity. This is used to interpollate it's dsp parameters.
pub velocity: f32,
/// Whether the key has been released and the delay tap is in its release stage. The delay tap will be
Expand Down
22 changes: 8 additions & 14 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,19 +389,19 @@ impl View for DelayGraph {

// Compute the time scaling factor
let time_scaling_factor =
self.compute_time_scaling_factor(delay_data, bounds.w, border_width, outline_width);
Self::compute_time_scaling_factor(delay_data, bounds.w, border_width, outline_width);

// Draw components
self.draw_background(canvas, bounds, background_color);
self.draw_delay_times_as_lines(
Self::draw_background(canvas, bounds, background_color);
Self::draw_delay_times_as_lines(
canvas,
delay_data,
bounds,
border_color,
border_width,
time_scaling_factor,
);
self.draw_time_line(
Self::draw_time_line(
canvas,
delay_data,
bounds,
Expand All @@ -410,7 +410,7 @@ impl View for DelayGraph {
time_scaling_factor,
border_width,
);
self.draw_tap_velocities(
Self::draw_tap_velocities(
canvas,
delay_data,
bounds,
Expand All @@ -419,7 +419,7 @@ impl View for DelayGraph {
time_scaling_factor,
border_width,
);
self.draw_tap_notes_and_pans(
Self::draw_tap_notes_and_pans(
canvas,
delay_data,
bounds,
Expand All @@ -431,7 +431,7 @@ impl View for DelayGraph {
background_color,
true,
);
self.draw_bounding_outline(canvas, bounds, border_color, border_width);
Self::draw_bounding_outline(canvas, bounds, border_color, border_width);
}
}

Expand Down Expand Up @@ -461,7 +461,6 @@ impl DelayGraph {
}

fn compute_time_scaling_factor(
&self,
delay_data: &SharedDelayData,
rect_width: f32,
border_width: f32,
Expand All @@ -478,7 +477,6 @@ impl DelayGraph {
}

fn draw_delay_times_as_lines(
&self,
canvas: &mut Canvas,
delay_data: &SharedDelayData,
bounds: BoundingBox,
Expand All @@ -504,7 +502,7 @@ impl DelayGraph {
canvas.stroke_path(&path, &vg::Paint::color(border_color).with_line_width(0.7));
}

fn draw_background(&self, canvas: &mut Canvas, bounds: BoundingBox, color: vg::Color) {
fn draw_background(canvas: &mut Canvas, bounds: BoundingBox, color: vg::Color) {
let mut path = vg::Path::new();
// Use the original bounds directly
path.rect(bounds.x, bounds.y, bounds.w, bounds.h);
Expand All @@ -515,7 +513,6 @@ impl DelayGraph {
}

fn draw_time_line(
&self,
canvas: &mut Canvas,
delay_data: &SharedDelayData,
bounds: BoundingBox,
Expand Down Expand Up @@ -545,7 +542,6 @@ impl DelayGraph {
}

fn draw_tap_velocities(
&self,
canvas: &mut Canvas,
delay_data: &SharedDelayData,
bounds: BoundingBox,
Expand Down Expand Up @@ -574,7 +570,6 @@ impl DelayGraph {
}

fn draw_tap_notes_and_pans(
&self,
canvas: &mut Canvas,
delay_data: &SharedDelayData,
bounds: BoundingBox,
Expand Down Expand Up @@ -701,7 +696,6 @@ impl DelayGraph {
}

fn draw_bounding_outline(
&self,
canvas: &mut Canvas,
bounds: BoundingBox,
color: vg::Color,
Expand Down
Loading

0 comments on commit 7a1b230

Please sign in to comment.