Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Ui.Block

Synopsis

Block

data Block Source #

This is the data behind a single block.

Constructors

Block 

Fields

Instances

Instances details
Generics.Generic Block Source # 
Instance details

Defined in Ui.Block

Associated Types

type Generics.Rep Block :: Type -> Type #

Show Block Source # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

DeepSeq.NFData Block Source # 
Instance details

Defined in Ui.Block

Methods

rnf :: Block -> () #

Eq Block Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Pretty.Pretty Block Source # 
Instance details

Defined in Ui.Block

Serialize Block Source # 
Instance details

Defined in Cmd.Serialize

type Generics.Rep Block Source # 
Instance details

Defined in Ui.Block

type Generics.Rep Block = Generics.D1 ('Generics.MetaData "Block" "Ui.Block" "main" 'False) (Generics.C1 ('Generics.MetaCons "Block" 'Generics.PrefixI 'True) (((Generics.S1 ('Generics.MetaSel ('Just "block_title") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 Text) Generics.:*: Generics.S1 ('Generics.MetaSel ('Just "block_config") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 Config)) Generics.:*: (Generics.S1 ('Generics.MetaSel ('Just "block_tracks") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 [Track]) Generics.:*: Generics.S1 ('Generics.MetaSel ('Just "block_skeleton") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 Skeleton.Skeleton))) Generics.:*: ((Generics.S1 ('Generics.MetaSel ('Just "block_integrated") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 (Maybe (BlockId, TrackDestinations))) Generics.:*: Generics.S1 ('Generics.MetaSel ('Just "block_integrated_tracks") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 [(TrackId, TrackDestinations)])) Generics.:*: (Generics.S1 ('Generics.MetaSel ('Just "block_integrated_manual") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 ManualDestinations) Generics.:*: Generics.S1 ('Generics.MetaSel ('Just "block_meta") 'Generics.NoSourceUnpackedness 'Generics.SourceStrict 'Generics.DecidedStrict) (Generics.Rec0 Meta)))))

data Skeleton Source #

Constructors

Explicit 
Implicit 

Instances

Instances details
Show Skeleton Source # 
Instance details

Defined in Ui.Block

Eq Skeleton Source # 
Instance details

Defined in Ui.Block

Pretty.Pretty Skeleton Source # 
Instance details

Defined in Ui.Block

Serialize Skeleton Source # 
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.

Previously this was used to mark blocks for automatic lilypond derivation, currently tscore uses it to mark sub-blocks.

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

  • dest_key :: !Text

    The key should uniquely identify this particular destination. The next time there is a merge, the source tracks can match by key. Otherwise, they just have to blindly zip sources and dests, and can't detect deletions or moves.

  • dest_note :: !(TrackId, EventIndex)

    (dest_track, index)

  • dest_controls :: !(Map Text (TrackId, EventIndex))

    Map from control name to the track which was created for it.

empty_destination :: Text -> TrackId -> [(Text, TrackId)] -> NoteDestination Source #

Create an empty destination for the first integration.

data Source Source #

Constructors

ManualSource !SourceKey

Integrated from a manually-invoked integration. A single SourceKey can have destinations on multiple tracks within the block.

TrackSource !TrackId 
BlockSource !BlockId 

Instances

Instances details
Show Source Source # 
Instance details

Defined in Ui.Block

Eq Source Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Ord Source Source # 
Instance details

Defined in Ui.Block

Pretty.Pretty Source Source # 
Instance details

Defined in Ui.Block

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.

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.

Instances

Instances details
Generics.Generic Config Source # 
Instance details

Defined in Ui.Block

Associated Types

type Generics.Rep Config :: Type -> Type #

Show Config Source # 
Instance details

Defined in Ui.Block

CStorable Config Source # 
Instance details

Defined in Ui.BlockC

Eq Config Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Pretty.Pretty Config Source # 
Instance details

Defined in Ui.Block

type Generics.Rep Config Source # 
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

Instances details
Show Box Source # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Box -> ShowS #

show :: Box -> String #

showList :: [Box] -> ShowS #

CStorable Box Source # 
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 () #

Eq Box Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Pretty.Pretty Box Source # 
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_suggested_width :: !Types.Width

    This is a width suggested by fltk that should be enough to show all the text. Unlike the other fields in Track, it's derived from the track contents and is automatically updated by the UI.

  • 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

Instances details
Show Track Source # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> Track -> ShowS #

show :: Track -> String #

showList :: [Track] -> ShowS #

Eq Track Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Pretty.Pretty Track Source # 
Instance details

Defined in Ui.Block

Serialize Track Source # 
Instance details

Defined in Cmd.Serialize

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

Construct a Track with defaults.

divider :: Track Source #

A generic divider to insert manually as a visual aid. Imitates the background color.

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. TODO change to Char Char

Constructors

Status !String !Color.Color 

Instances

Instances details
Show Status Source # 
Instance details

Defined in Ui.Block

CStorable Status Source # 
Instance details

Defined in Ui.BlockC

Eq Status Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Pretty.Pretty Status Source # 
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.

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

Instances details
Bounded TrackFlag Source # 
Instance details

Defined in Ui.Block

Enum TrackFlag Source # 
Instance details

Defined in Ui.Block

Show TrackFlag Source # 
Instance details

Defined in Ui.Block

Eq TrackFlag Source # 
Instance details

Defined in Ui.Block

Ord TrackFlag Source # 
Instance details

Defined in Ui.Block

Pretty.Pretty TrackFlag Source # 
Instance details

Defined in Ui.Block

Serialize TrackFlag Source # 
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

Instances details
Show Tracklike Source # 
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

Instances details
Show Divider Source # 
Instance details

Defined in Ui.Block

CStorable Divider Source # 
Instance details

Defined in Ui.BlockC

Eq Divider Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Ord Divider Source # 
Instance details

Defined in Ui.Block

Serialize Divider Source # 
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

Instances details
Show View Source # 
Instance details

Defined in Ui.Block

Methods

showsPrec :: Int -> View -> ShowS #

show :: View -> String #

showList :: [View] -> ShowS #

DeepSeq.NFData View Source # 
Instance details

Defined in Ui.Block

Methods

rnf :: View -> () #

Eq View Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Ord View Source # 
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 #

Pretty.Pretty View Source # 
Instance details

Defined in Ui.Block

Serialize View Source # 
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

Instances details
Show Padding Source # 
Instance details

Defined in Ui.Block

CStorable Padding Source # 
Instance details

Defined in Ui.UiMsgC

Eq Padding Source # 
Instance details

Defined in Ui.Block

Methods

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

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

Ord Padding Source # 
Instance details

Defined in Ui.Block

Pretty.Pretty Padding Source # 
Instance details

Defined in Ui.Block

Serialize Padding Source # 
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.