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

Cmd.Factor

Description

Cmds to do with "refactoring". This basically means fancy copy-paste-like operations.

Synopsis

Documentation

split_time Source #

Arguments

:: Cmd.M m 
=> m Id.BlockId

BlockId of new block

Split the block at the time of the current selection, and create a new block and view with everything afterwards. The old and new blocks are renamed with -1 and -2 suffixes, respectively. The old block is renamed for symmetry with the new one, but mostly because it's changed duration, so previous calls are probably no longer valid.

split_time_at :: Ui.M m => Id.BlockId -> ScoreTime -> Id.Id -> m Id.BlockId Source #

Create a new block from template, then copy over all the events below the given time. Clear the source track, and trim events that overlap the split point. Modify the ruler (locally!) in the old and new blocks.

split_track :: Cmd.M m => m Id.BlockId Source #

Put all tracks with a after the selection into a new block.

Unlike split_time I don't rename the source block, because the length is unchanged.

selection :: Cmd.M m => Id.Id -> m Id.BlockId Source #

Copy the selection into a new block, and replace it with a call to that block.

selection_relative :: Cmd.M m => Id.Id -> m Id.BlockId Source #

Copy the selection to a relative block, and replace it with a relative block call.

relative_selection :: Cmd.M m => Id.Id -> m Id.BlockId Source #

Same as selection_relative because I always type the wrong one.

selection_alts :: Cmd.M m => Bool -> Int -> Id.Id -> m [Id.BlockId] Source #

Create a number of alternate versions of the selection, and insert an alt call.

selection_ Source #

Arguments

:: Cmd.M m 
=> Bool

replace the copied events with a call to the new block

-> Bool

create relative block call

-> Id.Id 
-> m Id.BlockId 

Copy the selection into a new block, and replace it with a call to that block.

extract :: Ui.M m => Id.Id -> Id.BlockId -> [TrackNum] -> [Id.TrackId] -> Events.Range -> m Id.BlockId Source #

Copy the ranges to a new block with the given Id.

replace_with_call :: Ui.M m => Id.BlockId -> [Id.TrackId] -> Events.Range -> Id.BlockId -> Bool -> m () Source #

Clear selected range and put in a call to the new block.

relative calls

rebase_ids :: Ui.M m => Id.BlockId -> Id.BlockId -> m () Source #

Rename all blocks with the old parent as a prefix. Unlike rebase_relative_calls, this doesn't modify any events.

rebase_id :: Id.BlockId -> Id.BlockId -> Id.BlockId -> Maybe Id.Id Source #

Move a relative callee from one parent to another, or Nothing if it's not a child of that parent.

block_from_template :: Cmd.M m => m () Source #

If there's a point selection, create a new empty block based on the current one. If the selection has time, then the new block will have only the selected tracks with a ruler clipped to the selected range.

named block

block_template :: Ui.M m => Id.BlockId -> [Id.TrackId] -> Events.Range -> m Id.BlockId Source #

Create a new block with the given tracks and ruler clipped to the given range.

order block

order_block :: Cmd.M m => Id.Id -> [Id.BlockId] -> m Id.BlockId Source #

Create a new block containing calls to the given BlockIds.

order_track :: Ui.M m => Id.BlockId -> [Id.BlockId] -> m Id.TrackId Source #

Append a track to the given block with calls to the given BlockIds. The calling track will have a 1:1 time relationship with the calls, which is useful for lilypond derivation since it only understands 1:1. Also modify the ruler to be the concatenation of the rulers of the sub-blocks.

util