mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 03:36:41 +01:00
config: extract read_and_leak; almost done with layer-if
This commit is contained in:
parent
cd8d85bd97
commit
d427dc409d
3 changed files with 105 additions and 44 deletions
|
|
@ -100,7 +100,16 @@ impl Cli {
|
|||
for (index, connect) in midi_tos.iter().enumerate() {
|
||||
let port = JackMidiOut::new(jack, &format!("{index}/M"), &[connect.clone()])?;
|
||||
midi_outs.push(port);
|
||||
}
|
||||
};
|
||||
let config_path = match mode {
|
||||
LaunchMode::Clock => "config/config_transport.edn",
|
||||
LaunchMode::Sequencer => "config/config_sequencer.edn",
|
||||
LaunchMode::Groovebox => "config/config_groovebox.edn",
|
||||
LaunchMode::Arranger { .. } => "config/config_arranger.edn",
|
||||
LaunchMode::Sampler => "config/config_sampler.edn",
|
||||
_ => todo!("{mode:?}"),
|
||||
};
|
||||
let config = Configuration::new(&config_path, false)?;
|
||||
let mut app = Tek {
|
||||
jack: jack.clone(),
|
||||
color: ItemTheme::random(),
|
||||
|
|
@ -139,14 +148,7 @@ impl Cli {
|
|||
},
|
||||
scenes,
|
||||
selected: Selection::TrackClip { track: 0, scene: 0 },
|
||||
config: Configuration::from_file(match mode {
|
||||
LaunchMode::Clock => &"config/config_transport.edn",
|
||||
LaunchMode::Sequencer => &"config/config_sequencer.edn",
|
||||
LaunchMode::Groovebox => &"config/config_groovebox.edn",
|
||||
LaunchMode::Arranger { .. } => &"config/config_arranger.edn",
|
||||
LaunchMode::Sampler => &"config/config_sampler.edn",
|
||||
_ => todo!("{mode:?}"),
|
||||
}, false)?,
|
||||
config,
|
||||
..Default::default()
|
||||
};
|
||||
if let &LaunchMode::Arranger { scenes, tracks, track_width, .. } = mode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue