JACK-AUDIO-CONNECTION-KIT 0.120.1
Data Structures | Typedefs | Enumerations | Functions

Session API for clients.

Data Structures

struct  _jack_session_event

Typedefs

typedef enum JackSessionEventType jack_session_event_type_t
typedef enum JackSessionFlags jack_session_flags_t
typedef struct _jack_session_event jack_session_event_t
typedef void(* JackSessionCallback )(jack_session_event_t *event, void *arg)

Enumerations

enum  JackSessionEventType { JackSessionSave = 1, JackSessionSaveAndQuit = 2, JackSessionSaveTemplate = 3 }
enum  JackSessionFlags { JackSessionSaveError = 0x01, JackSessionNeedTerminal = 0x02 }

Functions

int jack_set_session_callback (jack_client_t *client, JackSessionCallback session_callback, void *arg) JACK_WEAK_EXPORT
int jack_session_reply (jack_client_t *client, jack_session_event_t *event) JACK_WEAK_EXPORT
void jack_session_event_free (jack_session_event_t *event) JACK_WEAK_EXPORT
char * jack_client_get_uuid (jack_client_t *client) JACK_WEAK_EXPORT

Typedef Documentation

typedef void(* JackSessionCallback)(jack_session_event_t *event, void *arg)

Prototype for the client supplied function that is called whenever a session notification is sent via jack_session_notify().

ownership of the memory of event is passed to the application. it must be freed using jack_session_event_free when its not used anymore.

the client is also required to call jack_session_reply for this event. there is no timeout yet. and the only way to get back to a sane state would be to kill this client.

Parameters:
eventthe event_structure.
argpointer to a client supplied structure

Enumeration Type Documentation

session event types.

if a client cant save templates, i might just do a normal save.

the rationale, why there is no quit without save, is that a client might refuse to quit when it has unsaved data. however some other clients might have already quit. this results in too much confusion, so we just dont support that. the session manager can check, if the saved state is different from a previous save, and just remove the saved stuff.

(an inquiry function, whether a quit is ok, followed by a quit event would have a race)

Enumerator:
JackSessionSave 
JackSessionSaveAndQuit 
JackSessionSaveTemplate 
Enumerator:
JackSessionSaveError 

an error occured while saving.

JackSessionNeedTerminal 

client needs to be run in a terminal.


Function Documentation

char* jack_client_get_uuid ( jack_client_t client)

get the assigned uuid for client. safe to call from callback and all other threads. memory needs to be freed.

void jack_session_event_free ( jack_session_event_t event)

free memory used by a jack_session_event_t this also frees the memory used by the command_line pointer. if its non NULL.

int jack_session_reply ( jack_client_t client,
jack_session_event_t event 
)

reply to a session_event

this can either be called directly from the callback, or later from a different thread. so its possible to just stick the event pointer into a pipe and execute the save code from the gui thread.

Returns:
0 on success, otherwise a non-zero error code
int jack_set_session_callback ( jack_client_t client,
JackSessionCallback  session_callback,
void *  arg 
)

Tell the JACK server to call session_callback when a session event is to be delivered.

setting more than one session_callback per process is probably a design error. if you have a multiclient application its more sensible to create a jack_client with only a session callback set.

Returns:
0 on success, otherwise a non-zero error code