Safe Haskell | Safe-Inferred |
---|
The transport is the communication mechanism between the app and the performer. Extensive description is in the Cmd.Play docstring.
Synopsis
- data Status
- data Info = Info {
- info_send_status :: Status -> IO ()
- info_midi_writer :: Interface.Message -> IO ()
- info_midi_abort :: IO ()
- info_get_current_time :: IO RealTime
- info_state :: MVar.MVar Ui.State
- newtype PlayControl = PlayControl Thread.Flag
- play_control :: IO PlayControl
- stop_player :: PlayControl -> IO ()
- poll_stop_player :: Thread.Seconds -> PlayControl -> IO Bool
- data ActivePlayers
- active_players :: IO ActivePlayers
- player_started :: ActivePlayers -> IO ()
- player_stopped :: ActivePlayers -> IO ()
- poll_player_stopped :: Thread.Seconds -> ActivePlayers -> IO Bool
- wait_player_stopped :: ActivePlayers -> IO ()
- type TempoFunction = BlockId -> TrackId -> ScoreTime -> [RealTime]
- type ClosestWarpFunction = BlockId -> TrackId -> RealTime -> Warp.Warp
- type InverseTempoFunction = Stop -> RealTime -> [(BlockId, [(TrackId, ScoreTime)])]
- data Stop
info
These go back to the responder loop from the render thread to notify it about the transport's state.
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
.
Info | |
|
play control
newtype PlayControl Source #
Communication from the responder to the players, to tell them to stop.
Instances
Show PlayControl Source # | |
Defined in Perform.Transport showsPrec :: Int -> PlayControl -> ShowS # show :: PlayControl -> String # showList :: [PlayControl] -> ShowS # | |
Eq PlayControl Source # | |
Defined in Perform.Transport (==) :: PlayControl -> PlayControl -> Bool # (/=) :: PlayControl -> PlayControl -> Bool # |
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?
poll_stop_player :: Thread.Seconds -> PlayControl -> IO Bool Source #
play monitor control
data ActivePlayers Source #
Number of active players, this goes to zero when they are all complete.
player_started :: ActivePlayers -> IO () Source #
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.
wait_player_stopped :: ActivePlayers -> IO () Source #
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.
Configure InverseTempoFunction
. TODO think of better names
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. |