-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Create and control scsynth processes -- -- Create and control scsynth processes. @package hsc3-process @version 0.4.0 module Sound.SC3.Server.Options -- | Used with the verbosity field in ServerOptions. data Verbosity Silent :: Verbosity Quiet :: Verbosity Normal :: Verbosity Verbose :: Verbosity VeryVerbose :: Verbosity ExtremelyVerbose :: Verbosity -- | Specify general server options used both in realtime and non-realtime -- mode. data ServerOptions ServerOptions :: FilePath -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Bool -> Verbosity -> Maybe [FilePath] -> Maybe FilePath -> ServerOptions -- | Path to the scsynth program serverProgram :: ServerOptions -> FilePath -- | Number of allocated control bus channels numberOfControlBusChannels :: ServerOptions -> Int -- | Number of allocated audio bus channels numberOfAudioBusChannels :: ServerOptions -> Int -- | Number of physical input channels numberOfInputBusChannels :: ServerOptions -> Int -- | Number of physical output channels numberOfOutputBusChannels :: ServerOptions -> Int -- | Synthesis block size blockSize :: ServerOptions -> Int -- | Number of allocated sample buffers numberOfSampleBuffers :: ServerOptions -> Int -- | Maximum number of synthesis nodes maxNumberOfNodes :: ServerOptions -> Int -- | Maximum number of synth definitions maxNumberOfSynthDefs :: ServerOptions -> Int -- | Realtime memory size in bytes realtimeMemorySize :: ServerOptions -> Int -- | Number of unit generator connection buffers numberOfWireBuffers :: ServerOptions -> Int -- | Number of random number generator seeds numberOfRandomSeeds :: ServerOptions -> Int -- | If True, load synth definitions from synthdefs directory -- on startup loadSynthDefs :: ServerOptions -> Bool -- | Verbosity level verbosity :: ServerOptions -> Verbosity -- | List of UGen plugin search paths ugenPluginPath :: ServerOptions -> Maybe [FilePath] -- | Sandbox path to restrict OSC command filesystem access restrictedPath :: ServerOptions -> Maybe FilePath -- | Default server options. defaultServerOptions :: ServerOptions _serverProgram :: T ServerOptions FilePath _numberOfControlBusChannels :: T ServerOptions Int _numberOfAudioBusChannels :: T ServerOptions Int _numberOfInputBusChannels :: T ServerOptions Int _numberOfOutputBusChannels :: T ServerOptions Int _blockSize :: T ServerOptions Int _numberOfSampleBuffers :: T ServerOptions Int _maxNumberOfNodes :: T ServerOptions Int _maxNumberOfSynthDefs :: T ServerOptions Int _realtimeMemorySize :: T ServerOptions Int _numberOfWireBuffers :: T ServerOptions Int _numberOfRandomSeeds :: T ServerOptions Int _loadSynthDefs :: T ServerOptions Bool _verbosity :: T ServerOptions Verbosity _ugenPluginPath :: T ServerOptions (Maybe [FilePath]) _restrictedPath :: T ServerOptions (Maybe FilePath) -- | Realtime server options, parameterized by the OpenSoundControl -- Transport to be used. data RTOptions RTOptions :: Int -> Int -> Bool -> Int -> Maybe String -> Maybe String -> Int -> Int -> Maybe Int -> Maybe Int -> RTOptions -- | UDP port number (one of udpPortNumber and tcpPortNumber -- must be non-zero) udpPortNumber :: RTOptions -> Int -- | TCP port number (one of udpPortNumber and tcpPortNumber -- must be non-zero) tcpPortNumber :: RTOptions -> Int -- | If True, publish scsynth service through Zeroconf useZeroconf :: RTOptions -> Bool -- | Max number of supported logins if sessionPassword is set maxNumberOfLogins :: RTOptions -> Int -- | Session password Audio device control sessionPassword :: RTOptions -> Maybe String -- | Hardware device name (JACK client:server name on Linux) hardwareDeviceName :: RTOptions -> Maybe String -- | Hardware buffer size (no effect with JACK) hardwareBufferSize :: RTOptions -> Int -- | Hardware buffer size (no effect with JACK) hardwareSampleRate :: RTOptions -> Int -- | Enabled input streams (CoreAudio only) inputStreamsEnabled :: RTOptions -> Maybe Int -- | Enabled output streams (CoreAudio only) outputStreamsEnabled :: RTOptions -> Maybe Int -- | Default realtime server options. defaultRTOptions :: RTOptions -- | Default realtime server options (UDP transport). defaultRTOptionsUDP :: RTOptions -- | Default realtime server options (TCP transport). defaultRTOptionsTCP :: RTOptions _udpPortNumber :: T RTOptions Int _tcpPortNumber :: T RTOptions Int _useZeroconf :: T RTOptions Bool _maxNumberOfLogins :: T RTOptions Int _sessionPassword :: T RTOptions (Maybe String) _hardwareDeviceName :: T RTOptions (Maybe String) _hardwareBufferSize :: T RTOptions Int _hardwareSampleRate :: T RTOptions Int _inputStreamsEnabled :: T RTOptions (Maybe Int) _outputStreamsEnabled :: T RTOptions (Maybe Int) -- | Non-realtime server options. data NRTOptions NRTOptions :: Maybe FilePath -> Maybe FilePath -> FilePath -> Int -> String -> String -> NRTOptions -- | Path to OSC command file (Nothing for stdin) commandFilePath :: NRTOptions -> Maybe FilePath -- | Path to input sound file (Nothing for no audio input) inputFilePath :: NRTOptions -> Maybe FilePath -- | Path to output sound file outputFilePath :: NRTOptions -> FilePath -- | Output sound file sample rate outputSampleRate :: NRTOptions -> Int -- | Output sound file header format outputHeaderFormat :: NRTOptions -> String -- | Output sound file sample format outputSampleFormat :: NRTOptions -> String -- | Default non-realtime server options. defaultNRTOptions :: NRTOptions _commandFilePath :: T NRTOptions (Maybe FilePath) _inputFilePath :: T NRTOptions (Maybe FilePath) _outputFilePath :: T NRTOptions FilePath _outputSampleRate :: T NRTOptions Int _outputHeaderFormat :: T NRTOptions String _outputSampleFormat :: T NRTOptions String instance Eq NRTOptions instance Show NRTOptions instance Eq RTOptions instance Show RTOptions instance Eq Verbosity instance Read Verbosity instance Show Verbosity instance Eq ServerOptions instance Show ServerOptions instance Get_C Verbosity instance Enum Verbosity module Sound.SC3.Server.Process.CommandLine -- | Construct the scsynth command line from ServerOptions and -- RTOptions. rtCommandLine :: ServerOptions -> RTOptions -> [String] -- | Construct the scsynth command line from ServerOptions and -- NRTOptions. nrtCommandLine :: ServerOptions -> NRTOptions -> [String] mkOption :: a -> a -> String -> ToOption a -> Maybe (String, String) instance Option [FilePath] instance Option Verbosity instance Option a => Option (Maybe a) instance Option Bool instance Option Int instance Option String -- | This module includes utilities for spawning an external scsynth -- process, either for realtime or non-realtime execution. module Sound.SC3.Server.Process -- | Handle output of external scsynth processes. data OutputHandler OutputHandler :: (String -> IO ()) -> (String -> IO ()) -> OutputHandler -- | Handle one line of normal output onPutString :: OutputHandler -> String -> IO () -- | Handle one line of error output onPutError :: OutputHandler -> String -> IO () -- | Default IO handler, writing to stdout and stderr, respectively. defaultOutputHandler :: OutputHandler withTransport :: Transport t => (ServerOptions -> RTOptions -> IO t) -> ServerOptions -> RTOptions -> (t -> IO a) -> IO a -- | 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. withSynth :: Transport t => (ServerOptions -> RTOptions -> IO t) -> ServerOptions -> RTOptions -> OutputHandler -> (t -> IO a) -> IO a openTCP :: ServerOptions -> RTOptions -> IO TCP openUDP :: ServerOptions -> RTOptions -> IO UDP -- | Execute a non-realtime instance of scsynth and return -- ExitCode when the process exists. withNRT :: ServerOptions -> NRTOptions -> OutputHandler -> (Handle -> IO a) -> IO a -- | Read server options from configuraton file. module Sound.SC3.Server.Process.ConfigFile -- | Read server options, realtime options and non-relatime options from a -- ConfigParser. getOptions :: MonadError CPError m => ConfigParser -> SectionSpec -> m (ServerOptions, RTOptions, NRTOptions) -- | Convert server options and optionally realtime options and -- non-realtime options to an association list. setOptions :: MonadError CPError m => ConfigParser -> SectionSpec -> (ServerOptions, RTOptions, NRTOptions) -> m ConfigParser instance Get_C FilePathList instance Show FilePathList instance Get_C a => Get_C (MaybeConfig a) instance Show a => Show (MaybeConfig a) module Sound.SC3.Server.Internal data InternalTransport withInternal :: ServerOptions -> RTOptions -> OutputHandler -> (InternalTransport -> IO a) -> IO a instance Transport InternalTransport