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

Safe HaskellNone

Ui.Block

Contents

Synopsis

Block

data Block Source #

This is the data behind a single block.

Constructors

Block 

Fields

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.

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 Box Source #

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

Constructors

Box 

Instances

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.

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 

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.

block_display_tracks :: Block -> [DisplayTrack] Source #

Convert logical block level tracks to display tracks.

TracklikeId

newtype Divider Source #

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

Constructors

Divider Color.Color 

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 # 

Methods

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

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

Ord View # 

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 # 
Show View # 

Methods

showsPrec :: Int -> View -> ShowS #

show :: View -> String #

showList :: [View] -> ShowS #

DeepSeq.NFData View # 

Methods

rnf :: View -> () #

Pretty.Pretty 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.

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

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.