mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
implement App::new
This commit is contained in:
parent
07084656b8
commit
afa2a2fd2b
2 changed files with 19 additions and 16 deletions
18
src/model.rs
18
src/model.rs
|
|
@ -72,6 +72,24 @@ pub struct App {
|
|||
/// Quantization factor
|
||||
pub quant: usize,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn new () -> Usually<Self> {
|
||||
let xdg = Arc::new(microxdg::XdgApp::new("tek")?);
|
||||
let first_run = crate::config::AppPaths::new(&xdg)?.should_create();
|
||||
Ok(Self {
|
||||
modal: first_run.then(||crate::config::SetupModal(Some(xdg.clone())).boxed()),
|
||||
xdg: Some(xdg),
|
||||
track_cursor: 1,
|
||||
scene_cursor: 1,
|
||||
note_start: 2,
|
||||
time_zoom: 12,
|
||||
quant: 24,
|
||||
..Self::default()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
process!(App |self, _client, scope| {
|
||||
let (
|
||||
reset, current_frames, current_usecs, next_usecs, period_usecs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue