Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.EditUtil

Description

Utilities for editing events.

Synopsis

Documentation

data Pos Source #

block tracknum start duration

The duration from the selection, so if it's zero, then an event duration will be inferred by get_duration based on the Cmd.state_note_duration. This is like Selection.Context, except focused on a single track.

Instances

Instances details
Show Pos Source # 
Instance details

Defined in Cmd.EditUtil

Methods

showsPrec :: Int -> Pos -> ShowS #

show :: Pos -> String #

showList :: [Pos] -> ShowS #

Eq Pos Source # 
Instance details

Defined in Cmd.EditUtil

Methods

(==) :: Pos -> Pos -> Bool #

(/=) :: Pos -> Pos -> Bool #

Pretty Pos Source # 
Instance details

Defined in Cmd.EditUtil

events

type Modify Source #

Arguments

 = Maybe Text

Existing text, Nothing if the event will be created.

-> (Maybe Text, Bool)

Nothing deletes the event, True to advance cursor

Modify event text.

modify_event_at Source #

Arguments

:: Cmd.M m 
=> Pos 
-> Bool

If the selection is 0, then True means create a 0 dur event, otherwise use the time step. If the selection is nonzero, always use its duration.

-> Bool

If True, modify the duration of an existing event.

-> Modify 
-> m () 

modify_event_at_trigger :: Cmd.M m => Pos -> Bool -> Bool -> Modify -> m () Source #

Like modify_event_at, but take triggered_inst into account.

soft_insert :: Cmd.M m => Text -> m () Source #

Insert an event, but only if there isn't already a non-empty one there.

msgs

data Key Source #

Constructors

Backspace 
Key Char.Char 

Instances

Instances details
Show Key Source # 
Instance details

Defined in Cmd.EditUtil

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Eq Key Source # 
Instance details

Defined in Cmd.EditUtil

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

method_key :: Msg.Msg -> Maybe Key Source #

Extract a key for method input. [a-z0-9._-]

num_key :: Msg.Msg -> Maybe Key Source #

Extract a key for control value input. [0-9._-]

is_num_key :: Key -> Bool Source #

Is the key appropriate for editing decimal numbers?

hex_key :: Msg.Msg -> Maybe Key Source #

Is the key appropriate for editing control track hex numbers? Also includes - for negation.

fallthrough :: Cmd.M m => Fallthrough -> Msg.Msg -> m () Source #

Let keys that have a modifier down fall through.

When edit mode is on, the edit cmds tend to catch all msgs. However, some msgs should go through anyway.

input_to_note :: Cmd.M m => Pitch.Input -> m Pitch.Note Source #

Convert an InputKey to the symbolic Note that it should be.

Due to enharmonics this can depend on the current key and even be ambiguous.

inputs_to_notes :: Cmd.M m => [(key, Pitch.Input)] -> m [(key, Pitch.Note)] Source #

Like input_to_note, but more efficient for multiple inputs.

modify

modify_text_key :: [Key.Modifier] -> Key -> Text -> Maybe Text Source #

Since there's no use for leading spaces, just a space makes an empty event. Backspacing the last character return Nothing, which deletes the event. If I want a "" event I can create one with space.