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

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.

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

data Tracks Source #

Events of which tracks the event time step should use.

data Direction Source #

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

Constructors

Advance 
Rewind 

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.

ascending_points :: Ui.M m => BlockId -> TrackNum -> ScoreTime.TrackTime -> Step -> m [ScoreTime.TrackTime] Source #

Step points ascending from the given time. Includes the start point.

descending_points :: Ui.M m => BlockId -> TrackNum -> ScoreTime.TrackTime -> Step -> m [ScoreTime.TrackTime] Source #

Step points descending from the given time. Includes the start point.