mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
tek_has
This commit is contained in:
parent
0a89fab28a
commit
9e3cc1139d
18 changed files with 450 additions and 414 deletions
27
src/tek.rs
27
src/tek.rs
|
|
@ -45,6 +45,7 @@ mod tek_bind; pub use self::tek_bind::*;
|
|||
mod tek_cli; pub use self::tek_cli::*;
|
||||
mod tek_conf; pub use self::tek_conf::*;
|
||||
mod tek_ctrl; pub use self::tek_ctrl::*;
|
||||
mod tek_has; pub use self::tek_has::*;
|
||||
mod tek_mode; pub use self::tek_mode::*;
|
||||
mod tek_pool; pub use self::tek_pool::*;
|
||||
mod tek_view; pub use self::tek_view::*;
|
||||
|
|
@ -461,14 +462,6 @@ impl ControlAxis {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait HasWidth {
|
||||
const MIN_WIDTH: usize;
|
||||
/// Increment track width.
|
||||
fn width_inc (&mut self);
|
||||
/// Decrement track width, down to a hardcoded minimum of [Self::MIN_WIDTH].
|
||||
fn width_dec (&mut self);
|
||||
}
|
||||
|
||||
/// Various possible dialog modes.
|
||||
///
|
||||
/// ```
|
||||
|
|
@ -538,7 +531,7 @@ impl Dialog {
|
|||
|
||||
MenuItem::new(" Create session ", [
|
||||
AppCmd::Dialog { dialog: Dialog::None },
|
||||
AppCmd::Mode { command: ModeCmd::Reset { modes: vec!["Arranger".into()] } },
|
||||
AppCmd::Mode { modes: vec!["Arranger".into()] },
|
||||
AppCmd::Tracks { command: TracksCmd::Add },
|
||||
AppCmd::Scenes { command: ScenesCmd::Add },
|
||||
AppCmd::MidiClip { command: MidiClipCmd::Upsert },
|
||||
|
|
@ -790,3 +783,19 @@ impl App {
|
|||
if let Dialog::Browse(_, ref b) = self.dialog { Some(b) } else { None }
|
||||
}
|
||||
}
|
||||
|
||||
impl HasTrackScroll for App {
|
||||
fn track_scroll (&self) -> usize {
|
||||
self.project.track_scroll()
|
||||
}
|
||||
fn tracks_last (&self) -> usize {
|
||||
self.project.track_last
|
||||
}
|
||||
fn tracks_last_mut (&mut self) -> &mut usize {
|
||||
&mut self.project.track_last
|
||||
}
|
||||
}
|
||||
|
||||
impl HasSceneScroll for App {
|
||||
fn scene_scroll (&self) -> usize { self.project.scene_scroll() }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue