Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Ui.Block

Contents

Synopsis

Block

data Block Source #

This is the data behind a single block.

Constructors

Block 

Fields

Instances
Eq Block # 
Instance details

Defined in Ui.Block

Methods

(==) :: Block -> Block -> Bool #

(/=) :: Block -> Block -> Bool #

Read Block # 
Instance details

Defined in Ui.Block

Show Block # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

DeepSeq.NFData Block # 
Instance details

Defined in Ui.Block

Methods

rnf :: Block -> () #

Pretty.Pretty Block # 
Instance details

Defined in Ui.Block

Serialize Block # 
Instance details

Defined in Cmd.Serialize

type Meta = Map Text Text Source #

Block metadata is extra data that doesn't affect normal derivation, but may be of interest to cmds. For instance, it can mark if this block should be rendered to lilypond and provide arguments for it. TODO But lilypond is always kicked off manually now, so this has no use at the moment. Maybe you could put notes in there.

data TrackDestinations Source #

Constructors

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.

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.

Constructors

NoteDestination 

Fields

empty_destination :: TrackId -> NoteDestination Source #

Create an empty destination for the first integration.

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.

type EventIndex = Map Event.IndexKey Event.Event Source #

This is a picture of the integrated events that were used to create an integrated block. By taking its difference against the current contents of the block I can figure out user edits.

integrate_skeleton :: Block -> [(Color.Color, [(Types.TrackNum, Types.TrackNum)])] Source #

Arrows that should be drawn to indicate integrate relationships.

data Config Source #

Per-block configuration.

Constructors

Config 
Instances
Eq Config # 
Instance details

Defined in Ui.Block

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Read Config # 
Instance details

Defined in Ui.Block

Show Config # 
Instance details

Defined in Ui.Block

CStorable Config # 
Instance details

Defined in Ui.BlockC

Pretty.Pretty Config # 
Instance details

Defined in Ui.Block

data Box Source #

One of those colored boxes wedged into the corners of the block window.

Constructors

Box 
Instances
Eq Box # 
Instance details

Defined in Ui.Block

Methods

(==) :: Box -> Box -> Bool #

(/=) :: Box -> Box -> Bool #

Read Box # 
Instance details

Defined in Ui.Block

Show Box # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Box -> ShowS #

show :: Box -> String #

showList :: [Box] -> ShowS #

CStorable Box # 
Instance details

Defined in Ui.BlockC

Methods

sizeOf :: Box -> Int #

alignment :: Box -> Int #

peekElemOff :: Ptr Box -> Int -> IO Box #

pokeElemOff :: Ptr Box -> Int -> Box -> IO () #

peekByteOff :: Ptr b -> Int -> IO Box #

pokeByteOff :: Ptr b -> Int -> Box -> IO () #

peek :: Ptr Box -> IO Box #

poke :: Ptr Box -> Box -> IO () #

Pretty.Pretty Box # 
Instance details

Defined in Ui.Block

Track

data Track Source #

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.

Constructors

Track 

Fields

  • tracklike_id :: !TracklikeId
     
  • track_width :: !Types.Width

    Formerly the width was in the view since each view could have a different width and this was just the default width, but that turned out to be too much of a hassle, so now all occurences of a track have the same width.

  • track_flags :: !(Set TrackFlag)

    Track display state flags.

  • track_merged :: !(Set TrackId)

    Other tracks are displayed behind this one. Useful to merge a pitch track into its note track.

Instances
Eq Track # 
Instance details

Defined in Ui.Block

Methods

(==) :: Track -> Track -> Bool #

(/=) :: Track -> Track -> Bool #

Read Track # 
Instance details

Defined in Ui.Block

Show Track # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Track -> ShowS #

show :: Track -> String #

showList :: [Track] -> ShowS #

Pretty.Pretty Track # 
Instance details

Defined in Ui.Block

Serialize Track # 
Instance details

Defined in Cmd.Serialize

track :: TracklikeId -> Types.Width -> Track Source #

Construct a Track with defaults.

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.

data Status Source #

This has a 2 character string to display above the track, and a background color.

Constructors

Status !String !Color.Color 
Instances
Eq Status # 
Instance details

Defined in Ui.Block

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

Read Status # 
Instance details

Defined in Ui.Block

Show Status # 
Instance details

Defined in Ui.Block

CStorable Status # 
Instance details

Defined in Ui.BlockC

Pretty.Pretty Status # 
Instance details

Defined in Ui.Block

data TrackFlag Source #

Most of these only make sense for event tracks.

Constructors

Collapse

Track is collapsed to take up less space.

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 # 
Instance details

Defined in Ui.Block

Enum TrackFlag # 
Instance details

Defined in Ui.Block

Eq TrackFlag # 
Instance details

Defined in Ui.Block

Ord TrackFlag # 
Instance details

Defined in Ui.Block

Read TrackFlag # 
Instance details

Defined in Ui.Block

Show TrackFlag # 
Instance details

Defined in Ui.Block

Pretty.Pretty TrackFlag # 
Instance details

Defined in Ui.Block

Serialize TrackFlag # 
Instance details

Defined in Cmd.Serialize

block_display_tracks :: Block -> [DisplayTrack] Source #

Convert logical block level tracks to display tracks.

TracklikeId

data Tracklike Source #

Instances
Show Tracklike # 
Instance details

Defined in Ui.Block

newtype Divider Source #

A divider separating tracks. Defined here in Block since it's so trivial.

Constructors

Divider Color.Color 
Instances
Eq Divider # 
Instance details

Defined in Ui.Block

Methods

(==) :: Divider -> Divider -> Bool #

(/=) :: Divider -> Divider -> Bool #

Ord Divider # 
Instance details

Defined in Ui.Block

Read Divider # 
Instance details

Defined in Ui.Block

Show Divider # 
Instance details

Defined in Ui.Block

CStorable Divider # 
Instance details

Defined in Ui.BlockC

Serialize Divider # 
Instance details

Defined in Cmd.Serialize

View

data View Source #

A view is a single window on screen. Views are destroyed when the window is closed.

Constructors

View 

Fields

Instances
Eq View # 
Instance details

Defined in Ui.Block

Methods

(==) :: View -> View -> Bool #

(/=) :: View -> View -> Bool #

Ord View # 
Instance details

Defined in Ui.Block

Methods

compare :: View -> View -> Ordering #

(<) :: View -> View -> Bool #

(<=) :: View -> View -> Bool #

(>) :: View -> View -> Bool #

(>=) :: View -> View -> Bool #

max :: View -> View -> View #

min :: View -> View -> View #

Read View # 
Instance details

Defined in Ui.Block

Show View # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> View -> ShowS #

show :: View -> String #

showList :: [View] -> ShowS #

DeepSeq.NFData View # 
Instance details

Defined in Ui.Block

Methods

rnf :: View -> () #

Pretty.Pretty View # 
Instance details

Defined in Ui.Block

Serialize View # 
Instance details

Defined in Cmd.Serialize

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.

data Padding Source #

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.

Constructors

Padding 

Fields

Instances
Eq Padding # 
Instance details

Defined in Ui.Block

Methods

(==) :: Padding -> Padding -> Bool #

(/=) :: Padding -> Padding -> Bool #

Ord Padding # 
Instance details

Defined in Ui.Block

Read Padding # 
Instance details

Defined in Ui.Block

Show Padding # 
Instance details

Defined in Ui.Block

CStorable Padding # 
Instance details

Defined in Ui.UiMsgC

Pretty.Pretty Padding # 
Instance details

Defined in Ui.Block

Serialize Padding # 
Instance details

Defined in Cmd.Serialize

status_color :: BlockId -> Block -> Maybe BlockId -> Color.Color Source #

Figure out what color the background of the status line should be.

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.

screen_pixels :: View -> TrackTime -> Int Source #

Y coordinate of the given TrackTime.