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
-
enumerator
-
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
-
enumerator
-
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 char *
wp_get_library_version
(void)¶ Gets the WirePlumber library version.
- Return
WirePlumber library version
- Since
0.4.12
-
const char *
wp_get_library_api_version
(void)¶ Gets the WirePlumber library API version.
- Return
WirePlumber library API version
- Since
0.4.12
-
const gchar *
wp_get_module_dir
(void)¶ Gets the WirePlumber module directory.
- Return
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
- Return
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
- Return
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.
- Return
(transfer full): An allocated string with the configuration file path or NULL if the file was not found.
- Since
0.4.2
- Parameters
dirs
: the directories to look intofilename
: the name of the file to search forsubdir
: (nullable): the name of the subdirectory to search in, inside the configuration directories
-
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.
- Note
the iterator may contain directories too; it is the responsibility of the caller to ignore or recurse into those.
- Return
(transfer full): a new iterator iterating over strings which are absolute paths to the configuration files found
- Since
0.4.2
- Parameters
dirs
: the directories to look intosubdir
: (nullable): the name of the subdirectory to search in, inside the configuration directoriessuffix
: (nullable): The filename suffix, NULL matches all entries