JACK-AUDIO-CONNECTION-KIT: Metadata API.

JACK-AUDIO-CONNECTION-KIT 0.125.0

Data Structures | Typedefs | Enumerations | Functions
Metadata API.

## Data Structures
struct | jack_property_t
struct | jack_description_t

## Typedefs
typedef void(* | JackPropertyChangeCallback) (jack_uuid_t subject, const char *key, jack_property_change_t change, void *arg)

## Enumerations
enum | jack_property_change_t { PropertyCreated , PropertyChanged , PropertyDeleted }

## Functions
int | jack_set_property (jack_client_t *, jack_uuid_t subject, const char *key, const char *value, const char *type)
int | jack_get_property (jack_uuid_t subject, const char *key, char **value, char **type)
void | jack_free_description (jack_description_t *desc, int free_description_itself)
int | jack_get_properties (jack_uuid_t subject, jack_description_t *desc)
int | jack_get_all_properties (jack_description_t **descs)
int | jack_remove_property (jack_client_t *client, jack_uuid_t subject, const char *key)
int | jack_remove_properties (jack_client_t *client, jack_uuid_t subject)
int | jack_remove_all_properties (jack_client_t *client)
int | jack_set_property_change_callback (jack_client_t *client, JackPropertyChangeCallback callback, void *arg)

## Detailed Description

## Typedef Documentation

## ◆ JackPropertyChangeCallback

typedef void(* JackPropertyChangeCallback) (jack_uuid_t subject, const char *key, jack_property_change_t change, void *arg)

## Enumeration Type Documentation

## ◆ jack_property_change_t

enum jack_property_change_t

Enumerator
PropertyCreated |
PropertyChanged |
PropertyDeleted |

## Function Documentation

## ◆ jack_free_description()

void jack_free_description | ( | jack_description_t * | desc,
|  | int | free_description_itself )

Free a description.

Parameters

  desc | a jack_description_t whose associated memory will all be released
  free_description_itself | if non-zero, then
  desc | will also be passed to free()

## ◆ jack_get_all_properties()

int jack_get_all_properties | ( | jack_description_t ** | descs | ) |

Get descriptions for all subjects with metadata.

Parameters

  descs | Set to a NULL-terminated array of descriptions. The caller must free each of these with jack_free_description(), and the array itself with jack_free().

Returns
  0 on success.

## ◆ jack_get_properties()

int jack_get_properties | ( | jack_uuid_t | subject,
|  | jack_description_t * | desc )

Get a description of `subject`.

Parameters

  subject | The subject to get all properties of.
  desc | Set to the description of subject if found, or NULL otherwise. The caller must free this value with jack_free_description().

Returns
  0 on success, -1 if no `subject` with any properties exists.

## ◆ jack_get_property()

int jack_get_property | ( | jack_uuid_t | subject,
|  | const char * | key,
|  | char ** | value,
|  | char ** | type )

Get a property on `subject`.

Parameters

  subject | The subject to get the property from.
  key | The key of the property.
  value | Set to the value of the property if found, or NULL otherwise. The caller must free this value with jack_free().
  type | The type of the property if set, or NULL. See the discussion of types in the definition of jack_property_t above. If non-null, the caller must free this value with jack_free().

Returns
  0 on success, -1 if the `subject` has no `key` property.

## ◆ jack_remove_all_properties()

int jack_remove_all_properties | ( | jack_client_t * | client | ) |

Remove all properties.

WARNING!! This deletes all metadata managed by a running JACK server. Data lost cannot be recovered (though it can be recreated by new calls to jack_set_property()).

Parameters

  client | The JACK client making the request to remove all properties

Returns
  0 on success, -1 otherwise

## ◆ jack_remove_properties()

int jack_remove_properties | ( | jack_client_t * | client,
|  | jack_uuid_t | subject )

Remove all properties on a subject.

Parameters

  client | The JACK client making the request to remove some properties.
  subject | The subject to remove all properties from.

Returns
  a count of the number of properties removed, or -1 on error.

## ◆ jack_remove_property()

int jack_remove_property | ( | jack_client_t * | client,
|  | jack_uuid_t | subject,
|  | const char * | key )

Remove a single property on a subject.

Parameters

  client | The JACK client making the request to remove the property.
  subject | The subject to remove the property from.
  key | The key of the property to be removed.

Returns
  0 on success, -1 otherwise

## ◆ jack_set_property()

int jack_set_property | ( | jack_client_t * | ,
|  | jack_uuid_t | subject,
|  | const char * | key,
|  | const char * | value,
|  | const char * | type )

Set a property on `subject`.

See the above documentation for rules about `subject` and `key`.

Parameters

  subject | The subject to set the property on.
  key | The key of the property.
  value | The value of the property.
  type | The type of the property. See the discussion of types in the definition of jack_property_t above.

Returns
  0 on success.

## ◆ jack_set_property_change_callback()

int jack_set_property_change_callback | ( | jack_client_t * | client,
|  | JackPropertyChangeCallback | callback,
|  | void * | arg )

Arrange for `client` to call `callback` whenever a property is created, changed or deleted.

Parameters

  client | the JACK client making the request
  callback | the function to be invoked when a property change occurs
  arg | the argument to be passed to
  callback | when it is invoked

Returns
  0 success, -1 otherwise.