mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-15 16:06:41 +01:00
implement App::new
This commit is contained in:
parent
07084656b8
commit
afa2a2fd2b
2 changed files with 19 additions and 16 deletions
17
src/main.rs
17
src/main.rs
|
|
@ -22,25 +22,10 @@ use crate::{core::*, model::*};
|
|||
|
||||
/// Application entrypoint.
|
||||
pub fn main () -> Usually<()> {
|
||||
// Construct app
|
||||
let mut app = App::default();
|
||||
// Load config
|
||||
let xdg = Arc::new(microxdg::XdgApp::new("tek")?);
|
||||
app.xdg = Some(xdg.clone());
|
||||
if crate::config::AppPaths::new(&xdg)?.should_create() {
|
||||
app.modal = Some(Box::new(crate::config::SetupModal(Some(xdg.clone()))));
|
||||
}
|
||||
let midi_from = ["nanoKEY Studio.*capture.*"];
|
||||
let audio_into = ["Komplete.+:playback_FL", "Komplete.+:playback_FR"];
|
||||
// Init view
|
||||
app.track_cursor = 1;
|
||||
app.scene_cursor = 1;
|
||||
app.note_start = 2;
|
||||
app.time_zoom = 12;
|
||||
app.quant = 24;
|
||||
|
||||
// Start main loop
|
||||
app.run(Some(|app: Arc<RwLock<App>>|{
|
||||
App::new()?.run(Some(|app: Arc<RwLock<App>>|{
|
||||
let mut state = app.write().unwrap();
|
||||
// Start JACK and setup device graph
|
||||
let jack = jack_run("tek", &app)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue