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

Safe HaskellNone

Ui.Event

Contents

Description

The main attributes of an event are its duration and text. The starting time is actually in the Track.

Events can display a signal, which will be rendered in the background in one of a few ways: a color, or a graph.

The text in events never changes size, even when you zoom in or out. If an Event gets too small for its text, it collapses into a blue chunk, which is the standard color for some data that didn't fit.

The beginning of the Event is marked with a red line. The text will begin slightly below the line, but still try to fit within the event. If the Event end doesn't give room for the text, the text will overlap the line so that its bottom touches the bottom of the Event. If there is no room for the text at all, because of other text or the top of the Event, the text will disappear and the line will be blue, to mark hidden text.

No Event may overlap another Event on the same Track.

TODO The Event has attributes which store arbitrary key-value pairs. This can be used to store the "parent event" of a derivation, for instance.

Synopsis

types

type Text = Text Source #

TODO remove this, it dates from when event text was ByteString.

data Stack Source #

Constructors

Stack 

Fields

type IndexKey = ScoreTime.TrackTime Source #

This is the original position of the event on its integrated track. I can use this to find the (hopefully) equivalent event from the next integration to apply it even if the event has been moved or altered.

Keying on just the position has the effect that moving an event means to move any event that is generated at that position. This might be perfectly reasonable or even desirable since it's easier to understand. I'll have to see what kinds of edits and what kinds of reintegrations are likely in practice.

access

end :: Event -> ScoreTime.ScoreTime Source #

Return the position at the end of the event. If it has a negative duration, this will be before the start.

Orientation

data Orientation Source #

Whether the event is front-weighted or back-weighted. In the event this is represented with positive or negative duration.

Constructors

Negative 
Positive 

Instances

Bounded Orientation # 
Enum Orientation # 
Eq Orientation # 
Ord Orientation # 
Read Orientation # 
Show Orientation # 
Pretty.Pretty Orientation # 
Serialize.Serialize Orientation # 

modify

set_start :: ScoreTime.ScoreTime -> Event -> Event Source #

Move the start only. This could invert the duration if the start moves past the end.

set_end :: ScoreTime.ScoreTime -> Event -> Event Source #

Redundant with the end_ lens, but here for symmetry with set_start.

round :: Event -> Event Source #

Round event times as described in ScoreTime.round. TODO used by Events, do I really need this?

misc

style

type EventStyle Source #

Arguments

 = Text

track title

-> Event 
-> Style.StyleId 

This is called on events before they go to the UI, to be used for "syntax highlighting", i.e. it can set the style depending on the event, but the change in style won't be saved in the event itself.