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

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.

Synopsis

types

data Event Source #

Instances
Eq Event # 
Instance details

Defined in Ui.Event

Methods

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

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

Read Event # 
Instance details

Defined in Ui.Event

Show Event # 
Instance details

Defined in Ui.Event

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

DeepSeq.NFData Event # 
Instance details

Defined in Ui.Event

Methods

rnf :: Event -> () #

CStorable Event # 
Instance details

Defined in Ui.Event

Methods

sizeOf :: Event -> Int #

alignment :: Event -> Int #

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

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

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

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

peek :: Ptr Event -> IO Event #

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

Pretty.Pretty Event # 
Instance details

Defined in Ui.Event

Serialize.Serialize Event # 
Instance details

Defined in Ui.Event

type Text = Text Source #

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

data Stack Source #

Constructors

Stack 

Fields

Instances
Eq Stack # 
Instance details

Defined in Ui.Event

Methods

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

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

Ord Stack # 
Instance details

Defined in Ui.Event

Methods

compare :: Stack -> Stack -> Ordering #

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

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

(>) :: Stack -> Stack -> Bool #

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

max :: Stack -> Stack -> Stack #

min :: Stack -> Stack -> Stack #

Read Stack # 
Instance details

Defined in Ui.Event

Show Stack # 
Instance details

Defined in Ui.Event

Methods

showsPrec :: Int -> Stack -> ShowS #

show :: Stack -> String #

showList :: [Stack] -> ShowS #

DeepSeq.NFData Stack # 
Instance details

Defined in Ui.Event

Methods

rnf :: Stack -> () #

Pretty.Pretty Stack # 
Instance details

Defined in Ui.Event

Serialize.Serialize Stack # 
Instance details

Defined in Ui.Event

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

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.