mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: EdnKeymap loads
This commit is contained in:
parent
364d617d37
commit
f485a068a8
13 changed files with 14 additions and 8 deletions
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue