Safe Haskell | Safe-Inferred |
---|
Synopsis
- type TrackTree = [Tree.Tree Ui.TrackInfo]
- tracks_of :: Ui.M m => BlockId -> m [Ui.TrackInfo]
- parents_children_of :: Ui.M m => BlockId -> TrackId -> m (Maybe ([Ui.TrackInfo], [Ui.TrackInfo]))
- get_children_of :: Ui.M m => BlockId -> TrackId -> m [Ui.TrackInfo]
- is_child_of :: Ui.M m => BlockId -> Types.TrackNum -> Types.TrackNum -> m Bool
- track_tree_of :: Ui.M m => BlockId -> m TrackTree
- resolve_track_tree :: Map Types.TrackNum a -> [Tree.Tree Types.TrackNum] -> ([Tree.Tree a], [Types.TrackNum])
- strip_disabled_tracks :: Ui.M m => BlockId -> TrackTree -> m TrackTree
- type EventsTree = [EventsNode]
- type EventsNode = Tree.Tree Track
- data Track = Track {
- track_title :: !Text
- track_events :: !Events.Events
- track_id :: !(Maybe TrackId)
- track_block_id :: !(Maybe BlockId)
- track_start :: !ScoreTime
- track_end :: !ScoreTime
- track_sliced :: !Sliced
- track_around :: !([Event.Event], [Event.Event])
- track_shifted :: !TrackTime
- track_voice :: !(Maybe Int)
- track_range :: Track -> (TrackTime, TrackTime)
- make_track :: Text -> Events.Events -> ScoreTime -> Track
- data Sliced
- block_track_id :: Track -> Maybe (BlockId, TrackId)
- events_tree_of :: Ui.M m => BlockId -> m EventsTree
- events_tree :: Ui.M m => BlockId -> ScoreTime -> [Tree.Tree Ui.TrackInfo] -> m EventsTree
- block_events_tree :: Ui.M m => BlockId -> m EventsTree
- track_children :: EventsNode -> Set TrackId
- track_voices :: [Tree.Tree Ui.TrackInfo] -> [Tree.Tree (Ui.TrackInfo, Maybe Int)]
- count_occurrences :: (Traversable f, Traversable g, Ord k) => (a -> k) -> f (g a) -> f (g (a, Int))
Documentation
type TrackTree = [Tree.Tree Ui.TrackInfo] Source #
A TrackTree is the Skeleton resolved to the tracks it references.
parents_children_of :: Ui.M m => BlockId -> TrackId -> m (Maybe ([Ui.TrackInfo], [Ui.TrackInfo])) Source #
Return (parents, self : children)
.
get_children_of :: Ui.M m => BlockId -> TrackId -> m [Ui.TrackInfo] Source #
This is like parents_children_of
, but only the children, and it doesn't
include the given TrackId.
is_child_of :: Ui.M m => BlockId -> Types.TrackNum -> Types.TrackNum -> m Bool Source #
track_tree_of :: Ui.M m => BlockId -> m TrackTree Source #
Combine the skeleton with the tracks to create a TrackTree.
TODO this is pretty complicated. If I stored the tracks as a tree in the first place and generated the skeleton from that then this would all go away. But that would mean redoing all the Ui.Skeleton operations for trees. And the reason I didn't do it in the first place was the hassle of graph operations on a Data.Tree.
:: Map Types.TrackNum a | |
-> [Tree.Tree Types.TrackNum] | |
-> ([Tree.Tree a], [Types.TrackNum]) | resolved tree, and missing TrackNums |
Resolve the TrackNum indices in a tree into whatever values as given by a map.
type EventsTree = [EventsNode] Source #
type EventsNode = Tree.Tree Track Source #
Track | |
|
make_track :: Text -> Events.Events -> ScoreTime -> Track Source #
NotSliced | An intact track, unchanged from the score. It's confusing to say track_sliced track == NotSliced, and I could pick something like Intact, but there's no precedent for that terminology. |
Sliced !Types.Orientation | A Derive.Sliced fragment, and certain track-level things should be skipped. |
Inversion | Set on the fake track created by inversion. |
events_tree_of :: Ui.M m => BlockId -> m EventsTree Source #
events_tree :: Ui.M m => BlockId -> ScoreTime -> [Tree.Tree Ui.TrackInfo] -> m EventsTree Source #
block_events_tree :: Ui.M m => BlockId -> m EventsTree Source #
Get the EventsTree of a block. Strip disabled tracks.
track_children :: EventsNode -> Set TrackId Source #
All the children of this EventsNode with TrackIds.
track_voices :: [Tree.Tree Ui.TrackInfo] -> [Tree.Tree (Ui.TrackInfo, Maybe Int)] Source #
Each note track with an instrument gets a count and maximum count, so they
can go in track_voice
and track_voices
.
count_occurrences :: (Traversable f, Traversable g, Ord k) => (a -> k) -> f (g a) -> f (g (a, Int)) Source #
For each element, give its index amount its equals, and the total number of elements equal to it.