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

Perform.Transport

Description

The transport is the communication mechanism between the app and the performer. Extensive description is in the Cmd.Play docstring.

Synopsis

info

data Status Source #

These go back to the responder loop from the render thread to notify it about the transport's state.

Constructors

Playing 
Stopped !PlayControl 

Instances

Instances details
Show Status Source # 
Instance details

Defined in Perform.Transport

Eq Status Source # 
Instance details

Defined in Perform.Transport

Methods

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

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

Pretty Status Source # 
Instance details

Defined in Perform.Transport

data Info Source #

Data needed by the MIDI player thread. This is created during app setup and passed directly to the play cmds by the responder loop. When the play is started, it's incorporated into the play State.

Constructors

Info 

Fields

play control

newtype PlayControl Source #

Communication from the responder to the players, to tell them to stop.

Constructors

PlayControl Thread.Flag 

Instances

Instances details
Show PlayControl Source # 
Instance details

Defined in Perform.Transport

Eq PlayControl Source # 
Instance details

Defined in Perform.Transport

stop_player :: PlayControl -> IO () Source #

Signal to the player that you'd like it to start stopping doing whatever it is that it's doing and just like stop now ok? Is that ok?

play monitor control

data ActivePlayers Source #

Number of active players, this goes to zero when they are all complete.

player_stopped :: ActivePlayers -> IO () Source #

Signal that a player has stopped.

poll_player_stopped :: Thread.Seconds -> ActivePlayers -> IO Bool Source #

True if all the players have stopped.

play timing

type TempoFunction = BlockId -> TrackId -> ScoreTime -> [RealTime] Source #

Given a score time on a certain track in a certain block, give the real times that it corresponds to. There may be more than one if the block has been derived in more than one place, and there may be zero if the block and track combination wasn't derived at all or didn't extend to the given score time.

type ClosestWarpFunction = BlockId -> TrackId -> RealTime -> Warp.Warp Source #

This is similar to TempoFunction but finds the warp for the given block that occurs closest to the given RealTime. Callers can use the warp to find multiple real times on that block.

TempoFunction simply returns all real times for a given score time, with no control over whether they come from the same block or not.

type InverseTempoFunction = Stop -> RealTime -> [(BlockId, [(TrackId, ScoreTime)])] Source #

Return the ScoreTime play position in the various playing blocks at the given physical time. If the RealTime is past the end of all playing blocks, return []. The play monitor thread polls this periodically for all displayed blocks and updates the play selection accordingly.

Since a given block may be playing in multiple places at the same time (e.g. for a block that is played like an instrument, if the notes overlap), the same BlockId may occur more than once in the output list.

data Stop Source #

Configure InverseTempoFunction. TODO think of better names

Constructors

StopAtEnd

Stop emitting ScoreTime as soon as the events on the block end. This is used by the play monitor, since I want it to stop as soon as the score is "over" visually.

NoStop

Keep emitting score time for all blocks. This is used to map from RealTime to ScoreTime for a particular block, regardless of the notes on it. E.g. Msg.ImProgress uses this because synthesis continues as long as the notes ring.

Instances

Instances details
Show Stop Source # 
Instance details

Defined in Perform.Transport

Methods

showsPrec :: Int -> Stop -> ShowS #

show :: Stop -> String #

showList :: [Stop] -> ShowS #

Eq Stop Source # 
Instance details

Defined in Perform.Transport

Methods

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

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