Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Cmd.Internal

Description

Internal Cmds, that keep bits of Cmd.State up to date that everyone else relies on.

Synopsis

# record keys

Record keydowns into the State modifier map.

Get the set of Key.Modifiers from the msg.

Convert a Msg to (is_key_down, Modifier).

# focus

Keep Cmd.state_focused_view up to date.

Catch UiMsg.UiUpdates from the UI, and modify the state accordingly to reflect the UI state.

Unlike all the other Cmds, the state changes this makes are not synced. UiUpdates report changes that have already occurred directly on the UI, so syncing them would be redundant.

This is the other half of cmd_record_ui_updates, whose output is synced like normal Cmds. When its a block update I have to update the other views.

# set style

Set the style of an event based on its contents. This is hardcoded for now but it's easy to put in StaticConfig if needed.

Set the track background color.

# sync

This is called after every non-failing cmd.

Flip Cmd.state_saved if the score has changed. Cmd.Save will turn it back on after a save.

Arguments

 :: Cmd.State -> Maybe.Maybe (GitTypes.Repo, GitTypes.Commit) I need both a repo and a previous commit to checkpoint.

Return Just if there will be a git checkpoint. update_saved has to predict this because by the time save_history runs, it's too late to make Ui.State changes.

This is not defined in Cmd.Undo to avoid a circular import.

## sync

sync_edit_box :: Cmd.M m => SaveStatus -> Cmd.EditState -> m () Source #

The two upper boxes reflect the edit state. The lower box is red for Cmd.ValEdit or dark red for Cmd.MethodEdit. The upper box is green for Cmd.state_advance mode, and red otherwise.

The lower box has a K if Cmd.state_kbd_entry mode is enabled, and the upper box has an o if Cmd.state_chord mode is enabled. The upper box also has a / if the score state hasn't been saved to disk, or x if it can't save to disk because there is no save file.

Constructors

 CantSave Unsaved Saved

Instances

 # Methods # MethodsshowList :: [SaveStatus] -> ShowS #

# selection

show_range :: (Eq a, Num a) => (a -> Text) -> a -> a -> Text Source #

If it looks like a low fraction, display it thus, rather than as a decimal. This is useful because e.g. meters in three will have lots of repeating decimals. I also use fractions for power of two denominators which are just fine in decimal, but the fraction still takes up less space.

## selection control value

This uses Msg.perf_track_signals rather than Msg.perf_track_dynamic because track dynamics have the callers controls on a control track