Safe Haskell | Safe-Inferred |
---|
Synopsis
- data Block = Block {}
- data Skeleton
- type Meta = Map Text Text
- data TrackDestinations
- type ScoreDestinations = [(TrackId, (TrackId, EventIndex))]
- data NoteDestination = NoteDestination {
- dest_key :: !Text
- dest_note :: !(TrackId, EventIndex)
- dest_controls :: !(Map Text (TrackId, EventIndex))
- dest_track_ids :: TrackDestinations -> [TrackId]
- note_dest_track_ids :: NoteDestination -> [TrackId]
- empty_destination :: Text -> TrackId -> [(Text, TrackId)] -> NoteDestination
- data Source
- destination_to_source :: Block -> [(TrackId, (Source, EventIndex))]
- type ManualDestinations = Map SourceKey [NoteDestination]
- type SourceKey = Text
- type EventIndex = Map Event.IndexKey Event.Event
- short_event_index :: EventIndex -> Text
- integrate_skeleton :: Block -> [(Color.Color, [(Types.TrackNum, Types.TrackNum)])]
- block_tracklike_ids :: Block -> [TracklikeId]
- block_track_ids :: Block -> [TrackId]
- block_ruler_ids :: Block -> [RulerId]
- block :: Config -> Text -> [Track] -> Block
- data Config = Config {
- config_skel_box :: !Box
- config_track_box :: !Box
- config_sb_box :: !Box
- config_skeleton :: !Skeleton
- default_config :: Config
- data Box = Box {
- box_color :: !Color.Color
- box_char :: !Char.Char
- data Track = Track {
- tracklike_id :: !TracklikeId
- track_width :: !Types.Width
- track_suggested_width :: !Types.Width
- track_flags :: !(Set TrackFlag)
- track_merged :: !(Set TrackId)
- track_id :: Track -> Maybe TrackId
- track :: TracklikeId -> Types.Width -> Track
- modify_id :: (TracklikeId -> TracklikeId) -> Track -> Track
- divider :: Track
- is_collapsed :: Set TrackFlag -> Bool
- track_selectable :: Track -> Bool
- track_wants_signal :: Set TrackFlag -> Track.Track -> Bool
- data DisplayTrack = DisplayTrack {}
- data Status = Status !String !Color.Color
- empty_status :: Status
- data TrackFlag
- block_display_tracks :: Block -> [DisplayTrack]
- display_track_width :: Track -> Types.Width
- flags_to_status :: Set TrackFlag -> (Status, Double)
- flag_char :: TrackFlag -> Char.Char
- data TracklikeId
- track_id_of :: TracklikeId -> Maybe TrackId
- track_ids_of :: [TracklikeId] -> [TrackId]
- ruler_id_of :: TracklikeId -> Maybe RulerId
- ruler_ids_of :: [TracklikeId] -> [RulerId]
- set_ruler_id :: RulerId -> TracklikeId -> TracklikeId
- data Tracklike
- track_of :: Tracklike -> Maybe Track.Track
- tracks_of :: [Tracklike] -> [Track.Track]
- ruler_of :: Tracklike -> Maybe Ruler.Ruler
- rulers_of :: [Tracklike] -> [Ruler.Ruler]
- newtype Divider = Divider Color.Color
- data View = View {
- view_block :: !BlockId
- view_rect :: !Rect.Rect
- view_padding :: !Padding
- view_status :: !(Map (Int, Text) Text)
- view_track_scroll :: !Types.Width
- view_zoom :: !Zoom.Zoom
- view_selections :: !(Map Sel.Num Sel.Selection)
- view :: Block -> BlockId -> Rect.Rect -> Zoom.Zoom -> View
- data Padding = Padding {}
- status_color :: BlockId -> Block -> Maybe BlockId -> Color.Color
- show_status :: Map (Int, Text) Text -> Text
- visible_track :: View -> Types.Width
- visible_time :: View -> TrackTime
- track_rect :: View -> Rect.Rect
- set_track_rect :: View -> Rect.Rect -> Rect.Rect
- view_visible_time :: View -> Int
- view_visible_track :: View -> Int
- screen_pixels :: View -> TrackTime -> Int
Block
This is the data behind a single block.
Block | |
|
Instances
type Meta = Map Text Text Source #
Block metadata is extra data that doesn't affect normal derivation, but may be of interest to cmds.
Previously this was used to mark blocks for automatic lilypond derivation, currently tscore uses it to mark sub-blocks.
data TrackDestinations Source #
DeriveDestinations ![NoteDestination] | A derive integrate can produce multiple note tracks, and each one gets its own NoteDestination. The TrackIds in here should point to tracks within the block that contains the TrackDestinations. |
ScoreDestinations !ScoreDestinations | A score integrate is always just one track along with its descendents. It's not necessarily a note track. |
Instances
Show TrackDestinations Source # | |
Defined in Ui.Block showsPrec :: Int -> TrackDestinations -> ShowS # show :: TrackDestinations -> String # showList :: [TrackDestinations] -> ShowS # | |
Eq TrackDestinations Source # | |
Defined in Ui.Block (==) :: TrackDestinations -> TrackDestinations -> Bool # (/=) :: TrackDestinations -> TrackDestinations -> Bool # | |
Pretty.Pretty TrackDestinations Source # | |
Defined in Ui.Block pretty :: TrackDestinations -> Text Source # format :: TrackDestinations -> Doc Source # formatList :: [TrackDestinations] -> Doc Source # | |
Serialize TrackDestinations Source # | |
Defined in Cmd.Serialize |
type ScoreDestinations = [(TrackId, (TrackId, EventIndex))] Source #
Score derivation creates destination tracks 1:1 with their source tracks, so I can key them with their source TrackIds.
(source_track_id, (destination_track_id, index))
For block_integrated
, the source_track_id should point to a track in the
source block. For block_integrated_tracks
it should point to a track
within its own block. The destination_track_id should always point to
a track in the same block.
data NoteDestination Source #
This holds the EventIndex
for one note track, along with its dependent
control tracks.
NoteDestination | |
|
Instances
Show NoteDestination Source # | |
Defined in Ui.Block showsPrec :: Int -> NoteDestination -> ShowS # show :: NoteDestination -> String # showList :: [NoteDestination] -> ShowS # | |
Eq NoteDestination Source # | |
Defined in Ui.Block (==) :: NoteDestination -> NoteDestination -> Bool # (/=) :: NoteDestination -> NoteDestination -> Bool # | |
Pretty.Pretty NoteDestination Source # | |
Defined in Ui.Block pretty :: NoteDestination -> Text Source # format :: NoteDestination -> Doc Source # formatList :: [NoteDestination] -> Doc Source # | |
Serialize NoteDestination Source # | |
Defined in Cmd.Serialize |
dest_track_ids :: TrackDestinations -> [TrackId] Source #
note_dest_track_ids :: NoteDestination -> [TrackId] Source #
empty_destination :: Text -> TrackId -> [(Text, TrackId)] -> NoteDestination Source #
Create an empty destination for the first integration.
ManualSource !SourceKey | Integrated from a manually-invoked integration. A single SourceKey can have destinations on multiple tracks within the block. |
TrackSource !TrackId | |
BlockSource !BlockId |
destination_to_source :: Block -> [(TrackId, (Source, EventIndex))] Source #
TODO I intended to unify all the integration muddle into one dest to source map, and maybe I stil can, but meanwhile, here's what it could look like.
type ManualDestinations = Map SourceKey [NoteDestination] Source #
Destinations for a manually-invoked integration. A single SourceKey can have destinations on multiple tracks within the block.
type SourceKey = Text Source #
Arbitrary text used to identify the source of this integration. Unlike automatic integrations, which come from another block or track, a manual integration can bring in events from anywhere, so it needs a unique key to identify the source.
type EventIndex = Map Event.IndexKey Event.Event Source #
This is a picture of the integrated events that were used to create an integrated block or track. By taking its difference against the current contents of the block I can figure out user edits.
short_event_index :: EventIndex -> Text Source #
integrate_skeleton :: Block -> [(Color.Color, [(Types.TrackNum, Types.TrackNum)])] Source #
Arrows that should be drawn to indicate integrate relationships.
block_tracklike_ids :: Block -> [TracklikeId] Source #
block_track_ids :: Block -> [TrackId] Source #
block_ruler_ids :: Block -> [RulerId] Source #
Per-block configuration.
Config | |
|
Instances
One of those colored boxes wedged into the corners of the block window.
Box | |
|
Track
Like Track.Track
, this has per-track data, but unlike Track.Track,
this is data that can vary per-block.
This is the higher level track that is visible at the haskell level, as
opposed to DisplayTrack
, which is what is visible in the UI.
Track | |
|
track :: TracklikeId -> Types.Width -> Track Source #
Construct a Track
with defaults.
modify_id :: (TracklikeId -> TracklikeId) -> Track -> Track Source #
A generic divider to insert manually as a visual aid. Imitates the background color.
track_selectable :: Track -> Bool Source #
track_wants_signal :: Set TrackFlag -> Track.Track -> Bool Source #
Don't send a track signal to a track unless it actually wants to draw it.
DisplayTrack
data DisplayTrack Source #
This is the low-level representation of a track, which directly
corresponds with what is displayed by the UI. The DisplayTracks should be
derivable from a Block
deterministically.
DisplayTrack | |
|
Instances
Show DisplayTrack Source # | |
Defined in Ui.Block showsPrec :: Int -> DisplayTrack -> ShowS # show :: DisplayTrack -> String # showList :: [DisplayTrack] -> ShowS # | |
CStorable DisplayTrack Source # | |
Defined in Ui.BlockC sizeOf :: DisplayTrack -> Int # alignment :: DisplayTrack -> Int # peekElemOff :: Ptr DisplayTrack -> Int -> IO DisplayTrack # pokeElemOff :: Ptr DisplayTrack -> Int -> DisplayTrack -> IO () # peekByteOff :: Ptr b -> Int -> IO DisplayTrack # pokeByteOff :: Ptr b -> Int -> DisplayTrack -> IO () # peek :: Ptr DisplayTrack -> IO DisplayTrack # poke :: Ptr DisplayTrack -> DisplayTrack -> IO () # | |
Eq DisplayTrack Source # | |
Defined in Ui.Block (==) :: DisplayTrack -> DisplayTrack -> Bool # (/=) :: DisplayTrack -> DisplayTrack -> Bool # | |
Pretty.Pretty DisplayTrack Source # | |
Defined in Ui.Block pretty :: DisplayTrack -> Text Source # format :: DisplayTrack -> Doc Source # formatList :: [DisplayTrack] -> Doc Source # |
This has a 2 character string to display above the track, and a background color. TODO change to Char Char
Instances
Show Status Source # | |
CStorable Status Source # | |
Eq Status Source # | |
Pretty.Pretty Status Source # | |
Most of these only make sense for event tracks.
Collapse | Track is collapsed to take up less space. |
Merge | |
Solo | UI shows solo indication. If any tracks are soloed on a block, only those tracks are played. |
Mute | UI shows muted indication, player should filter out events from this track. |
Disable | This is like Mute, except that the track is entirely omitted from derivation. Since Mute and Solo work after derivation, they don't require a rederive but also can't mute a single control track. |
Instances
Bounded TrackFlag Source # | |
Enum TrackFlag Source # | |
Defined in Ui.Block succ :: TrackFlag -> TrackFlag # pred :: TrackFlag -> TrackFlag # fromEnum :: TrackFlag -> Int # enumFrom :: TrackFlag -> [TrackFlag] # enumFromThen :: TrackFlag -> TrackFlag -> [TrackFlag] # enumFromTo :: TrackFlag -> TrackFlag -> [TrackFlag] # enumFromThenTo :: TrackFlag -> TrackFlag -> TrackFlag -> [TrackFlag] # | |
Show TrackFlag Source # | |
Eq TrackFlag Source # | |
Ord TrackFlag Source # | |
Defined in Ui.Block | |
Pretty.Pretty TrackFlag Source # | |
Serialize TrackFlag Source # | |
block_display_tracks :: Block -> [DisplayTrack] Source #
Convert logical block level tracks to display tracks.
TracklikeId
data TracklikeId Source #
Instances
Show TracklikeId Source # | |
Defined in Ui.Block showsPrec :: Int -> TracklikeId -> ShowS # show :: TracklikeId -> String # showList :: [TracklikeId] -> ShowS # | |
Eq TracklikeId Source # | |
Defined in Ui.Block (==) :: TracklikeId -> TracklikeId -> Bool # (/=) :: TracklikeId -> TracklikeId -> Bool # | |
Ord TracklikeId Source # | |
Defined in Ui.Block compare :: TracklikeId -> TracklikeId -> Ordering # (<) :: TracklikeId -> TracklikeId -> Bool # (<=) :: TracklikeId -> TracklikeId -> Bool # (>) :: TracklikeId -> TracklikeId -> Bool # (>=) :: TracklikeId -> TracklikeId -> Bool # max :: TracklikeId -> TracklikeId -> TracklikeId # min :: TracklikeId -> TracklikeId -> TracklikeId # | |
Pretty.Pretty TracklikeId Source # | |
Defined in Ui.Block pretty :: TracklikeId -> Text Source # format :: TracklikeId -> Doc Source # formatList :: [TracklikeId] -> Doc Source # | |
Serialize TracklikeId Source # | |
Defined in Cmd.Serialize put :: Putter TracklikeId Source # get :: Get TracklikeId Source # |
track_id_of :: TracklikeId -> Maybe TrackId Source #
track_ids_of :: [TracklikeId] -> [TrackId] Source #
ruler_id_of :: TracklikeId -> Maybe RulerId Source #
ruler_ids_of :: [TracklikeId] -> [RulerId] Source #
set_ruler_id :: RulerId -> TracklikeId -> TracklikeId Source #
tracks_of :: [Tracklike] -> [Track.Track] Source #
rulers_of :: [Tracklike] -> [Ruler.Ruler] Source #
A divider separating tracks. Defined here in Block since it's so trivial.
Instances
Show Divider Source # | |
CStorable Divider Source # | |
Eq Divider Source # | |
Ord Divider Source # | |
Serialize Divider Source # | |
View
A view is a single window on screen. Views are destroyed when the window is closed.
View | |
|
view :: Block -> BlockId -> Rect.Rect -> Zoom.Zoom -> View Source #
Construct a View, using default values for most of its fields.
Don't construct views using View directly since create_view
overwrites view_tracks, and maybe more in the future.
Pixel width and height of stuff in the view that is not the track area, i.e. scrollbars, skeleton display, block title, etc.
Only fltk knows the width of all the various widgets, but it's cached
here so pure code doesn't have to call to the UI and import BlockC.
Only UpdateViewResize
should set this, which in turn comes from
MsgCollector::msg_resize, which in turn comes from Block::get_padding.
Instances
Show Padding Source # | |
CStorable Padding Source # | |
Eq Padding Source # | |
Ord Padding Source # | |
Pretty.Pretty Padding Source # | |
Serialize Padding Source # | |
status_color :: BlockId -> Block -> Maybe BlockId -> Color.Color Source #
Figure out what color the background of the status line should be.
visible_track :: View -> Types.Width Source #
visible_time :: View -> TrackTime Source #
Return how much track is in view.
track_rect :: View -> Rect.Rect Source #
Get the rect of the track area within the view. This is used with
set_track_rect
to set the size of the visible track area, minus the
extra GUI bits around it.
set_track_rect :: View -> Rect.Rect -> Rect.Rect Source #
The inverse of track_rect
Use this to set the track area area to
a certain size.
view_visible_time :: View -> Int Source #
view_visible_track :: View -> Int Source #