add Exit trait to modals

This commit is contained in:
🪞👃🪞 2024-07-12 16:05:16 +03:00
parent 0cc8d88e5f
commit 33e5f47526
6 changed files with 67 additions and 33 deletions

View file

@ -1,27 +1,29 @@
use crate::core::*;
pub struct TransportToolbar {
pub mode: bool,
pub focused: bool,
pub entered: bool,
pub metronome: bool,
pub mode: bool,
pub focused: bool,
pub entered: bool,
/// Current sample rate, tempo, and PPQ.
pub timebase: Arc<Timebase>,
pub timebase: Arc<Timebase>,
/// JACK transport handle.
transport: Option<Transport>,
transport: Option<Transport>,
/// Quantization factor
pub quant: usize,
pub quant: usize,
/// Current transport state
pub playing: Option<TransportState>,
pub playing: Option<TransportState>,
/// Current position according to transport
playhead: usize,
playhead: usize,
/// Global frame and usec at which playback started
pub started: Option<(usize, usize)>,
pub started: Option<(usize, usize)>,
}
impl TransportToolbar {
pub fn new (transport: Option<Transport>) -> Self {
Self {
transport,
metronome: false,
mode: false,
focused: false,
entered: false,