Skip to content

Commit

Permalink
Fix typo in measure
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Jan 14, 2024
1 parent 569d5d0 commit 9d49e6c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions midi-file/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct MidiFile {
pub tracks: Arc<[MidiTrack]>,
pub program_track: ProgramTrack,
pub tempo_track: TempoTrack,
pub mesures: Arc<[std::time::Duration]>,
pub measures: Arc<[std::time::Duration]>,
}

impl MidiFile {
Expand Down Expand Up @@ -60,7 +60,7 @@ impl MidiFile {
})
.collect();

let mesures = {
let measures = {
let last_note_end = tracks
.iter()
.fold(std::time::Duration::ZERO, |last, track| {
Expand All @@ -71,16 +71,16 @@ impl MidiFile {
}
});

let mut mesures = Vec::new();
let mut masures = Vec::new();
let mut time = std::time::Duration::ZERO;
let mut id = 0;
while time <= last_note_end {
time = tempo_track.pulses_to_duration(id * u_per_quarter_note as u64 * 4);
mesures.push(time);
masures.push(time);
id += 1;
}

mesures
masures
};

let program_track = ProgramTrack::new(&tracks);
Expand All @@ -91,7 +91,7 @@ impl MidiFile {
tracks: tracks.into(),
program_track,
tempo_track,
mesures: mesures.into(),
measures: measures.into(),
})
}
}
2 changes: 1 addition & 1 deletion neothesia-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Recorder {
*keyboard.pos(),
config.vertical_guidelines,
config.horizontal_guidelines,
midi.mesures.clone(),
midi.measures.clone(),
);

let mut waterfall = WaterfallRenderer::new(
Expand Down
12 changes: 6 additions & 6 deletions neothesia-core/src/render/guidelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct GuidelineRenderer {
horizontal_guidelines: bool,

cache: Vec<QuadInstance>,
mesures: Arc<[Duration]>,
measures: Arc<[Duration]>,
}

impl GuidelineRenderer {
Expand All @@ -22,15 +22,15 @@ impl GuidelineRenderer {
pos: Point<f32>,
vertical_guidelines: bool,
horizontal_guidelines: bool,
mesures: Arc<[Duration]>,
measures: Arc<[Duration]>,
) -> Self {
Self {
pos,
layout,
vertical_guidelines,
horizontal_guidelines,
cache: Vec::new(),
mesures,
measures,
}
}

Expand Down Expand Up @@ -83,13 +83,13 @@ impl GuidelineRenderer {
animation_speed: f32,
time: f32,
) {
for mesure in self
.mesures
for masure in self
.measures
.iter()
.skip_while(|bar| bar.as_secs_f32() < time)
{
let x = 0.0;
let y = self.pos.y - (mesure.as_secs_f32() - time) * animation_speed;
let y = self.pos.y - (masure.as_secs_f32() - time) * animation_speed;

let w = f32::MAX;
let h = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion neothesia/src/scene/menu_scene/iced_menu/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fn guidelines_group<'a>(_data: &'a Data, target: &Target) -> Element<'a, Setting
.push(
preferences_group::ActionRow::new()
.title("Horizontal Guidelines")
.subtitle("Display mesure/bar indicators")
.subtitle("Display measure/bar indicators")
.suffix(horizontal),
)
.build()
Expand Down
2 changes: 1 addition & 1 deletion neothesia/src/scene/playing_scene/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl PlayingScene {
*keyboard.pos(),
target.config.vertical_guidelines,
target.config.horizontal_guidelines,
song.file.mesures.clone(),
song.file.measures.clone(),
);

let hidden_tracks: Vec<usize> = song
Expand Down

0 comments on commit 9d49e6c

Please sign in to comment.