SOUND4 Plugin Host Library [1.0.2]
Classes | Functions
Client's JSon config interfacing

Classes

struct  plughost_CClientInstance
 

Functions

struct plughost_CClientInstance * plughost_NewClient (struct plughost_CInstance *instance)
 
void plughost_DeleteClient (struct plughost_CClientInstance *client)
 
const char * plughost_ProcessJson (struct plughost_CClientInstance *client, const char *json_str, int *need_save)
 
void plughost_FreeJsonAnswer (const char *json_str)
 
int plughost_SaveState (struct plughost_CInstance *instance)
 

Detailed Description

Allow low-level JSON configuration. see also JSON syntax

Function Documentation

◆ plughost_DeleteClient()

void plughost_DeleteClient ( struct plughost_CClientInstance *  client)

Deletes a client

Parameters
clientthe client instance

◆ plughost_FreeJsonAnswer()

void plughost_FreeJsonAnswer ( const char *  json_str)

Free a JSON answer returned by plughost_ProcessJson

Parameters
json_strthe JSON request

◆ plughost_NewClient()

struct plughost_CClientInstance* plughost_NewClient ( struct plughost_CInstance *  instance)

Creates a new client

Remarks
not needed if using a port for JSON socket in Update Management
Parameters
instancethe processing instance
Returns
A new client instance

◆ plughost_ProcessJson()

const char* plughost_ProcessJson ( struct plughost_CClientInstance *  client,
const char *  json_str,
int *  need_save 
)

Process a JSON request

For syntax, see JSON syntax

Note
In all library, all char* are UTF-8 encoded
Attention
the return value needs to be freed with plughost_FreeJsonAnswer
Parameters
clientthe client instance
json_strthe JSON request
need_saveon return will be 1 is saving is required (maybe delayed)
Returns
a JSON answer (to be freed with plughost_FreeJsonAnswer)

◆ plughost_SaveState()

int plughost_SaveState ( struct plughost_CInstance *  instance)

Save the current state

Needed when plughost_ProcessJson returned with need_save to 1. However it can be postponed as much as wanted.

Remarks
Works only when update thread is running
Parameters
instancethe processing instance
Returns
0 if success, <0 on error