Safe Haskell | Safe-Inferred |
---|
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
- data TimeStep
- time_step :: Step -> TimeStep
- event_step :: TimeStep
- from_list :: [Step] -> TimeStep
- to_list :: TimeStep -> [Step]
- modify_rank :: (Meter.Rank -> Meter.Rank) -> TimeStep -> TimeStep
- match_meter :: MarklistMatch
- event_edge :: TimeStep
- rank :: Meter.Rank -> TimeStep
- data Step
- data Tracks
- data MarklistMatch
- data Direction
- show_time_step :: TimeStep -> Text
- parse_time_step :: Text -> Either Text TimeStep
- show_direction :: Direction -> Text
- parse_rank :: Parse.Parser Meter.Rank
- snap :: Ui.M m => TimeStep -> BlockId -> TrackNum -> Maybe ScoreTime.TrackTime -> ScoreTime.TrackTime -> m ScoreTime.TrackTime
- step_from :: Ui.M m => Int -> TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime)
- rewind :: Ui.M m => TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime)
- advance :: Ui.M m => TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime)
- direction :: Direction -> Int
- duration_at :: Ui.M m => BlockId -> TrackNum -> ScoreTime.TrackTime -> TimeStep -> m (Maybe ScoreTime.ScoreTime)
- get_points_from :: Ui.M m => Direction -> BlockId -> TrackNum -> ScoreTime.TrackTime -> TimeStep -> m [ScoreTime.TrackTime]
TimeStep
A TimeStep is the union of a set of Steps.
event_step :: TimeStep Source #
Step to start and end of events.
modify_rank :: (Meter.Rank -> Meter.Rank) -> TimeStep -> TimeStep Source #
match_meter :: MarklistMatch Source #
Match on the meter marklist, which is the usual thing to do.
rank :: Meter.Rank -> TimeStep Source #
The possible matchers for a TimeStep.
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 |
Events of which tracks the event time step should use.
data MarklistMatch Source #
Instances
Show MarklistMatch Source # | |
Defined in Cmd.TimeStep showsPrec :: Int -> MarklistMatch -> ShowS # show :: MarklistMatch -> String # showList :: [MarklistMatch] -> ShowS # | |
Eq MarklistMatch Source # | |
Defined in Cmd.TimeStep (==) :: MarklistMatch -> MarklistMatch -> Bool # (/=) :: MarklistMatch -> MarklistMatch -> Bool # |
Another way to express a step_from
of 1 or -1.
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.
show_direction :: Direction -> Text Source #
step
:: Ui.M m | |
=> TimeStep | |
-> BlockId | |
-> TrackNum | |
-> Maybe ScoreTime.TrackTime | Last sel pos, needed to snap relative steps like
|
-> 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.
rewind :: Ui.M m => TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime) Source #
advance :: Ui.M m => TimeStep -> BlockId -> TrackNum -> ScoreTime.TrackTime -> m (Maybe ScoreTime.TrackTime) Source #
duration_at :: Ui.M m => BlockId -> TrackNum -> ScoreTime.TrackTime -> TimeStep -> m (Maybe ScoreTime.ScoreTime) Source #
get_points_from :: Ui.M m => Direction -> BlockId -> TrackNum -> ScoreTime.TrackTime -> TimeStep -> m [ScoreTime.TrackTime] Source #