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

Safe HaskellNone

Ui.Transform

Contents

Description

Functions for larger scale transformations on a State.

Synopsis

Documentation

tracks :: Ui.M m => Id.BlockId -> (Block.TracklikeId -> Block.TracklikeId) -> m () Source #

Transform TracklikeIds.

map IDs

map_state_ids :: (Id.Id -> Id.Id) -> Ui.State -> Either Ui.Error Ui.State Source #

Map a function across the IDs in the given state. Any collisions are thrown in Left.

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

Transform IDs, but don't update view_id pointer map. So only use this when you are sure there are no visible views ("invisible" views occur after they are created but before the sync). This should probably only be used by map_state_ids.

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

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

Rename a BlockId. Views are updated to point to the new block.

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

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

safe_map_keys :: (Ui.M m, Ord k, Show k) => String -> (k -> k) -> Map k v -> m (Map k v) Source #

namespace

destroy_namespace :: Ui.M m => Id.Namespace -> m () Source #

Destroy all views, blocks, tracks, and rulers with the given namespace.

replace_namespace :: Id.Namespace -> Ui.State -> Ui.State -> Ui.State Source #

Replace the namespace of the second state with the one from the first state.

merge

merge_states :: Ui.State -> Ui.State -> Either Ui.Error Ui.State Source #

Merge ID maps from the states together. Collisions will throw. The Ui.Config comes from the first state.

safe_union :: (Ui.M m, Ord k, Show k) => String -> Map k a -> Map k a -> m (Map k a) Source #

intern

intern_text :: Ui.State -> (Ui.State, Map Text Int) Source #

Increase sharing in event text with an intern table.