mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: cmdsys: define arranger commands
This commit is contained in:
parent
abbe0dc8f7
commit
1f375219db
3 changed files with 40 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ pub trait Command<T>: Sized {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait HandleKey<C: Command<Self> + 'static>: Sized {
|
pub trait HandleKey<C: Command<Self> + 'static>: Sized {
|
||||||
const HANDLE_KEY_MAP: &'static [(KeyEvent, C)];
|
const HANDLE_KEY_MAP: &'static [(KeyEvent, C)]; // FIXME: needs to be method
|
||||||
fn match_key (key: &KeyEvent) -> Option<&'static C> {
|
fn match_key (key: &KeyEvent) -> Option<&'static C> {
|
||||||
for (binding, command) in Self::HANDLE_KEY_MAP.iter() {
|
for (binding, command) in Self::HANDLE_KEY_MAP.iter() {
|
||||||
if key == binding {
|
if key == binding {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,42 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq)]
|
||||||
|
enum ArrangerCommand {
|
||||||
|
FocusNext,
|
||||||
|
FocusPrev,
|
||||||
|
FocusUp,
|
||||||
|
FocusDown,
|
||||||
|
FocusLeft,
|
||||||
|
FocusRight,
|
||||||
|
Transport(TransportCommand),
|
||||||
|
Phrase(PhrasePoolCommand),
|
||||||
|
Editor(PhraseEditorCommand),
|
||||||
|
Arrangement(ArrangementCommand),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq)]
|
||||||
|
enum ArrangementCommand {
|
||||||
|
ToggleViewMode,
|
||||||
|
Delete,
|
||||||
|
Activate,
|
||||||
|
Increment,
|
||||||
|
Decrement,
|
||||||
|
ZoomIn,
|
||||||
|
ZoomOut,
|
||||||
|
MoveBack,
|
||||||
|
MoveForward,
|
||||||
|
RandomColor,
|
||||||
|
Put,
|
||||||
|
Get,
|
||||||
|
AddScene,
|
||||||
|
AddTrack,
|
||||||
|
ToggleLoop,
|
||||||
|
GoUp,
|
||||||
|
GoDown,
|
||||||
|
GoLeft,
|
||||||
|
GoRight,
|
||||||
|
}
|
||||||
|
|
||||||
/// Handle top-level events in standalone arranger.
|
/// Handle top-level events in standalone arranger.
|
||||||
impl Handle<Tui> for Arranger<Tui> {
|
impl Handle<Tui> for Arranger<Tui> {
|
||||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ enum SequencerCommand {
|
||||||
Transport(TransportCommand),
|
Transport(TransportCommand),
|
||||||
Phrase(PhrasePoolCommand),
|
Phrase(PhrasePoolCommand),
|
||||||
Editor(PhraseEditorCommand),
|
Editor(PhraseEditorCommand),
|
||||||
// TODO: 1-8 seek markers that by default start every 8th of the phrase
|
|
||||||
}
|
}
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum PhrasePoolCommand {
|
pub enum PhrasePoolCommand {
|
||||||
|
|
@ -50,6 +49,7 @@ pub enum PhraseLengthCommand {
|
||||||
}
|
}
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum PhraseEditorCommand {
|
pub enum PhraseEditorCommand {
|
||||||
|
// TODO: 1-9 seek markers that by default start every 8th of the phrase
|
||||||
ToggleDirection,
|
ToggleDirection,
|
||||||
EnterEditMode,
|
EnterEditMode,
|
||||||
ExitEditMode,
|
ExitEditMode,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue