mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: sample selector
This commit is contained in:
parent
4603bbd0da
commit
f303a8d552
13 changed files with 278 additions and 125 deletions
14
src/model.rs
14
src/model.rs
|
|
@ -1,11 +1,14 @@
|
|||
//! Application state.
|
||||
|
||||
use crate::{core::*, devices::{arranger::*, sequencer::*, transport::*}};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
/// Global modal dialog
|
||||
pub static MODAL: Lazy<Arc<Mutex<Option<Box<dyn Exit>>>>> =
|
||||
Lazy::new(||Arc::new(Mutex::new(None)));
|
||||
|
||||
/// Root of application state.
|
||||
pub struct App {
|
||||
/// Optional modal dialog
|
||||
pub modal: Option<Box<dyn Exit>>,
|
||||
/// Whether the currently focused section has input priority
|
||||
pub entered: bool,
|
||||
/// Currently focused section
|
||||
|
|
@ -38,11 +41,10 @@ impl App {
|
|||
let xdg = Arc::new(microxdg::XdgApp::new("tek")?);
|
||||
let first_run = crate::config::AppPaths::new(&xdg)?.should_create();
|
||||
let jack = JackClient::Inactive(Client::new("tek", ClientOptions::NO_START_SERVER)?.0);
|
||||
*MODAL.lock().unwrap() = first_run.then(||{
|
||||
Exit::boxed(crate::devices::setup::SetupModal(Some(xdg.clone()), false))
|
||||
});
|
||||
Ok(Self {
|
||||
modal: first_run.then(||{
|
||||
Exit::boxed(crate::devices::setup::SetupModal(Some(xdg.clone()), false))
|
||||
}),
|
||||
|
||||
entered: true,
|
||||
section: AppFocus::default(),
|
||||
transport: TransportToolbar::new(Some(jack.transport())),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue