Safe Haskell | Safe-Inferred |
---|
Utilities for editing events.
Synopsis
- data Pos = Pos !BlockId !Types.TrackNum !TrackTime !TrackTime
- get_pos :: Cmd.M m => m Pos
- type Modify = Maybe Text -> (Maybe Text, Bool)
- modify_event_at :: Cmd.M m => Pos -> Bool -> Bool -> Modify -> m ()
- modify_event_at_trigger :: Cmd.M m => Pos -> Bool -> Bool -> Modify -> m ()
- soft_insert :: Cmd.M m => Text -> m ()
- lookup_instrument :: Cmd.M m => m (Maybe ScoreT.Instrument)
- data Key
- method_key :: Msg.Msg -> Maybe Key
- num_key :: Msg.Msg -> Maybe Key
- is_num_key :: Key -> Bool
- hex_key :: Msg.Msg -> Maybe Key
- data Fallthrough
- fallthrough :: Cmd.M m => Fallthrough -> Msg.Msg -> m ()
- input_to_note :: Cmd.M m => Pitch.Input -> m Pitch.Note
- inputs_to_notes :: Cmd.M m => [(key, Pitch.Input)] -> m [(key, Pitch.Note)]
- modify_text_key :: [Key.Modifier] -> Key -> Text -> Maybe Text
Documentation
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.
events
= 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_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.
lookup_instrument :: Cmd.M m => m (Maybe ScoreT.Instrument) Source #
msgs
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.