Karya, built on 2018-02-23T20:23:55 (patch cf8565b7ac832266878af99a942555d139065f12)

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

 # Methods # Methods # MethodsshowList :: [TimeStep] -> ShowS #

Step to start and end of events.

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

 # Methods(==) :: Step -> Step -> Bool #(/=) :: Step -> Step -> Bool # # Methods # MethodsshowsPrec :: Int -> Step -> ShowS #show :: Step -> String #showList :: [Step] -> ShowS #

data Tracks Source #

Events of which tracks the event time step should use.

Constructors

 CurrentTrack AllTracks TrackNums [TrackNum]

Instances

 # Methods(==) :: Tracks -> Tracks -> Bool #(/=) :: Tracks -> Tracks -> Bool # # Methods # MethodsshowsPrec :: Int -> Tracks -> ShowS #showList :: [Tracks] -> ShowS #

Constructors

 AllMarklists NamedMarklists [Ruler.Name]

Instances

 # Methods # Methods # MethodsshowList :: [MarklistMatch] -> ShowS #

data Direction Source #

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

Constructors

Instances

 # Methods # MethodsshowList :: [Direction] -> ShowS #

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

Parse that curiously somewhat readable representation back to a TimeStep.

# step

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 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.

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

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