Static Configuration

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

struct WpConf

WpConf allows accessing the different sections of the wireplumber configuration.

WpConf *wp_conf_get_instance(WpCore *core)

Returns the WpConf instance that is associated with the given core.

This method will also create the instance and register it with the core if it had not been created before.

Parameters:
  • core – the core

Returns:

(transfer full): the WpConf instance

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

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. The passed fallback value will be returned if the section does not exist.

Parameters:
  • self – the configuration

  • section – the section name

  • fallback – (transfer full)(nullable): the fallback value

Returns:

(transfer full): the JSON value of the section

WpSpaJson *wp_conf_get_value(WpConf *self, const gchar *section, const gchar *key, WpSpaJson *fallback)

This is a convenient function to access a JSON value from an object section in the configuration. If the section is an array, or the key does not exist in the object section, it will return the passed fallback value.

Parameters:
  • self – the configuration

  • section – the section name

  • key – the key name

  • fallback – (transfer full)(nullable): the fallback value

Returns:

(transfer full): the JSON value of the section’s key if it exists, or the passed fallback value otherwise

gboolean wp_conf_get_value_boolean(WpConf *self, const gchar *section, const gchar *key, gboolean fallback)

This is a convenient function to access a boolean value from an object section in the configuration. If the section is an array, or the key does not exist in the object section, it will return the passed fallback value.

Parameters:
  • self – the configuration

  • section – the section name

  • key – the key name

  • fallback – the fallback value

Returns:

the boolean value of the section’s key if it exists and could be parsed, or the passed fallback value otherwise

gint wp_conf_get_value_int(WpConf *self, const gchar *section, const gchar *key, gint fallback)

This is a convenient function to access a int value from an object section in the configuration. If the section is an array, or the key does not exist in the object section, it will return the passed fallback value.

Parameters:
  • self – the configuration

  • section – the section name

  • key – the key name

  • fallback – the fallback value

Returns:

the int value of the section’s key if it exists and could be parsed, or the passed fallback value otherwise

float wp_conf_get_value_float(WpConf *self, const gchar *section, const gchar *key, float fallback)

This is a convenient function to access a float value from an object section in the configuration. If the section is an array, or the key does not exist in the object section, it will return the passed fallback value.

Parameters:
  • self – the configuration

  • section – the section name

  • key – the key name

  • fallback – the fallback value

Returns:

the float value of the section’s key if it exists and could be parsed, or the passed fallback value otherwise

gchar *wp_conf_get_value_string(WpConf *self, const gchar *section, const gchar *key, const gchar *fallback)

This is a convenient function to access a string value from an object section in the configuration. If the section is an array, or the key does not exist in the object section, it will return the passed fallback value.

Parameters:
  • self – the configuration

  • section – the section name

  • key – the key name

  • fallback – (nullable): the fallback value

Returns:

(transfer full): the string value of the section’s key if it exists and could be parsed, or the passed fallback value otherwise

WP_TYPE_CONF (wp_conf_get_type ())

The WpConf GType.