# Library Initialization

enum WpInitFlags

  Flags for wp_init()

  Values:

  enumerator WP_INIT_PIPEWIRE = (1 << 0)

    Initialize PipeWire by calling pw_init()

  enumerator WP_INIT_SPA_TYPES = (1 << 1)

    Initialize support for dynamic spa types. See wp_spa_dynamic_type_init()

  enumerator WP_INIT_SET_PW_LOG = (1 << 2)

    Override PipeWire’s logging system with WirePlumber’s one

  enumerator WP_INIT_SET_GLIB_LOG = (1 << 3)

    Set wp_log_writer_default() as GLib’s default log writer function

  enumerator WP_INIT_ALL = 0xf

    Initialize all of the above

enum WpLookupDirs

  Flags to specify lookup directories.

  Values:

  enumerator WP_LOOKUP_DIR_ENV_CONFIG = (1 << 0)

    $WIREPLUMBER_CONFIG_DIR

  enumerator WP_LOOKUP_DIR_ENV_DATA = (1 << 1)

    $WIREPLUMBER_DATA_DIR

  enumerator WP_LOOKUP_DIR_XDG_CONFIG_HOME = (1 << 10)

    XDG_CONFIG_HOME/wireplumber

  enumerator WP_LOOKUP_DIR_ETC = (1 << 11)

    ($prefix)/etc/wireplumber

  enumerator WP_LOOKUP_DIR_PREFIX_SHARE = (1 << 12)

    $prefix/share/wireplumber

void wp_init(WpInitFlags flags)

  Initializes WirePlumber and PipeWire underneath.

  flags can modify which parts are initialized, in cases where you want to handle part of this initialization externally.

  Parameters

    - flags – initialization flags

const gchar *wp_get_module_dir(void)

  Gets the WirePlumber module directory.

  Returns

    WirePlumber’s module directory

const gchar *wp_get_config_dir(void)

  Gets the full path to the WirePlumber configuration directory.

  Deprecated:

    Use wp_find_file() instead

  Returns

    The WirePlumber configuration directory

const gchar *wp_get_data_dir(void)

  Gets full path to the WirePlumber data directory.

  Deprecated:

    Use wp_find_file() instead

  Returns

    The WirePlumber data directory

gchar *wp_find_file(WpLookupDirs dirs, const gchar *filename, const char *subdir)

  Returns the full path of filename as found in the hierarchy of configuration and data directories.

  Since

    0.4.2

  Parameters

    - dirs – the directories to look into

    - filename – the name of the file to search for

    - subdir – (nullable): the name of the subdirectory to search in, inside the configuration directories

  Returns

    (transfer full): An allocated string with the configuration file path or NULL if the file was not found.

WpIterator *wp_new_files_iterator(WpLookupDirs dirs, const gchar *subdir, const gchar *suffix)

  Creates an iterator to iterate over configuration files in the subdir of the configuration directories.

  Files are sorted across the hierarchy of configuration and data directories with files in higher-priority directories shadowing files in lower-priority directories. Files are only checked for existence, a caller must be able to handle read errors.

  Since

    0.4.2

  Note

  the iterator may contain directories too; it is the responsibility of the caller to ignore or recurse into those.

  Parameters

    - dirs – the directories to look into

    - subdir – (nullable): the name of the subdirectory to search in, inside the configuration directories

    - suffix – (nullable): The filename suffix, NULL matches all entries

  Returns

    (transfer full): a new iterator iterating over strings which are absolute paths to the configuration files found