Skip to content

Commit

Permalink
Disable polyphony for cake
Browse files Browse the repository at this point in the history
  • Loading branch information
MyBlackMIDIScore committed Oct 18, 2024
1 parent b856d02 commit bebaf97
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/gui/window/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct GuiRenderScene {

pub struct RenderResultData {
pub notes_rendered: u64,
pub polyphony: u64,
pub polyphony: Option<u64>,
pub key_colors: Vec<Option<MIDIColor>>,
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/window/scene/cake_system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl CakeRenderer {

RenderResultData {
notes_rendered: rendered_notes,
polyphony: 0,
polyphony: None,
key_colors: colors,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/window/scene/note_list_system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl NoteRenderer {

RenderResultData {
notes_rendered: notes_pushed as u64,
polyphony: polyphony as u64,
polyphony: Some(polyphony as u64),
key_colors: columns_view_info
.iter()
.map(|column| column.color)
Expand Down
3 changes: 2 additions & 1 deletion src/gui/window/settings/midi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ impl SettingsWindow {
- Cake\n\
\0 The most efficient loading and displaying algorithm.\n\
\0 The notes will be stored in binary trees and will be\n\
\0 displayed dynamically.\n\
\0 displayed dynamically. This mode does not support\n\
\0 polyphony statistics.\n\
- Standard (RAM)\n\
\0 The MIDI will be loaded in the RAM and all the notes\n\
\0 will be rendered normally by the GPU.\n\
Expand Down
26 changes: 14 additions & 12 deletions src/gui/window/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct GuiMidiStats {
time_passed: f64,
time_total: f64,
notes_on_screen: u64,
polyphony: u64,
polyphony: Option<u64>,
voice_count: Option<u64>,
}

Expand All @@ -23,7 +23,7 @@ impl GuiMidiStats {
time_passed: 0.0,
time_total: 0.0,
notes_on_screen: 0,
polyphony: 0,
polyphony: None,
voice_count: None,
}
}
Expand All @@ -36,7 +36,7 @@ impl GuiMidiStats {
self.notes_on_screen = notes;
}

pub fn set_polyphony(&mut self, polyphony: u64) {
pub fn set_polyphony(&mut self, polyphony: Option<u64>) {
self.polyphony = polyphony;
}
}
Expand Down Expand Up @@ -184,15 +184,17 @@ impl GuiWasabiWindow {
});
}
Statistics::Polyphony => {
ui.horizontal(|ui| {
ui.monospace("Polyphony:");
ui.with_layout(
egui::Layout::right_to_left(egui::Align::Center),
|ui| {
ui.monospace(format!("{}", stats.polyphony));
},
);
});
if let Some(poly) = stats.polyphony {
ui.horizontal(|ui| {
ui.monospace("Polyphony:");
ui.with_layout(
egui::Layout::right_to_left(egui::Align::Center),
|ui| {
ui.monospace(format!("{}", poly));
},
);
});
}
}
};
}
Expand Down

0 comments on commit bebaf97

Please sign in to comment.