mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-04-30 06:20:13 +02:00
wip: EdnKeymap loads
This commit is contained in:
parent
364d617d37
commit
f485a068a8
0
midi/edn/midi-view.edn
Normal file
0
midi/edn/midi-view.edn
Normal file
0
midi/edn/piano-view-h.edn
Normal file
0
midi/edn/piano-view-h.edn
Normal file
0
midi/edn/piano-view-v.edn
Normal file
0
midi/edn/piano-view-v.edn
Normal file
|
@ -14,8 +14,9 @@ pub trait HasEditor {
|
|||
}
|
||||
/// Contains state for viewing and editing a clip
|
||||
pub struct MidiEditor {
|
||||
pub mode: PianoHorizontal,
|
||||
pub size: Measure<TuiOut>
|
||||
pub mode: PianoHorizontal,
|
||||
pub size: Measure<TuiOut>,
|
||||
pub keymap: EdnKeymap,
|
||||
}
|
||||
from!(|clip: &Arc<RwLock<MidiClip>>|MidiEditor = {
|
||||
let model = Self::from(Some(clip.clone()));
|
||||
|
@ -30,9 +31,14 @@ from!(|clip: Option<Arc<RwLock<MidiClip>>>|MidiEditor = {
|
|||
});
|
||||
impl Default for MidiEditor {
|
||||
fn default () -> Self {
|
||||
let mode = PianoHorizontal::new(None);
|
||||
mode.redraw();
|
||||
Self { mode, size: Measure::new() }
|
||||
Self {
|
||||
mode: PianoHorizontal::new(None),
|
||||
size: Measure::new(),
|
||||
keymap: EdnKeymap(
|
||||
EdnItem::<String>::read_all(include_str!("../edn/midi-keys.edn"))
|
||||
.expect("failed to load keymap for MidiEditor")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
has_size!(<TuiOut>|self: MidiEditor|&self.size);
|
||||
|
|
0
plugin/edn/plugin-keys.edn
Normal file
0
plugin/edn/plugin-keys.edn
Normal file
0
plugin/edn/plugin-view.edn
Normal file
0
plugin/edn/plugin-view.edn
Normal file
|
@ -33,7 +33,7 @@ impl App {
|
|||
midi_tos: &[PortConnection],
|
||||
) -> Self {
|
||||
Self {
|
||||
edn: include_str!("../edn/sequencer.edn").to_string(),
|
||||
edn: include_str!("../edn/sequencer-view.edn").to_string(),
|
||||
jack: jack.clone(),
|
||||
pool: Some(pool),
|
||||
editor: Some(editor),
|
||||
|
@ -56,7 +56,7 @@ impl App {
|
|||
audio_tos: &[&[PortConnection]],
|
||||
) -> Self {
|
||||
Self {
|
||||
edn: include_str!("../edn/groovebox.edn").to_string(),
|
||||
edn: include_str!("../edn/groovebox-view.edn").to_string(),
|
||||
sampler: Some(sampler),
|
||||
..Self::sequencer(
|
||||
jack, pool, editor,
|
||||
|
@ -78,7 +78,7 @@ impl App {
|
|||
track_width: usize,
|
||||
) -> Self {
|
||||
let mut arranger = Self {
|
||||
edn: include_str!("../edn/arranger.edn").to_string(),
|
||||
edn: include_str!("../edn/arranger-view.edn").to_string(),
|
||||
..Self::groovebox(
|
||||
jack, pool, editor,
|
||||
None, midi_froms, midi_tos,
|
||||
|
|
Loading…
Reference in a new issue