Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone



The FFI-using part of Cmd.Play. It uses the FFI because the play monitor wants to directly call to the UI to update the playback indicator, which is much more efficient than going through the whole Ui.Diff thing.

But that means Cmd.Play would import FFI-using modules, which causes a problem for ghci, and, since I want the Cmd.Play functions to be available there, for the REPL as well. So I engage in a hack: the play cmd returns a special Cmd.PlayMidi value which contains the arguments for the play monitor thread. The responder treats it as a Done but will call play with the given args.

Actually since I have *Stub modules now I think this hack is no longer needed. But I'll leave it in place for now since it doesn't seem to be hurting anything and it's nice to divide play into low and high level.



cmd_play_msg :: Channel -> Msg.Msg -> Cmd.CmdT IO Cmd.Status Source #

Respond to msgs about derivation and playing status.

play :: Channel -> Ui.State -> Transport.Info -> Cmd.PlayMidiArgs -> IO Transport.PlayControl Source #

This actually kicks off a MIDI play thread, and if an inverse tempo function is given, a play monitor thread.