This commit is contained in:
2025-10-04 00:43:45 -05:00
parent 9eec30779a
commit 87d842c2ad
5 changed files with 151 additions and 68 deletions
+8 -6
View File
@@ -1,6 +1,7 @@
use std::time::{Duration, Instant};
use rodio::OutputStream;
use crate::grid::Grid;
use crate::dialog::Dialog;
use crate::noise::{Note, NoteType};
pub const LOOP_LENGTH: u32 = 16;
@@ -27,8 +28,12 @@ pub struct Tenori {
// The audio output stream to which we will play notes
output_stream: OutputStream,
// Error dialogs we're currently showing
dialogs: Vec<String>
/// Error dialogs we're currently showing
pub dialogs: Vec<Dialog>,
/// If present, we can save to this file without asking the
/// user to select a file first.
pub default_filename: Option<String>
}
impl Default for Tenori {
@@ -44,6 +49,7 @@ impl Default for Tenori {
grids: vec![],
window_counter: 0,
dialogs: vec![],
default_filename: None,
output_stream
}
}
@@ -73,10 +79,6 @@ impl Tenori {
self.beat() != old_beat
}
pub fn display_dialogs(&mut self) {
}
/// Which beat (0..loop_length) we're on
pub fn beat(&self) -> u32 {
self.timer.floor() as u32