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

Safe HaskellNone

Cmd.TimeStep

Contents

Description

A TimeStep is an abstract description of a ScoreTime interval.

It's used to advance a cursor, snap a selection, set a note duration, etc.

Synopsis

TimeStep

data TimeStep Source #

A TimeStep is the union of a set of Steps.

Instances
Eq TimeStep # 
Instance details

Defined in Cmd.TimeStep

Read TimeStep # 
Instance details

Defined in Cmd.TimeStep

Show TimeStep # 
Instance details

Defined in Cmd.TimeStep

event_step :: TimeStep Source #

Step to start and end of events.

match_meter :: MarklistMatch Source #

Match on the meter marklist, which is the usual thing to do.

data Step Source #

The possible matchers for a TimeStep.

Constructors

Duration ScoreTime.ScoreTime

Step a certain amount of time. It's measured relative to the current selection, rather than absolute from the beginning of the block.

AbsoluteMark MarklistMatch Ruler.Rank

Until the next mark that matches.

RelativeMark MarklistMatch Ruler.Rank

Until next matching mark + offset from previous mark.

BlockEdge

Until the end or beginning of the block.

EventStart Tracks

Until event edges. EventStart is after EventEnd if the duration is negative.

EventEnd Tracks 
Instances
Eq Step # 
Instance details

Defined in Cmd.TimeStep

Methods

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

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

Read Step # 
Instance details

Defined in Cmd.TimeStep

Show Step # 
Instance details

Defined in Cmd.TimeStep

Methods

showsPrec :: Int -> Step -> ShowS #

show :: Step -> String #

showList :: [Step] -> ShowS #

data Tracks Source #

Events of which tracks the event time step should use.

Instances
Eq Tracks # 
Instance details

Defined in Cmd.TimeStep

Methods

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

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

Read Tracks # 
Instance details

Defined in Cmd.TimeStep

Show Tracks # 
Instance details

Defined in Cmd.TimeStep

data Direction Source #

Another way to express a step_from of 1 or -1.

Constructors

Advance 
Rewind 
Instances
Eq Direction # 
Instance details

Defined in Cmd.TimeStep

Show Direction # 
Instance details

Defined in Cmd.TimeStep

show_time_step :: TimeStep -> Text Source #

Convert a TimeStep to a compact and yet somehow still somewhat readable representation.

parse_time_step :: Text -> Either Text TimeStep Source #

Parse that curiously somewhat readable representation back to a TimeStep.

step

snap Source #

Arguments

:: Ui.M m 
=> TimeStep 
-> BlockId 
-> TrackNum 
-> Maybe ScoreTime.TrackTime

Last sel pos, needed to snap relative steps like Duration and RelativeMark.

-> ScoreTime.TrackTime 
-> m ScoreTime.TrackTime 

Given a pos, the point on a timestep at or previous to that pos. If there was no snap point, the pos is return unchanged.

step_from :: Ui.M m => Int -> TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime) Source #

Step in the given direction from the given position, or Nothing if there is no step from that point. This may return a point past the end of the ruler, or before 0, so if the caller wants to step the selection it should make sure to limit the value. The reason is that this is also used to get e.g. the duration of a whole note at a given point, and that should work even if the given point is near the end of the ruler.

drop_before :: Ord a => a -> [a] -> [a] Source #

Drop until the last element before or equal to the given element.