Struct sqa_engine::EngineContext [] [src]

pub struct EngineContext {
    pub conn: JackConnection<Activated>,
    pub chans: ArrayVec<[Option<JackPort>; 64]>,
    pub holes: ArrayVec<[usize; 64]>,
    // some fields omitted
}

Main engine context, containing a connection to JACK.

Fields

Methods

impl EngineContext
[src]

Initialise the SQA Engine, opening a connection to JACK and starting the audio thread.

The connection is made under a given name if provided, otherwise under "SQA Engine".

Obtain a communication channel to receive messages from the audio thread. Can only be called once - will return None after the first call.

Safety

WARNING: In order to not leak memory, you MUST continually recv() from this handle to avoid filling the message queue. If the message queue is filled, the audio thread will leak any Players that are removed or rejected, as it will not be able to send them through the channel (and deallocation would block the audio thread). (BUT WE KNOW YOU WON'T, because it requires spawning another thread)