Safe Haskell | Safe-Inferred |
---|
Cmds to create and destroy blocks, views, tracks, and rulers.
IDs are automatically created from the state_namespace and the other IDs in existence. In general I think it's a bad idea to try to hard to give IDs descriptive names because there's nothing keeping them that way. The description should be in the track title. Even the given numbers will get out of date with their position in the block.
However, I do allow some naming beyond simple numbers for things which are unlikely to change, like tempo tracks and rulers, which don't have any other title. And block IDs are used by the sub-derive mechanism, so those should be nameable.
Synopsis
- rename_project :: Ui.M m => Id.Namespace -> m ()
- renamespace :: Ui.M m => Id.Namespace -> Id.Namespace -> m ()
- rename_ruler :: Ui.M m => Id.RulerId -> Id.RulerId -> m ()
- rename_rulers :: Ui.M m => [(Id.RulerId, Id.Id)] -> m ()
- rename_block :: Ui.M m => Id.BlockId -> Id.Id -> m ()
- copy_block :: Ui.M m => Id.BlockId -> Id.Id -> m ()
- orphan_tracks :: Ui.M m => m (Set Id.TrackId)
- orphan_track :: Ui.M m => Id.TrackId -> m Bool
- orphan_rulers :: Ui.M m => m [Id.RulerId]
- orphan_blocks :: Ui.M m => m [Id.BlockId]
- map_track_titles :: Ui.M m => (Text -> Text) -> m ()
- block_from_template :: Ui.M m => Bool -> Id.BlockId -> m Id.BlockId
- named_block_from_template :: Ui.M m => Bool -> Id.BlockId -> Id.Id -> m Id.BlockId
- block :: Ui.M m => Id.RulerId -> m Id.BlockId
- sub_block :: Ui.M m => Maybe Id.BlockId -> Id.RulerId -> m Id.BlockId
- named_block :: Ui.M m => Id.Id -> Id.RulerId -> m Id.BlockId
- destroy_block :: Ui.M m => Id.BlockId -> m ()
- unfitted_view :: Ui.M m => Id.BlockId -> m Id.ViewId
- sized_view :: Ui.M m => Id.BlockId -> Rect.Rect -> m Id.ViewId
- view :: Cmd.M m => Id.BlockId -> m Id.ViewId
- view_or_focus :: Cmd.M m => Id.BlockId -> m (Maybe Id.ViewId)
- view_screen :: Cmd.M m => Id.ViewId -> m Rect.Rect
- block_view :: Cmd.M m => Id.RulerId -> m Id.ViewId
- destroy_view :: Ui.M m => Id.ViewId -> m ()
- splice_below :: Cmd.M m => m Id.TrackId
- splice_above :: Cmd.M m => m Id.TrackId
- splice_above_ancestors :: Cmd.M m => m Id.TrackId
- insert_branch :: Cmd.M m => m ()
- insert_branch_from :: Cmd.M m => Id.BlockId -> Types.TrackNum -> m ()
- make_tracks :: Types.TrackNum -> TrackTree.TrackTree -> ([(Types.TrackNum, Text)], [(Types.TrackNum, Types.TrackNum)])
- assign_tracknums :: Types.TrackNum -> TrackTree.TrackTree -> [Tree.Tree (Types.TrackNum, Text)]
- insert_track_right :: Cmd.M m => m Id.TrackId
- append_track :: Cmd.M m => m Id.TrackId
- focused_track :: Cmd.M m => Types.TrackNum -> m Id.TrackId
- track_and_widen :: Ui.M m => Bool -> Id.ViewId -> Types.TrackNum -> m Id.TrackId
- widen :: Ui.M m => Id.ViewId -> m ()
- empty_track :: Ui.M m => Id.BlockId -> Types.TrackNum -> m Id.TrackId
- track :: Ui.M m => Id.BlockId -> Types.TrackNum -> Text -> Events.Events -> m Id.TrackId
- track_events :: Ui.M m => Id.BlockId -> Id.RulerId -> Types.TrackNum -> Types.Width -> Track.Track -> m Id.TrackId
- named_track :: Ui.M m => Id.BlockId -> Id.RulerId -> Types.TrackNum -> Text -> Track.Track -> m Id.TrackId
- remove_selected_tracks :: Cmd.M m => m ()
- destroy_selected_tracks :: Cmd.M m => m ()
- destroy_track :: Ui.M m => Id.BlockId -> Types.TrackNum -> m ()
- swap_tracks :: Ui.M m => Id.BlockId -> Types.TrackNum -> Types.TrackNum -> m ()
- clip_tracknum :: Ui.M m => Id.BlockId -> Types.TrackNum -> m Types.TrackNum
- track_after :: Block.Block -> Types.TrackNum -> Types.TrackNum
- ruler :: Ui.M m => Text -> Ruler.Ruler -> m Id.RulerId
- new_ruler :: Ui.M m => Id.BlockId -> Text -> Ruler.Ruler -> m Id.RulerId
- set_block_ruler :: Ui.M m => Id.RulerId -> Id.BlockId -> m ()
- find_rect :: Maybe Rect.Rect -> (Int, Int) -> [Rect.Rect] -> (Int, Int)
- find_holes :: [Rect.Rect] -> Rect.Rect -> [Rect.Rect]
global modifications
rename_project :: Ui.M m => Id.Namespace -> m () Source #
Set the project to the given value and renamespace the old project to the
new one. Cmd.state_save_file
is not modified, so it will keep saving to
the old save file.
renamespace :: Ui.M m => Id.Namespace -> Id.Namespace -> m () Source #
Rename all IDs in namespace from
to to
.
rename_ruler :: Ui.M m => Id.RulerId -> Id.RulerId -> m () Source #
rename_rulers :: Ui.M m => [(Id.RulerId, Id.Id)] -> m () Source #
Rename multiple RulerIds at once. This can swap two IDs without colliding.
rename_block :: Ui.M m => Id.BlockId -> Id.Id -> m () Source #
copy_block :: Ui.M m => Id.BlockId -> Id.Id -> m () Source #
orphan_tracks :: Ui.M m => m (Set Id.TrackId) Source #
Find tracks which are not found in any block. Probably used to pass them to Ui.destroy_track for "gc".
orphan_track :: Ui.M m => Id.TrackId -> m Bool Source #
Like orphan_tracks
but more efficiently check if a single track is an
orphan.
orphan_rulers :: Ui.M m => m [Id.RulerId] Source #
Find rulers which are not found in any block.
orphan_blocks :: Ui.M m => m [Id.BlockId] Source #
Find blocks with no associated views.
map_track_titles :: Ui.M m => (Text -> Text) -> m () Source #
Modify track titles with a function.
TODO this is inadequate. I need a function to get parsed inst and control track titles separately. Use TrackTree.track_tree_of to figure inst vs. control.
block
block_from_template :: Ui.M m => Bool -> Id.BlockId -> m Id.BlockId Source #
named_block_from_template Source #
:: Ui.M m | |
=> Bool | copy the events |
-> Id.BlockId | |
-> Id.Id | |
-> m Id.BlockId |
Create a block which is a copy of another.
block :: Ui.M m => Id.RulerId -> m Id.BlockId Source #
BlockIds look like ns/b1
, ns/b2
, etc.
sub_block :: Ui.M m => Maybe Id.BlockId -> Id.RulerId -> m Id.BlockId Source #
Create a block whose BlockId is prefixed by another: ns/parent.b1
.
The relative block call mechanism supported by the default block call means
you can call it from the parent by just writing .b1
.
named_block :: Ui.M m => Id.Id -> Id.RulerId -> m Id.BlockId Source #
Create a block with the given ID name. Useful for blocks meant to be
sub-derived. If the name doesn't contain a /
, it gets the current
namespace.
destroy_block :: Ui.M m => Id.BlockId -> m () Source #
Delete a block and any views it appears in. Also delete any tracks that only appeared in that block.
view
unfitted_view :: Ui.M m => Id.BlockId -> m Id.ViewId Source #
Create a view with the default dimensions.
sized_view :: Ui.M m => Id.BlockId -> Rect.Rect -> m Id.ViewId Source #
view :: Cmd.M m => Id.BlockId -> m Id.ViewId Source #
This is like unfitted_view
, but tries to fit the view size to its
contents.
It's in Cmd.M since it needs the screen dimensions.
Views created during setup are likely to not have the correct height.
That's because I haven't received the screen resolution from fltk yet so
I make a guess in Cmd.get_screen
.
:: Cmd.M m | |
=> Id.BlockId | |
-> m (Maybe Id.ViewId) | Just ViewId if a new one was created. |
Create a view, or focus on it if it already exists.
block_view :: Cmd.M m => Id.RulerId -> m Id.ViewId Source #
destroy_view :: Ui.M m => Id.ViewId -> m () Source #
Destroy a view, along with the underlying block if there were no other views.
track
splice_below :: Cmd.M m => m Id.TrackId Source #
Create a track and splice it below the current one. The track will be inserted to the right of the selected track.
splice_above :: Cmd.M m => m Id.TrackId Source #
splice_above_ancestors :: Cmd.M m => m Id.TrackId Source #
Get the ancestors (topmost parents) of the selected tracks and create a parent track to them. It will be inserted to the left of the leftmost ancestor.
insert_branch :: Cmd.M m => m () Source #
insert_branch_from :: Cmd.M m => Id.BlockId -> Types.TrackNum -> m () Source #
Insert tracks using the given one and its children as a template. The effect is to copy the branch below the selection.
make_tracks :: Types.TrackNum -> TrackTree.TrackTree -> ([(Types.TrackNum, Text)], [(Types.TrackNum, Types.TrackNum)]) Source #
assign_tracknums :: Types.TrackNum -> TrackTree.TrackTree -> [Tree.Tree (Types.TrackNum, Text)] Source #
Assign ascending tracknums to the given tree in depth-first order. Return (tracknum, title) pairs.
insert_track_right :: Cmd.M m => m Id.TrackId Source #
Insert a track after the selection, or just append one if there isn't one. This is useful for empty blocks which of course have no selection.
append_track :: Cmd.M m => m Id.TrackId Source #
focused_track :: Cmd.M m => Types.TrackNum -> m Id.TrackId Source #
track_and_widen :: Ui.M m => Bool -> Id.ViewId -> Types.TrackNum -> m Id.TrackId Source #
Add a new track, and widen the view to make sure it's visible. Give keyboard focus to the title. If there's a point selection, move it to the new track too.
empty_track :: Ui.M m => Id.BlockId -> Types.TrackNum -> m Id.TrackId Source #
track :: Ui.M m => Id.BlockId -> Types.TrackNum -> Text -> Events.Events -> m Id.TrackId Source #
Like track_events
, but copy the ruler from the track to the left.
track_events :: Ui.M m => Id.BlockId -> Id.RulerId -> Types.TrackNum -> Types.Width -> Track.Track -> m Id.TrackId Source #
Lowest level track creator. The new TrackId will be in the same namespace as the given BlockId.
named_track :: Ui.M m => Id.BlockId -> Id.RulerId -> Types.TrackNum -> Text -> Track.Track -> m Id.TrackId Source #
Create a track with the given name, in the same namespace as the BlockId.
remove_selected_tracks :: Cmd.M m => m () Source #
destroy_selected_tracks :: Cmd.M m => m () Source #
destroy_track :: Ui.M m => Id.BlockId -> Types.TrackNum -> m () Source #
Remove a track from a block. If that was the only block it appeared in, delete the underlying track. Rulers are never deleted automatically.
swap_tracks :: Ui.M m => Id.BlockId -> Types.TrackNum -> Types.TrackNum -> m () Source #
Swap the tracks at the given tracknums. If one of the tracknums is out of range, the track at the other tracknum will be moved to the beginning or end, i.e. swapped with empty space.
util
clip_tracknum :: Ui.M m => Id.BlockId -> Types.TrackNum -> m Types.TrackNum Source #
Clip the tracknum to within the valid range.
track_after :: Block.Block -> Types.TrackNum -> Types.TrackNum Source #
Get the track to the right of the given tracknum. This isn't just (+1) because it skips collapsed tracks.
ruler
ruler :: Ui.M m => Text -> Ruler.Ruler -> m Id.RulerId Source #
Create a ruler with the given name.
new_ruler :: Ui.M m => Id.BlockId -> Text -> Ruler.Ruler -> m Id.RulerId Source #
Set a block to a new ruler.
set_block_ruler :: Ui.M m => Id.RulerId -> Id.BlockId -> m () Source #