mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
stub save/load/options
This commit is contained in:
parent
6f6078e25a
commit
57102d7e6b
7 changed files with 54 additions and 15 deletions
|
|
@ -57,6 +57,21 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
|
|||
fn focus_pool_length (&self) -> bool {
|
||||
matches!(self.pool.as_ref().map(|p|p.mode.as_ref()).flatten(), Some(PoolMode::Length(..)))
|
||||
}
|
||||
fn dialog_help (&self) -> Dialog {
|
||||
Dialog::Help
|
||||
}
|
||||
fn dialog_menu (&self) -> Dialog {
|
||||
Dialog::Menu
|
||||
}
|
||||
fn dialog_save (&self) -> Dialog {
|
||||
Dialog::Save
|
||||
}
|
||||
fn dialog_load (&self) -> Dialog {
|
||||
Dialog::Load
|
||||
}
|
||||
fn dialog_options (&self) -> Dialog {
|
||||
Dialog::Options
|
||||
}
|
||||
fn editor_pitch (&self) -> Option<u7> {
|
||||
Some((self.editor().map(|e|e.get_note_pos()).unwrap() as u8).into())
|
||||
}
|
||||
|
|
@ -203,15 +218,11 @@ handle!(TuiIn: |self: App, input|Ok(if let Some(command) = self.config.keys.comm
|
|||
}
|
||||
|
||||
#[tengri_proc::command(App)] impl AppCommand {
|
||||
fn toggle_help (app: &mut App) -> Perhaps<Self> {
|
||||
app.toggle_dialog(Some(Dialog::Help));
|
||||
fn toggle_dialog (app: &mut App, dialog: Dialog) -> Perhaps<Self> {
|
||||
app.toggle_dialog(Some(dialog));
|
||||
Ok(None)
|
||||
}
|
||||
fn toggle_menu (app: &mut App) -> Perhaps<Self> {
|
||||
app.toggle_dialog(Some(Dialog::Menu));
|
||||
Ok(None)
|
||||
}
|
||||
fn toggle_edit (app: &mut App, value: bool) -> Perhaps<Self> {
|
||||
fn toggle_editor (app: &mut App, value: bool) -> Perhaps<Self> {
|
||||
app.toggle_editor(Some(value));
|
||||
Ok(None)
|
||||
}
|
||||
|
|
@ -346,6 +357,10 @@ impl<'state> Context<'state, SamplerCommand> for App {
|
|||
}
|
||||
|
||||
#[tengri_proc::command(App)] impl DeviceCommand {
|
||||
fn cancel (app: &mut App) -> Perhaps<Self> {
|
||||
app.dialog = None;
|
||||
Ok(None)
|
||||
}
|
||||
fn picker (app: &mut App) -> Perhaps<Self> {
|
||||
app.device_picker_show();
|
||||
Ok(None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue