Safe Haskell | Safe-Inferred |
---|
Event editing commands. This is where generic event editing commands go. More specialized ones, like copy and paste and control or note track commands, go in their own modules.
Synopsis
- cmd_toggle_val_edit :: Cmd.M m => m ()
- cmd_toggle_method_edit :: Cmd.M m => m ()
- cmd_toggle_kbd_entry :: Cmd.M m => m ()
- cmd_toggle_val_edit_kbd_entry :: Cmd.M m => m ()
- set_step_rank :: Cmd.M m => TimeStep.TimeStep -> Meter.Rank -> m ()
- set_step :: Cmd.M m => TimeStep.TimeStep -> m ()
- toggle_absolute_relative_step :: Cmd.M m => m ()
- cmd_toggle_note_orientation :: Cmd.M m => m ()
- cmd_modify_octave :: Cmd.M m => (Pitch.Octave -> Pitch.Octave) -> m ()
- toggle_advance :: Cmd.M m => m ()
- toggle_chord :: Cmd.M m => m ()
- cmd_move_event_forward :: Cmd.M m => m ()
- cmd_move_event_backward :: Cmd.M m => m ()
- cmd_set_duration :: Cmd.M m => m ()
- cmd_toggle_zero_timestep :: Cmd.M m => m ()
- cmd_set_start :: Cmd.M m => m ()
- modify_dur :: Cmd.M m => (ScoreTime.ScoreTime -> ScoreTime.ScoreTime) -> m ()
- cmd_join_events :: Cmd.M m => m ()
- cmd_split_events :: Cmd.M m => m ()
- cmd_insert_time :: Cmd.M m => m ()
- cmd_delete_time :: Cmd.M m => m ()
- delete_block_time :: Ui.M m => BlockId -> ScoreTime.TrackTime -> ScoreTime.TrackTime -> m ()
- cmd_clear_selected :: Cmd.M m => m ()
- clear_range :: Ui.M m => [TrackId] -> Events.Range -> m ()
- cmd_clear_and_advance :: Cmd.M m => m ()
- toggle_note_duration :: Cmd.M m => m ()
- cmd_set_call_duration :: Cmd.M m => m ()
- cmd_invert_orientation :: Cmd.M m => m ()
- cmd_toggle_commented :: Cmd.M m => m ()
- strip_transformer :: Cmd.M m => m ()
- save_last_action_to :: Cmd.M m => Char -> m ()
- run_action_at :: Cmd.M m => Char -> m ()
- handle_floating_input :: Cmd.M m => Bool -> Msg.Msg -> m Cmd.Status
- append_text :: Cmd.M m => m Cmd.Status
- prepend_text :: Cmd.M m => m Cmd.Status
- replace_last_call :: Cmd.M m => m Cmd.Status
- replace_first_call :: Cmd.M m => m Cmd.Status
global editing state
cmd_toggle_val_edit :: Cmd.M m => m () Source #
Unlike the other toggle commands, val edit, being the "default" toggle, always turns other modes off. So you can't switch directly from some other kind of edit to val edit.
cmd_toggle_method_edit :: Cmd.M m => m () Source #
cmd_toggle_kbd_entry :: Cmd.M m => m () Source #
Toggle kbd entry mode, putting a K in the edit box as a reminder. This is orthogonal to the previous edit modes.
cmd_toggle_val_edit_kbd_entry :: Cmd.M m => m () Source #
set_step_rank :: Cmd.M m => TimeStep.TimeStep -> Meter.Rank -> m () Source #
If the TimeStep is AbsoluteMark or RelativeMark, set its rank. Otherwise, set it to the deflt. This means the marklist names are sticky, so if you set it manually the default bindings won't mess it up.
set_step :: Cmd.M m => TimeStep.TimeStep -> m () Source #
toggle_absolute_relative_step :: Cmd.M m => m () Source #
Toggle between absolute and relative mark step.
cmd_toggle_note_orientation :: Cmd.M m => m () Source #
cmd_modify_octave :: Cmd.M m => (Pitch.Octave -> Pitch.Octave) -> m () Source #
toggle_advance :: Cmd.M m => m () Source #
toggle_chord :: Cmd.M m => m () Source #
event start and duration
cmd_move_event_forward :: Cmd.M m => m () Source #
Different from cmd_insert_time
and cmd_delete_time
since it only
moves some events. Move back the next event, or move forward the previous
event. Move the next or previous event for a point selection, or the
selected events.
cmd_move_event_backward :: Cmd.M m => m () Source #
cmd_set_duration :: Cmd.M m => m () Source #
Extend the events in the selection to either the end of the selection or the beginning of the next note, whichever is shorter.
If the selection is on an event, the previous or next one (depending on
Types.Orientation
) is extended instead. This is more useful than reducing
the event to 0, which has its own cmd anyway. If the selection is between
a positive and negative event, the one corresponding to Sel.orientation
is
selected.
cmd_toggle_zero_timestep :: Cmd.M m => m () Source #
Toggle duration between zero and non-zero.
If the event is non-zero, then make it zero. Otherwise, set its end to the cursor. Unless the cursor is on the event start, and then extend it by a timestep.
Also I previously used the same event selection strategy as
cmd_set_duration
, which avoided the awkward point selection on zero-dur
event case, but it turned out to be unintuitive to use in practice, because
to toggle an event I'd have to put the selection on the next event.
cmd_set_start :: Cmd.M m => m () Source #
Move only the beginning of an event. As is usual for zero duration events, their duration will not be changed so this is equivalent to a move.
Other cmds are biased towards the previous event, i.e. they affect the previous event if nothing is selected. This cmd is a little different: if it overlaps with an event, it will affect that one. Otherwise, it affects the next positive event or the previous negative event. The idea is that it's not very useful to clip an event to 0 by moving it past its end, so let's not do that. So it's like set_duration backwards: at does nothing, otherwise get next positive or prev negative.
Unlike cmd_set_duration
, I can't think of a way for this to make sense
with a non-point selection, so it uses the point position.
TODO for zero duration events, this is equivalent to
cmd_move_event_backward
. I'm not totally happy about the overlap, is
there a more orthogonal organization?
modify_dur :: Cmd.M m => (ScoreTime.ScoreTime -> ScoreTime.ScoreTime) -> m () Source #
Modify event durations by applying a function to them. 0 durations are passed through, so you can't accidentally give control events duration.
cmd_join_events :: Cmd.M m => m () Source #
If there is a following event, delete it and extend this one to its end.
Since 0 dur events are never lengthened, joining control events simply deletes the later ones.
If it's a point, only join up to (and including) the nearest event start. Otherwise, if there's a collapsed pitch track and the next event doesn't have a pitch event, it's easy to wind up deleting a distance pitch and not noticing.
cmd_split_events :: Cmd.M m => m () Source #
Split the events under the cursor.
cmd_insert_time :: Cmd.M m => m () Source #
Insert empty space at the beginning of the selection for the length of the selection, pushing subsequent events forwards. If the selection is a point, insert one timestep.
cmd_delete_time :: Cmd.M m => m () Source #
Remove the notes under the selection, and move everything else back. If the selection is a point, delete one timestep.
delete_block_time :: Ui.M m => BlockId -> ScoreTime.TrackTime -> ScoreTime.TrackTime -> m () Source #
Delete the time range for all tracks in the block.
cmd_clear_selected :: Cmd.M m => m () Source #
If the insertion selection is a point, clear any event under it. If it's a range, clear all events within its half-open extent.
clear_range :: Ui.M m => [TrackId] -> Events.Range -> m () Source #
cmd_clear_and_advance :: Cmd.M m => m () Source #
toggle_note_duration :: Cmd.M m => m () Source #
Toggle the note duration between the end of the block, and the current time step.
cmd_set_call_duration :: Cmd.M m => m () Source #
cmd_invert_orientation :: Cmd.M m => m () Source #
modify text
cmd_toggle_commented :: Cmd.M m => m () Source #
strip_transformer :: Cmd.M m => m () Source #
Strip off the first transformer, and then the generator.
record action
save_last_action_to :: Cmd.M m => Char -> m () Source #
run_action_at :: Cmd.M m => Char -> m () Source #
floating text input
handle_floating_input Source #
:: Cmd.M m | |
=> Bool | True to always create a zero duration event. |
-> Msg.Msg | |
-> m Cmd.Status |
Handle UpdateInput that comes back from the floating input.
A leading space will create a zero duration event.
append_text :: Cmd.M m => m Cmd.Status Source #
prepend_text :: Cmd.M m => m Cmd.Status Source #
replace_last_call :: Cmd.M m => m Cmd.Status Source #
replace_first_call :: Cmd.M m => m Cmd.Status Source #
This will be fooled by a |
inside a string, but I'll fix that if it's
ever actually a problem.