Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bseengine.hh File Reference
#include <bse/bsedefs.hh>
Include dependency graph for bseengine.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BseModuleClass
 
struct  BseModule
 
struct  BseJStream
 
struct  BseIStream
 
struct  BseOStream
 
struct  BseEngineLoop
 

Macros

#define BSE_STREAM_MAX_VALUES
 
#define BSE_MODULE_N_OSTREAMS(module)
 
#define BSE_MODULE_N_ISTREAMS(module)
 
#define BSE_MODULE_N_JSTREAMS(module)
 
#define BSE_MODULE_ISTREAM(module, stream)
 
#define BSE_MODULE_JSTREAM(module, stream)
 
#define BSE_MODULE_OSTREAM(module, stream)
 
#define BSE_MODULE_IBUFFER(module, stream)
 
#define BSE_MODULE_JBUFFER(module, stream, con)
 
#define BSE_MODULE_OBUFFER(module, stream)
 
#define BSE_ENGINE_MAX_POLLFDS
 
#define bse_engine_block_size()
 
#define bse_engine_sample_freq()
 
#define bse_engine_control_raster()
 
#define bse_engine_control_mask()
 
#define BSE_CONTROL_CHECK(index)
 

Typedefs

typedef gboolean(* BseEnginePollFunc) (gpointer data, guint n_values, glong *timeout_p, guint n_fds, const GPollFD *fds, gboolean revents_filled)
 
typedef gboolean(* BseEngineTimerFunc) (gpointer data, guint64 tick_stamp)
 
typedef void(* BseEngineProbeFunc) (gpointer data, guint n_values, guint64 tick_stamp, guint n_ostreams, BseOStream **ostreams_p)
 
typedef void(* BseProcessFunc) (BseModule *module, guint n_values)
 
typedef guint(* BseProcessDeferFunc) (BseModule *module, guint n_ivalues, guint n_ovalues)
 
typedef void(* BseModuleResetFunc) (BseModule *module)
 
typedef void(* BseModuleFreeFunc) (gpointer data, const BseModuleClass *klass)
 

Enumerations

enum  BseCostType { BSE_COST_NORMAL, BSE_COST_CHEAP, BSE_COST_EXPENSIVE }
 

Functions

BseModule * bse_module_new (const BseModuleClass *klass, gpointer user_data)
 
BseModule * bse_module_new_virtual (guint n_iostreams, gpointer user_data, BseFreeFunc free_data)
 
guint64 bse_module_tick_stamp (BseModule *module)
 
gboolean bse_module_has_source (BseModule *module, guint istream)
 
gboolean bse_module_is_scheduled (BseModule *module)
 
BseJob * bse_job_connect (BseModule *src_module, guint src_ostream, BseModule *dest_module, guint dest_istream)
 
BseJob * bse_job_jconnect (BseModule *src_module, guint src_ostream, BseModule *dest_module, guint dest_jstream)
 
BseJob * bse_job_disconnect (BseModule *dest_module, guint dest_istream)
 
BseJob * bse_job_jdisconnect (BseModule *dest_module, guint dest_jstream, BseModule *src_module, guint src_ostream)
 
BseJob * bse_job_kill_inputs (BseModule *module)
 
BseJob * bse_job_kill_outputs (BseModule *module)
 
BseJob * bse_job_integrate (BseModule *module)
 
BseJob * bse_job_discard (BseModule *module)
 
BseJob * bse_job_force_reset (BseModule *module)
 
BseJob * bse_job_set_consumer (BseModule *module, gboolean is_toplevel_consumer)
 
BseJob * bse_job_suspend_now (BseModule *module)
 
BseJob * bse_job_resume_at (BseModule *module, guint64 tick_stamp)
 
BseJob * bse_job_debug (const gchar *debug)
 
BseJob * bse_job_nop (void)
 
BseJob * bse_job_add_poll (BseEnginePollFunc poll_func, gpointer data, BseFreeFunc free_func, guint n_fds, const GPollFD *fds)
 
BseJob * bse_job_remove_poll (BseEnginePollFunc poll_func, gpointer data)
 
BseJob * bse_job_add_timer (BseEngineTimerFunc timer_func, gpointer data, BseFreeFunc free_func)
 
BseJob * bse_job_access (BseModule *module, BseEngineAccessFunc access_func, gpointer data, BseFreeFunc free_func)
 
BseJob * bse_job_probe_request (BseModule *module, BseEngineProbeFunc probe, gpointer data)
 
BseJob * bse_job_flow_access (BseModule *module, guint64 tick_stamp, BseEngineAccessFunc access_func, gpointer data, BseFreeFunc free_func)
 
BseJob * bse_job_boundary_access (BseModule *module, guint64 tick_stamp, BseEngineAccessFunc access_func, gpointer data, BseFreeFunc free_func)
 
BseJob * bse_job_boundary_discard (BseModule *module)
 
BseTrans * bse_trans_open (void)
 
void bse_trans_add (BseTrans *trans, BseJob *job)
 
BseTrans * bse_trans_merge (BseTrans *trans1, BseTrans *trans2)
 
guint64 bse_trans_commit (BseTrans *trans)
 
void bse_trans_commit_delayed (BseTrans *trans, guint64 tick_stamp)
 
void bse_trans_dismiss (BseTrans *trans)
 
void bse_transact (BseJob *job,...) G_GNUC_NULL_TERMINATED
 
floatbse_engine_const_values (float value)
 
void bse_engine_constrain (guint latency_ms, guint sample_freq, guint control_freq, guint *block_size_p, guint *control_raster_p)
 
void bse_engine_init ()
 
gboolean bse_engine_configure (guint latency_ms, guint sample_freq, guint control_freq)
 
floatbse_engine_const_zeros (uint smaller_than_BSE_STREAM_MAX_VALUES)
 
gboolean bse_engine_has_garbage (void)
 
void bse_engine_user_thread_collect (void)
 
void bse_engine_free_ostreams (guint n_ostreams, BseOStream *ostreams)
 
void bse_engine_add_user_callback (gpointer data, BseFreeFunc free_func)
 
void bse_engine_wait_on_trans (void)
 
guint64 bse_engine_tick_stamp_from_systime (guint64 systime)
 
gboolean bse_engine_prepare (BseEngineLoop *loop)
 
gboolean bse_engine_check (const BseEngineLoop *loop)
 
void bse_engine_dispatch (void)
 

Variables

uint bse_engine_exvar_block_size
 
uint bse_engine_exvar_sample_freq
 
uint bse_engine_exvar_control_mask
 

Typedef Documentation

BseEnginePollFunc
Parameters
dataData of poll function
n_valuesMinimum number of values the engine wants to process
timeout_pLocation of timeout value
n_fdsNumber of file descriptors used for polling
fdsFile descriptors to be used for polling
revents_filledIndicates whether fds actually have their ->revents field filled with valid data.
Returns
A boolean value indicating whether the engine should process data right now

The BseEnginePollFunc is a user supplied callback function which can be hooked into the BSE Engine. The engine uses the poll functions to determine whether processing of n_values in its module network is necessary. In order for the poll functions to react to extern events, such as device driver status changes, the engine will poll(2) the fds of the poll function and invoke the callback with revents_filled == TRUE if any of its fds changed state. The callback may also be invoked at other random times with revents_filled = FALSE. It is supposed to return TRUE if network processing is currently necessary, and FALSE if not. If FALSE is returned, timeout_p may be filled with the number of milliseconds the engine should use for polling at maximum.

BseEngineProbeFunc
Parameters
datauser data passed in to bse_job_probe_request()
n_valuesnumber of values probed
tick_stampengine time in microseconds of the probe
n_ostreamsnumber of ostreams of the module
ostreams_plocation of a pointer to the probed ostream array

A BseEngineProbeFunc() is provided by users as a means to be notified about a completed probe. This function is executed in the user thread. The complete set of output streams and associated output values is provided by n_ostreams and ostreams_p. For intermediate user thread processing, the set can be "stolen" in the probe callback by assigning NULL to *ostreams_p. In this case, the set has to later be freed with bse_engine_free_ostreams(). Note that output streams with FALSE connected flags will not contain valid data in their value blocks.

Function Documentation

void bse_engine_add_user_callback ( gpointer  data,
BseFreeFunc  free_func 
)
Parameters
dataData passed in to the free_func
free_funcFunction to free data (executed in user thread)

Queues data to be collected by bse_engine_user_thread_collect(), so free_func() will be called with data as argument during the next garbage collection cycle in the user thread. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

gboolean bse_engine_configure ( guint  latency_ms,
guint  sample_freq,
guint  control_freq 
)
Parameters
latency_mscalculation latency in milli seconds
sample_freqmixing frequency
control_freqfrequency at which to check control values or 0
Returns
whether reconfiguration was successful

Reconfigure engine parameters. This function may only be called after engine initialization and can only succeed if no modules are currently integrated.

Referenced by bse_engine_init(), and bse_server_script_error().

Here is the call graph for this function:

Here is the caller graph for this function:

void bse_engine_constrain ( guint  latency_ms,
guint  sample_freq,
guint  control_freq,
guint *  block_size_p,
guint *  control_raster_p 
)
Parameters
latency_mscalculation latency in milli seconds
sample_freqmixing frequency
control_freqfrequency at which to check control values or 0
block_size_plocation of number of values to process block wise
control_raster_plocation of number of values to skip between control values

Calculate a suitable block size and control raster for a sample_freq at a specific latency_ms (the latency should be > 0). The control_freq if specified should me much smaller than the sample_freq. It determines how often control values are to be checked when calculating blocks of sample values. The block size determines the amount by which the global tick stamp (see Bse::TickStamp::current()) is updated everytime the whole module network completed processing block size values. This function is MT-safe and may be called prior to engine initialization.

Referenced by bse_engine_configure(), and bse_server_get().

Here is the caller graph for this function:

void bse_engine_dispatch ( void  )

Perform necessary work the engine has to handle in the user thread.

This function may only be called from the user thread, since it will invoke BseFreeFunc() functions (see bse_engine_user_thread_collect()) and do other things which are guranteed to be executed in the user thread.

Referenced by bse_server_script_error().

Here is the call graph for this function:

Here is the caller graph for this function:

void bse_engine_init ( )

Initialize the BSE audio processing engine.

This function must be called prior to any other engine related function and can only be invoked once.

Referenced by bse_server_script_error().

Here is the call graph for this function:

Here is the caller graph for this function:

guint64 bse_engine_tick_stamp_from_systime ( guint64  systime)
Parameters
systimeSystem time in micro seconds.
Returns
Engine tick stamp value

Depending on the engine's sample frequency and the time of the last global tick stamp update, calculate the corresponding engine tick stamp from a given system time. This function is MT-safe and may be called from any thread.

Referenced by Bse::ServerImpl::register_source_module().

Here is the call graph for this function:

Here is the caller graph for this function:

void bse_engine_user_thread_collect ( void  )

BSE Engine user thread function.

Collects processed jobs and transactions from the engine and frees them. This involves callback invocation of BseFreeFunc() functions, e.g. from bse_job_access() or bse_job_flow_access() jobs. This function may only be called from the user thread, as BseFreeFunc() functions are guranteed to be executed in the user thread.

Referenced by bse_engine_configure(), bse_engine_dispatch(), bse_engine_wait_on_trans(), and bse_server_script_error().

Here is the call graph for this function:

Here is the caller graph for this function:

void bse_engine_wait_on_trans ( void  )

Wait until all pending transactions have been processed by the BSE Engine.

This function, when done waiting, will run a garbage collection cycle before returning. See bse_engine_user_thread_collect(), the same restrictions apply to invokations of this function.

Referenced by bse_engine_configure(), and bse_server_get().

Here is the call graph for this function:

Here is the caller graph for this function:

BseJob* bse_job_access ( BseModule *  module,
BseEngineAccessFunc  access_func,
gpointer  data,
BseFreeFunc  free_func 
)
Parameters
moduleThe module to access
access_funcThe accessor function (executed in master thread)
dataData passed in to the accessor
free_funcFunction to free data (executed in user thread)
Returns
New job suitable for bse_trans_add()

Create a new transaction job which will invoke access_func on module with data when the transaction queue is processed to modify the module's state. This function is MT-safe and may be called from any thread.

BseJob* bse_job_add_poll ( BseEnginePollFunc  poll_func,
gpointer  data,
BseFreeFunc  free_func,
guint  n_fds,
const GPollFD *  fds 
)
Parameters
poll_funcPoll function to add
dataData of poll function
free_funcFunction to free data
n_fdsNumber of poll file descriptors
fdsFile descriptors to select(2) or poll(2) on
Returns
New job suitable for bse_trans_add()

Create a new transaction job which adds a poll function to the engine. The poll function is used by the engine to determine whether processing is currently necessary. This function is MT-safe and may be called from any thread.

BseJob* bse_job_add_timer ( BseEngineTimerFunc  timer_func,
gpointer  data,
BseFreeFunc  free_func 
)
Parameters
timer_funcTimer function to add
dataData of timer function
free_funcFunction to free data
Returns
New job suitable for bse_trans_add()

Create a new transaction job which adds a timer function to the engine. The timer function is called after the engine caused new tick stamp updates. This function is MT-safe and may be called from any thread.

Referenced by bse_trans_commit_delayed().

Here is the caller graph for this function:

BseJob* bse_job_boundary_access ( BseModule *  module,
guint64  tick_stamp,
BseEngineAccessFunc  access_func,
gpointer  data,
BseFreeFunc  free_func 
)
Parameters
moduleThe module to access
tick_stampEngine time stamp
access_funcThe accessor function
dataData passed in to the accessor
free_funcFunction to free data
Returns
New job suitable for bse_trans_add()

Create a new transaction job which inserts access_func with data into the boundary job queue of module. Boundary jobs are executed at block boundaries, after all ordinary jobs have been processed and before global time stamp counter passed tick_stamp. Boundary jobs queued for executaion after a node's destruction will not be executed but destroyed together with the node. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

BseJob* bse_job_boundary_discard ( BseModule *  module)
Parameters
moduleThe module to access
Returns
New job suitable for bse_trans_add()

Discard module at block boundaries, after all ordinary jobs have been processed. This job type should be used instead of jobs from bse_job_discard() in situations where queueing of past-discard jobs before the next block boundary is hard to avoid (such as queing disconnection/suspend jobs from within process()). This function is MT-safe and may be called from any thread.

BseJob* bse_job_connect ( BseModule *  src_module,
guint  src_ostream,
BseModule *  dest_module,
guint  dest_istream 
)
Parameters
src_moduleModule with output stream
src_ostreamIndex of output stream of src_module
dest_moduleModule with unconnected input stream
dest_istreamIndex of input stream of dest_module
Returns
New job suitable for bse_trans_add()

Create a new transaction job which connects the ouput stream src_ostream of module src_module to the input stream dest_istream of module dest_module (it is an error if the input stream is already connected by the time the job is executed). This function is MT-safe and may be called from any thread.

Referenced by bse_snet_intern_child(), and bse_sub_synth_set_null_shortcut().

Here is the caller graph for this function:

BseJob* bse_job_debug ( const gchar *  debug)
Parameters
debugDebug message
Returns
New job suitable for bse_trans_add()

Create a new transaction job which issues debug message when the job is executed. This function is meant for debugging purposes during development phase only and shouldn't be used in production code. This function is MT-safe and may be called from any thread.

Referenced by bse_module_new_virtual().

Here is the caller graph for this function:

BseJob* bse_job_discard ( BseModule *  module)
Parameters
moduleThe module to discard
Returns
New job suitable for bse_trans_add()

Create a new transaction job which removes module from the engine and destroys it. This function is MT-safe and may be called from any thread.

Referenced by bse_job_boundary_access().

Here is the caller graph for this function:

BseJob* bse_job_disconnect ( BseModule *  dest_module,
guint  dest_istream 
)
Parameters
dest_moduleModule with connected input stream
dest_istreamIndex of input stream of dest_module
Returns
New job suitable for bse_trans_add()

Create a new transaction job which causes the input stream dest_istream of dest_module to be disconnected (it is an error if the input stream isn't connected by the time the job is executed). This function is MT-safe and may be called from any thread.

Referenced by bse_snet_intern_child().

Here is the caller graph for this function:

BseJob* bse_job_flow_access ( BseModule *  module,
guint64  tick_stamp,
BseEngineAccessFunc  access_func,
gpointer  data,
BseFreeFunc  free_func 
)
Parameters
moduleThe module to access
tick_stampEngine time stamp
access_funcThe accessor function
dataData passed in to the accessor
free_funcFunction to free data
Returns
New job suitable for bse_trans_add()

Create a new transaction job which inserts access_func with data into the flow job queue of module. Flow jobs are jobs with limited impact on modules, which are executed during flow system progress at specific times. Once the time stamp counter of module passed tick_stamp, access_func is called to modify the module's state. Flow jobs queued for executaion after a node's destruction will not be executed but destroyed together with the node. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

BseJob* bse_job_force_reset ( BseModule *  module)
Parameters
moduleThe module to be reset
Returns
New job suitable for bse_trans_add()

Forces a reset of module before its next call to process(), if its class provides a reset() implementation. This is usually not a good idea, as forcing an immediate reset can lead to multiple unnecessary reset() invocations. The logic used to invoke reset() automatically is usually good enough to cover all required cases. This function is MT-safe and may be called from any thread.

BseJob* bse_job_integrate ( BseModule *  module)
Parameters
moduleThe module to integrate
Returns
New job suitable for bse_trans_add()

Create a new transaction job to integrate module into the engine. This function is MT-safe and may be called from any thread.

Referenced by bse_sub_synth_set_null_shortcut().

Here is the caller graph for this function:

BseJob* bse_job_jconnect ( BseModule *  src_module,
guint  src_ostream,
BseModule *  dest_module,
guint  dest_jstream 
)
Parameters
src_moduleModule with output stream
src_ostreamIndex of output stream of src_module
dest_moduleModule with unconnected joint input stream
dest_jstreamIndex of joint input stream of dest_module
Returns
New job suitable for bse_trans_add()

Create a new transaction job which connects the ouput stream src_ostream of module src_module to the joint input stream dest_istream of module dest_module. This function is MT-safe and may be called from any thread.

BseJob* bse_job_jdisconnect ( BseModule *  dest_module,
guint  dest_jstream,
BseModule *  src_module,
guint  src_ostream 
)
Parameters
dest_moduleModule with connected input stream
dest_jstreamIndex of input stream of dest_module
src_moduleModule with output stream
src_ostreamIndex of output stream of src_module
Returns
New job suitable for bse_trans_add()

Create a new transaction job which causes the joint input stream dest_jstream of dest_module to be disconnected from the output stream src_ostream of src_module (it is an error if this connection isn't established by the time the job is executed). Beware, the order of dest_module and src_module is different from bse_job_jconnect(). This function is MT-safe and may be called from any thread.

BseJob* bse_job_kill_inputs ( BseModule *  module)
Parameters
moduleModule with input streams
Returns
New job suitable for bse_trans_add()

Create a new transaction job which causes all connected input streams of module to be disconnected, like it's done upon discarding the module. This function is MT-safe and may be called from any thread.

BseJob* bse_job_kill_outputs ( BseModule *  module)
Parameters
moduleModule with output streams
Returns
New job suitable for bse_trans_add()

Create a new transaction job which causes all connected output streams of module to be disconnected, like it's done upon discarding the module. This function is MT-safe and may be called from any thread.

BseJob* bse_job_nop ( void  )
Returns
New job suitable for bse_trans_add()

Create a new transaction job which does nothing. The job enforces a roundtrip to the engine's master thread however, which may be relevant when comitting otherwise empty transactions and calling bse_engine_wait_on_trans(). This function is MT-safe and may be called from any thread.

BseJob* bse_job_probe_request ( BseModule *  module,
BseEngineProbeFunc  probe_func,
gpointer  data 
)
Parameters
moduleThe module to access
probe_funcFunction invoked with data in the user thread
dataData passed in to the accessor
Returns
New job suitable for bse_trans_add()

Create a new transaction job which inserts probe_func with data into the job queue of module. Probe jobs are jobs which collect data from the output channels of a module as probe data. The job then returns to the user thread before the next block boundary, and probe_func() will be invoked as early as possible. There's no free_func() supplied to delete data, because such a function would always be called immediately after probe_func(). So instead, any data specific release handling should be integrated into probe_func(). For multiple probe jobs enqueued on a module simultaneously, no ordering is preserved. This function is MT-safe and may be called from any thread.

BseJob* bse_job_remove_poll ( BseEnginePollFunc  poll_func,
gpointer  data 
)
Parameters
poll_funcPoll function to remove
dataData of poll function
Returns
New job suitable for bse_trans_add()

Create a new transaction job which removes a previously inserted poll function from the engine. This function is MT-safe and may be called from any thread.

BseJob* bse_job_resume_at ( BseModule *  module,
guint64  tick_stamp 
)
Parameters
moduleModule to resume
tick_stampSample tick at which to resume module
Returns
New job suitable for bse_trans_add()

Create a new transaction job which inserts a resumption event into the job queue of module. Once the time stamp counter of module passed tick_stamp, if it is supended, its reset() method is called and the module is resumed, causing it's process() method to be called again. Resuming a module also resumes all input modules it has, unless those were explicitely suspended via bse_job_suspend_now(). This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

BseJob* bse_job_suspend_now ( BseModule *  module)
Parameters
moduleModule not currently suspended
Returns
New job suitable for bse_trans_add()

Create a new transaction job which suspends the module and all it's input modules which don't have other non-suspended output connections. Suspension of a module prevents it's process() method from being called, it's outputs are simply filled with zero's instead. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

gboolean bse_module_has_source ( BseModule *  module,
guint  istream 
)
Parameters
modulea BSE Engine Module
istreamIndex of input stream
Returns
whether the module has a possible input

Check whether istream may be disconnected via bse_job_disconnect(). This is not an indication for whether BSE_MODULE_ISTREAM (module, istream).connected will be TRUE during process(), as the source may be a dangling virtual module, resulting in BSE_MODULE_ISTREAM (module, istream).connected being FALSE. See also bse_module_new_virtual(). This function is MT-safe and may be called from any thread.

gboolean bse_module_is_scheduled ( BseModule *  module)
Parameters
modulea BSE Engine Module
Returns
whether the module is scheduled

Check whether module is part of the schedule required to calculate the signal flow up to the consumer modules. This state may frequently change with for instance connection changes of other modules. This function is MT-safe and may be called from any thread.

BseModule* bse_module_new ( const BseModuleClass *  klass,
gpointer  user_data 
)
Parameters
klassthe BseModuleClass which determines the module's behaviour
user_datauser data pointer
Returns
a newly created module

Create a new module with methods specified in klass and a user_data field set to user_data. The returned module can then be integrated into the engine with bse_job_integrate(). This function is MT-safe and may be called from any thread.

Referenced by bse_module_new_virtual().

Here is the call graph for this function:

Here is the caller graph for this function:

BseModule* bse_module_new_virtual ( guint  n_iostreams,
gpointer  user_data,
BseFreeFunc  free_data 
)
Parameters
n_iostreamsnumber of input and output streams
user_datauser data, stored in module->user_data
free_datafunction to free user_data when the module is discarded
Returns
a newly created module

Create a new virtual module which has n_iostreams input streams and n_iostreams output streams. Simply put, virtual modules just pass all input stream signals through to the corresponsding output stream. However, they are cheaper to compute than a literal module implementation that just passes through all data in its progress() method, because the connections can be virtualized in a connection optimization stage during scheduling, so that they don't end up in the list of modules which need to be processed during calculation phase. Beware though, flow jobs may not be scheduled on virtual modules (thusly, suspend jobs cannot be queued on them either), as virtual modules are ignored during calculation phase. They do, however, work just like ordinary modules with regards to suspension propagation, so the suspension state from output modules does only propagate across the virtual module to its input modules, if all its outputs are suspended. Instead of a single virtual module with multiple input/output streams, multiple virtual modules can be used if suspension is desired to propagate per stream. This function is MT-safe and may be called from any thread.

Referenced by bse_sub_synth_set_null_shortcut().

Here is the call graph for this function:

Here is the caller graph for this function:

guint64 bse_module_tick_stamp ( BseModule *  module)
Parameters
modulea BSE Engine Module
Returns
the module's tick stamp, indicating its process status

Any thread may call this function on a valid engine module. The module specific tick stamp is updated to Bse::TickStamp::current() + n_values every time its BseProcessFunc() function was called. See also Bse::TickStamp::current(). This function is MT-safe and may be called from any thread.

void bse_trans_add ( BseTrans *  trans,
BseJob *  job 
)
Parameters
transOpened transaction
jobJob to add

Append a job to an opened transaction. This function is MT-safe and may be called from any thread.

Referenced by bse_engine_add_user_callback(), bse_engine_configure(), bse_job_boundary_access(), bse_module_new_virtual(), bse_snet_intern_child(), bse_sub_synth_set_null_shortcut(), bse_trans_commit_delayed(), and bse_transact().

Here is the caller graph for this function:

guint64 bse_trans_commit ( BseTrans *  trans)
Parameters
transopen transaction
Returns
tick stamp of job execution

Close the transaction and commit it to the engine. The engine will execute the jobs contained in this transaction as soon as it has completed its current processing cycle, at which point Bse::TickStamp::current() matches the returned tick stamp. The jobs will be executed in the exact order they were added to the transaction. This function is MT-safe and may be called from any thread.

Referenced by bse_engine_configure(), bse_job_boundary_access(), bse_module_new_virtual(), bse_server_get(), bse_sub_synth_set_null_shortcut(), bse_trans_commit(), bse_trans_commit_delayed(), and bse_transact().

Here is the call graph for this function:

Here is the caller graph for this function:

void bse_trans_commit_delayed ( BseTrans *  trans,
guint64  tick_stamp 
)
Parameters
transopen transaction
tick_stampearliest stamp

Commit the transaction like bse_trans_commit(), but make sure that the commit happens no earlier than tick_stamp. This function will block until the commit occoured, so it will not return any earlier than tick_stamp. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

void bse_trans_dismiss ( BseTrans *  trans)
Parameters
transOpened transaction

Close and discard the transaction, causes destruction of all jobs currently contained in it and prevents their execution. This function is MT-safe and may be called from any thread.

Referenced by bse_engine_add_user_callback(), bse_trans_commit(), and bse_trans_merge().

Here is the caller graph for this function:

BseTrans* bse_trans_merge ( BseTrans *  trans1,
BseTrans *  trans2 
)
Parameters
trans1open transaction
trans2open transaction
Returns
open transaction trans1

Merge two open transactions by appending the jobs of trans2 to the jobs of trans1, returning the resulting transaction. The empty transaction trans2 will be dismissed after the merge. This function is MT-safe and may be called from any thread.

Here is the call graph for this function:

BseTrans* bse_trans_open ( void  )
Returns
Newly opened empty transaction

Open up a new transaction to commit jobs to the BSE Engine. While the distinct functions to operate on a transaction are MT-safe, the caller has to take measures himself, to assure that only one function operates on the transaction at a time. This function is MT-safe and may be called from any thread.

Referenced by bse_engine_add_user_callback(), bse_engine_configure(), bse_job_boundary_access(), bse_module_new_virtual(), bse_server_get(), bse_sub_synth_set_null_shortcut(), bse_trans_commit_delayed(), and bse_transact().

Here is the caller graph for this function:

void bse_transact ( BseJob *  job,
  ... 
)
Parameters
jobFirst job
...NULL terminated job list

Convenience function which openes up a new transaction, collects the NULL terminated job list passed to the function, and commits the transaction. This function is MT-safe and may be called from any thread.

Here is the call graph for this function: