libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::SCLang Class Reference

#include <SCLang.hpp>

Static Public Member Functions

static void BootServer ()
 
static void DebugQueryInstalled ()
 
static LateReturn InstallTemplate (const std::shared_ptr< ModuleTemplate > templ)
 
static bool IsRunning ()
 
static void PollOSC ()
 
static void PollSubprocess ()
 
static void QueryAllNodes ()
 
static int RegisterSendReply (int synth_id, std::weak_ptr< SendReplyController >)
 
static void Restart ()
 
static void SendInstruction (std::string instr)
 
static void Start ()
 
static void Stop ()
 
static void StopServer ()
 
static void UnregisterSendReply (int synth_id, int reply_id)
 
static bool WasInstalled (const std::string &id)
 
static void SetOSCDebug (bool enabled)
 
static void SendOSC (const std::string &path)
 
static void SendOSC (const std::string &path, std::string tag,...)
 
static void SendOSCCustom (const std::string &path, const lo::Message &m)
 
static LateReturn< lo::Message > SendOSCWithLOReply (const std::string &path)
 
static LateReturn< lo::Message > SendOSCWithLOReply (const std::string &path, std::string tag,...)
 
static LateReturn< lo::Message > SendOSCCustomWithLOReply (const std::string &path, const lo::Message &m)
 
template<typename... Q, typename... Rest>
static LateReturn< Q...> SendOSCWithReply (const std::string &path, Rest...args)
 
template<typename... Q>
static LateReturn< Q...> SendOSCCustomWithReply (const std::string &path, const lo::Message &m)
 
template<typename... Rest>
static LateReturn SendOSCWithEmptyReply (const std::string &path, Rest...args)
 

Static Public Attributes

static Signal< std::string > on_line_received
 
static Signal< MidiMessageon_midi_message_received
 
static Signal< bool > on_server_started
 
static Signal< bool, std::string > on_start_completed
 
static Signal< int, std::string > on_start_progress
 
static bool ready
 

Detailed Description

The static interface to a single global sclang process. Manages all interaction with the SuperCollider instance, including intepteter starting and halting, server configuration and booting, OSC messaging.

Member Function Documentation

static void AlgAudio::SCLang::BootServer ( )
static

Boots the supercollider server. Uses global configuration.

See also
Config
static void AlgAudio::SCLang::DebugQueryInstalled ( )
static

Writes the list of all templates that were installed to stdout.

static LateReturn AlgAudio::SCLang::InstallTemplate ( const std::shared_ptr< ModuleTemplate templ)
static

Performs SC synth template (SynthDef) installation on the server.

static bool AlgAudio::SCLang::IsRunning ( )
inlinestatic

Returns true iff SuperCollider was started and is ready to work.

static void AlgAudio::SCLang::PollOSC ( )
static

This function will process any incoming OSC data. It shall be called only by the main thread. The main thread is notified about awaiting data by an SDL_UserEvent send to the main queue. It then calls this method, which in turn triggers all signals and callbacks that waited for OSC events.

static void AlgAudio::SCLang::PollSubprocess ( )
static

This function will process any subprocess output. It shall be called only by the main thread. The main thread is notified about awaiting data by an SDL_UserEvent send to the main queue. It then calls this method, which in turn triggers all signals and callbacks that waited for sclang subprocess output.

static void AlgAudio::SCLang::QueryAllNodes ( )
static

Asks SuperCollider to s.QueryAllNodes. sclang subprocess will then print out a graph of active synths and groups hierarchy - useful for debugging. Observe on_line_received for result.

static int AlgAudio::SCLang::RegisterSendReply ( int  synth_id,
std::weak_ptr< SendReplyController  
)
static

Returns the new reply id the catcher will use. Afterwards one should set the SC Synth's arg to that returned value, so that it will start sending replies with the right id.

static void AlgAudio::SCLang::Restart ( )
static

Reboots SuperCollider.

static void AlgAudio::SCLang::SendInstruction ( std::string  instr)
static

Passes a text instruction to sclang subprocess via its stdin.

Parameters
instrThe instruction to send.
static void AlgAudio::SCLang::SendOSC ( const std::string &  path)
static

Various functions and type templates for OSC communication.

static void AlgAudio::SCLang::SendOSC ( const std::string &  path,
std::string  tag,
  ... 
)
static

Various functions and type templates for OSC communication.

static void AlgAudio::SCLang::SendOSCCustom ( const std::string &  path,
const lo::Message &  m 
)
static

Various functions and type templates for OSC communication.

static LateReturn<lo::Message> AlgAudio::SCLang::SendOSCCustomWithLOReply ( const std::string &  path,
const lo::Message &  m 
)
static

Various functions and type templates for OSC communication.

template<typename... Q>
LateReturn< Q...> AlgAudio::SCLang::SendOSCCustomWithReply ( const std::string &  path,
const lo::Message &  m 
)
inlinestatic

Various functions and type templates for OSC communication.

template<typename... Rest>
LateReturn AlgAudio::SCLang::SendOSCWithEmptyReply ( const std::string &  path,
Rest...  args 
)
inlinestatic

Various functions and type templates for OSC communication.

static LateReturn<lo::Message> AlgAudio::SCLang::SendOSCWithLOReply ( const std::string &  path)
static

Various functions and type templates for OSC communication.

static LateReturn<lo::Message> AlgAudio::SCLang::SendOSCWithLOReply ( const std::string &  path,
std::string  tag,
  ... 
)
static

Various functions and type templates for OSC communication.

template<typename... Q, typename... Rest>
LateReturn< Q...> AlgAudio::SCLang::SendOSCWithReply ( const std::string &  path,
Rest...  args 
)
inlinestatic

Various functions and type templates for OSC communication.

static void AlgAudio::SCLang::SetOSCDebug ( bool  enabled)
static

Various functions and type templates for OSC communication.

static void AlgAudio::SCLang::Start ( )
static

Launches SuperCollider. Starts the interpreter, prepares connection, boots the server etc. Uses the configuration from global config.

See also
Config
static void AlgAudio::SCLang::Stop ( )
static

Stops SuperCollider, closing the interpreter and stopping the subprocess.

static void AlgAudio::SCLang::StopServer ( )
static

Quits the supercollider server.

static void AlgAudio::SCLang::UnregisterSendReply ( int  synth_id,
int  reply_id 
)
static

Unregisters a sendreply catcher that was previously created with RegisterSendReply().

static bool AlgAudio::SCLang::WasInstalled ( const std::string &  id)
static

Returns true iff the template was already installed in the server.

Parameters
idThe template id.

Member Data Documentation

Signal<std::string> AlgAudio::SCLang::on_line_received
static

Happens once for each line of sclang subprocess stdout.

Signal<MidiMessage> AlgAudio::SCLang::on_midi_message_received
static

Happens whenever sclang receives some MIDI event.

Signal<bool> AlgAudio::SCLang::on_server_started
static

Happens when the SC server started. Carries bool marking whether the start was successful.

Signal<bool, std::string> AlgAudio::SCLang::on_start_completed
static

Happens when Start completes. Carries bool marking whether the start was sucessful, if not, the string contains an error message.

Signal<int,std::string> AlgAudio::SCLang::on_start_progress
static

Happens multiple times during start process. Each time it carries a number which increases during the start procedure (this is intended for progressbars), and a string with current status message,

bool AlgAudio::SCLang::ready
static

True if the supercollider subprocess is ready to work.


The documentation for this class was generated from the following file: