Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Cmd.EditUtil

Contents

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.

Instances

Eq Pos # 

Methods

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

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

Show Pos # 

Methods

showsPrec :: Int -> Pos -> ShowS #

show :: Pos -> String #

showList :: [Pos] -> ShowS #

Pretty Pos # 

events

get_or_create_event :: Ui.M m => Bool -> TrackId -> TrackTime -> TrackTime -> m (Event.Event, Bool) Source #

Get the event under insertion point, creating an empty one if there is none.

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 :: Cmd.M m => Bool -> Bool -> Modify -> m () Source #

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. f the selection is nonzero, always use its duration.

-> Bool

If True, modify the duration of an existing event.

-> Modify 
-> m () 

remove_event :: Cmd.M m => Bool -> m () Source #

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

Special case of modify_event_at to only remove events.

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

Eq Key # 

Methods

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

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

Show Key # 

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

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.

raw_key :: Msg.Msg -> Maybe ([Key.Modifier], Key) Source #

Extract a key for raw input.

fallthrough :: Cmd.M m => 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.

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 an empty event returns Nothing, which should delete the event itself.

drop_expr :: Text -> Text Source #

Drop a parenthesized expression, or a symbol up to its matching backtick.