Sound.SC3.Server.Process
Description
This module includes utilities for spawning an external scsynth process, either for realtime or non-realtime execution.
- module Sound.SC3.Server.Process.Options
- class OpenTransport t where
- openTransport :: RTOptions -> String -> IO t
- data OutputHandler = OutputHandler {
- onPutString :: String -> IO ()
- onPutError :: String -> IO ()
- defaultOutputHandler :: OutputHandler
- withSynth :: (Transport t, OpenTransport t) => ServerOptions -> RTOptions -> OutputHandler -> (t -> IO a) -> IO a
- withNRT :: ServerOptions -> NRTOptions -> OutputHandler -> (Handle -> IO a) -> IO a
Documentation
class OpenTransport t whereSource
Helper class for polymorphic opening of network connections.
Methods
openTransport :: RTOptions -> String -> IO tSource
Open a transport to scsynth based on the given RTOptions and a hostname.
Instances
data OutputHandler Source
Handle output of external scsynth processes.
Constructors
| OutputHandler | |
Fields
| |
defaultOutputHandler :: OutputHandlerSource
Default IO handler, writing to stdout and stderr, respectively.
withSynth :: (Transport t, OpenTransport t) => ServerOptions -> RTOptions -> OutputHandler -> (t -> IO a) -> IO aSource
Execute a realtime instance of scsynth with Transport t.
The spawned scsynth is sent a /quit message after the supplied action
returns.
NOTE: When compiling executables with GHC, the -threaded option should
be passed, otherwise the I/O handlers will not work correctly.
withNRT :: ServerOptions -> NRTOptions -> OutputHandler -> (Handle -> IO a) -> IO aSource
Execute a non-realtime instance of scsynth and return ExitCode when
the process exists.