JACK-AUDIO-CONNECTION-KIT
Data Structures | Functions
inprocess.c File Reference

This demonstrates the basic concepts for writing a client that runs within the JACK server process. More...

#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <jack/jack.h>

Data Structures

struct  port_pair_t
 

Functions

int inprocess (jack_nframes_t nframes, void *arg)
 
int jack_initialize (jack_client_t *client, const char *load_init)
 
void jack_finish (void *arg)
 

Detailed Description

This demonstrates the basic concepts for writing a client that runs within the JACK server process.

For the sake of example, a port_pair_t is allocated in jack_initialize(), passed to inprocess() as an argument, then freed in jack_finish().

Function Documentation

◆ inprocess()

int inprocess ( jack_nframes_t  nframes,
void *  arg 
)

Called in the realtime thread on every process cycle. The entry point name was passed to jack_set_process_callback() from jack_initialize(). Although this is an internal client, its process() interface is identical to simple_client.c.

Returns
0 if successful; otherwise jack_finish() will be called and the client terminated immediately.

References port_pair_t::input_port, jack_port_get_buffer(), and port_pair_t::output_port.

Referenced by jack_initialize().

◆ jack_finish()

void jack_finish ( void *  arg)

This required entry point is called immediately before the client is unloaded, which could happen due to a call to jack_internal_client_unload(), or a nonzero return from either jack_initialize() or inprocess().

Parameters
argthe same parameter provided to inprocess().

◆ jack_initialize()

int jack_initialize ( jack_client_t client,
const char *  load_init 
)

This required entry point is called after the client is loaded by jack_internal_client_load().

Parameters
clientpointer to JACK client structure.
load_initcharacter string passed to the load operation.
Returns
0 if successful; otherwise jack_finish() will be called and the client terminated immediately.

References client, inprocess(), port_pair_t::input_port, jack_activate(), jack_connect(), JACK_DEFAULT_AUDIO_TYPE, jack_port_name(), jack_port_register(), jack_set_process_callback(), JackPortIsInput, JackPortIsOutput, and port_pair_t::output_port.