Static Configuration

digraph inheritance { rankdir=LR; GObject -> WpConf; }

struct WpConf

WpConf allows accessing the different sections of the wireplumber configuration.

WpConf* wp_conf_new(const gchar * name, WpProperties * properties)

Creates a new WpConf object.

This does not open the files, it only creates the object. For most use cases, you should use wp_conf_new_open() instead.

Return

(transfer full): a new WpConf object

Parameters
  • name: the name of the configuration file

  • properties: (transfer full) (nullable): a WpProperties with keys specifying how to load the WpConf object

WpConf* wp_conf_new_open(const gchar * name, WpProperties * properties, GError ** error)

Creates a new WpConf object and opens the configuration file and its fragments, keeping them mapped in memory for further access.

Return

(transfer full) (nullable): a new WpConf object, or NULL if an error occurred

Parameters
  • name: the name of the configuration file

  • properties: (transfer full) (nullable): a WpProperties with keys specifying how to load the WpConf object

  • error: (out) (nullable): return location for a GError, or NULL

gboolean wp_conf_open(WpConf * self, GError ** error)

Opens the configuration file and its fragments and keeps them mapped in memory for further access.

Return

TRUE on success, FALSE on error

Parameters
  • self: the configuration

  • error: (out)(nullable): return location for a GError, or NULL

void wp_conf_close(WpConf * self)

Closes the configuration file and its fragments.

Parameters
  • self: the configuration

gboolean wp_conf_is_open(WpConf * self)

Tests if the configuration files are open.

Return

TRUE if the configuration files are open, FALSE otherwise

Parameters
  • self: the configuration

const gchar* wp_conf_get_name(WpConf * self)

Gets the name of the configuration file.

Return

the name of the configuration file

Parameters
  • self: the configuration

WpSpaJson* wp_conf_get_section(WpConf * self, const gchar * section)

This method will get the JSON value of a specific section from the configuration. If the same section is defined in multiple locations, the sections with the same name will be either merged in case of arrays and objects, or overridden in case of boolean, int, double and strings.

Return

(transfer full) (nullable): the JSON value of the section or NULL if the section does not exist

Parameters
  • self: the configuration

  • section: the section name

gint wp_conf_section_update_props(WpConf * self, const gchar * section, WpProperties * props)

Updates the given properties with the values of a specific section from the configuration.

Return

the number of properties updated

Parameters
  • self: the configuration

  • section: the section name

  • props: the properties to update

void wp_conf_parse_pw_context_sections(WpConf * self, struct pw_context * context)

Parses standard pw_context sections from conf.

Parameters
  • self: the configuration

  • context: the associated pw_context

WP_TYPE_CONF (wp_conf_get_type ())

The WpConf GType.