mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-24 15:30:04 +01:00
The previous approach to loading config files was to ask WP for the directory and then search those for the config files. This patch changes the approach - a caller now asks WP to search for a specific config file or iterate over a config file directory. This allows us to implement a directory lookup order, i.e. "wireplumber.conf" may be in XDG_CONFIG_DIR, /etc/, /usr/share and the first one found is used. For configuration directories, the new method iterates over all matching entries (files + directories) and invokes a callback for each entry. This enables distributions to ship default files in /usr/share/wireplumber but have admins and users override them on a local basis. For lua scripts in particular, overriding a distribution-provided file with an empty file effectively disables it, adding a file adds it in the right sort order.
96 lines
2.2 KiB
C
96 lines
2.2 KiB
C
/* WirePlumber
|
|
*
|
|
* Copyright © 2019 Collabora Ltd.
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef __WIREPLUMBER_WP_H__
|
|
#define __WIREPLUMBER_WP_H__
|
|
|
|
#include "client.h"
|
|
#include "component-loader.h"
|
|
#include "core.h"
|
|
#include "device.h"
|
|
#include "endpoint.h"
|
|
#include "error.h"
|
|
#include "global-proxy.h"
|
|
#include "iterator.h"
|
|
#include "link.h"
|
|
#include "log.h"
|
|
#include "metadata.h"
|
|
#include "node.h"
|
|
#include "object-interest.h"
|
|
#include "object-manager.h"
|
|
#include "object.h"
|
|
#include "plugin.h"
|
|
#include "port.h"
|
|
#include "properties.h"
|
|
#include "proxy.h"
|
|
#include "proxy-interfaces.h"
|
|
#include "session-item.h"
|
|
#include "si-factory.h"
|
|
#include "si-interfaces.h"
|
|
#include "spa-pod.h"
|
|
#include "spa-type.h"
|
|
#include "state.h"
|
|
#include "transition.h"
|
|
#include "wpenums.h"
|
|
#include "wpversion.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/*!
|
|
* \ingroup wp
|
|
* Flags for wp_init()
|
|
*/
|
|
typedef enum {
|
|
/*! Initialize PipeWire by calling pw_init() */
|
|
WP_INIT_PIPEWIRE = (1<<0),
|
|
/*! Initialize support for dynamic spa types.
|
|
* See wp_spa_dynamic_type_init() */
|
|
WP_INIT_SPA_TYPES = (1<<1),
|
|
/*! Override PipeWire's logging system with WirePlumber's one */
|
|
WP_INIT_SET_PW_LOG = (1<<2),
|
|
/*! Set wp_log_writer_default() as GLib's default log writer function */
|
|
WP_INIT_SET_GLIB_LOG = (1<<3),
|
|
/*! Initialize all of the above */
|
|
WP_INIT_ALL = 0xf,
|
|
} WpInitFlags;
|
|
|
|
WP_API
|
|
void wp_init (WpInitFlags flags);
|
|
|
|
WP_API
|
|
const gchar * wp_get_module_dir (void);
|
|
|
|
WP_API
|
|
const gchar * wp_get_xdg_state_dir (void);
|
|
|
|
WP_API
|
|
const gchar * wp_get_xdg_config_dir (void);
|
|
|
|
WP_API
|
|
const gchar * wp_get_config_dir (void);
|
|
|
|
WP_API
|
|
const gchar * wp_get_data_dir (void);
|
|
|
|
WP_API
|
|
gchar * wp_find_config_file (const gchar *filename, const char *subdir);
|
|
|
|
WP_API
|
|
gchar * wp_find_sysconfig_file (const gchar *filename, const char *subdir);
|
|
|
|
typedef gint (*wp_file_iter_func)(const gchar *filename, gpointer user_data,
|
|
GError **error);
|
|
|
|
WP_API
|
|
gint wp_iter_config_files (const gchar *subdir, const gchar *suffix,
|
|
wp_file_iter_func func, gpointer user_data,
|
|
GError **error);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif
|