Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

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

Instances details
Show TimeStep Source # 
Instance details

Defined in Cmd.TimeStep

Eq TimeStep Source # 
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 Meter.Rank

Until the next mark that matches.

RelativeMark MarklistMatch Meter.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

Instances details
Show Step Source # 
Instance details

Defined in Cmd.TimeStep

Methods

showsPrec :: Int -> Step -> ShowS #

show :: Step -> String #

showList :: [Step] -> ShowS #

Eq Step Source # 
Instance details

Defined in Cmd.TimeStep

Methods

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

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

data Tracks Source #

Events of which tracks the event time step should use.

Instances

Instances details
Show Tracks Source # 
Instance details

Defined in Cmd.TimeStep

Eq Tracks Source # 
Instance details

Defined in Cmd.TimeStep

Methods

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

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

data MarklistMatch Source #

Instances

Instances details
Show MarklistMatch Source # 
Instance details

Defined in Cmd.TimeStep

Eq MarklistMatch Source # 
Instance details

Defined in Cmd.TimeStep

data Direction Source #

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

Constructors

Advance 
Rewind 

Instances

Instances details
Show Direction Source # 
Instance details

Defined in Cmd.TimeStep

Eq Direction Source # 
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.