2022-03-22 03:38:35 +05:30
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2022 Collabora Ltd.
|
|
|
|
|
* @author Ashok Sidipotu <ashok.sidipotu@collabora.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WIREPLUMBER_SETTINGS_H__
|
|
|
|
|
#define __WIREPLUMBER_SETTINGS_H__
|
|
|
|
|
|
|
|
|
|
#include "object.h"
|
2022-08-11 11:30:10 -04:00
|
|
|
#include "spa-json.h"
|
2022-03-22 03:38:35 +05:30
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \brief Flags to be used as WpObjectFeatures on WpSettings subclasses.
|
|
|
|
|
* \ingroup wpsettings
|
|
|
|
|
*/
|
2022-05-04 14:45:55 +03:00
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
/*! Loads the settings */
|
2022-03-22 03:38:35 +05:30
|
|
|
WP_SETTINGS_LOADED = (1 << 0),
|
|
|
|
|
} WpSettingsFeatures;
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \brief The WpSettings GType
|
|
|
|
|
* \ingroup wpsettings
|
|
|
|
|
*/
|
|
|
|
|
#define WP_TYPE_SETTINGS (wp_settings_get_type ())
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
G_DECLARE_FINAL_TYPE (WpSettings, wp_settings, WP, SETTINGS, WpObject)
|
|
|
|
|
|
|
|
|
|
WP_API
|
2022-04-25 10:45:34 +05:30
|
|
|
WpSettings * wp_settings_get_instance (WpCore * core,
|
|
|
|
|
const gchar *metadata_name);
|
2022-03-22 03:38:35 +05:30
|
|
|
|
2022-05-26 13:15:22 +05:30
|
|
|
/*!
|
|
|
|
|
* \brief callback conveying the changed setting and its string(raw) value
|
|
|
|
|
*
|
|
|
|
|
* \ingroup wpsettings
|
|
|
|
|
* \param obj the wpsettings object
|
|
|
|
|
* \param setting the changed setting
|
|
|
|
|
* \param raw_value string value of the the changed setting
|
|
|
|
|
* \param user_data data passed in the \a wp_settings_subscribe
|
|
|
|
|
*/
|
|
|
|
|
typedef void (*WpSettingsChangedCallback) (WpSettings *obj,
|
|
|
|
|
const gchar *setting, const gchar *raw_value, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
guintptr wp_settings_subscribe (WpSettings *self,
|
|
|
|
|
const gchar *pattern, WpSettingsChangedCallback callback,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
guintptr wp_settings_subscribe_closure (WpSettings *self,
|
|
|
|
|
const gchar *pattern, GClosure * closure);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gboolean wp_settings_unsubscribe (WpSettings *self,
|
|
|
|
|
guintptr subscription_id);
|
|
|
|
|
|
2022-08-11 11:30:10 -04:00
|
|
|
WP_API
|
|
|
|
|
WpSpaJson * wp_settings_get (WpSettings *self, const gchar *setting);
|
2022-05-09 12:43:36 +05:30
|
|
|
|
2022-08-11 16:04:26 -04:00
|
|
|
WP_API
|
|
|
|
|
WpSpaJson * wp_settings_get_all (WpSettings *self, const gchar *pattern);
|
|
|
|
|
|
2022-08-27 09:44:17 -04:00
|
|
|
WP_API
|
|
|
|
|
gboolean wp_settings_parse_boolean_safe (WpSettings *self, const gchar *setting,
|
|
|
|
|
gboolean value);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gint wp_settings_parse_int_safe (WpSettings *self, const gchar *setting,
|
|
|
|
|
gint value);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
float wp_settings_parse_float_safe (WpSettings *self, const gchar *setting,
|
|
|
|
|
float value);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gchar * wp_settings_parse_string_safe (WpSettings *self, const gchar *setting,
|
|
|
|
|
const gchar *value);
|
|
|
|
|
|
2022-03-22 03:38:35 +05:30
|
|
|
WP_API
|
|
|
|
|
gboolean wp_settings_apply_rule (WpSettings *self, const gchar *rule,
|
|
|
|
|
WpProperties *client_props, WpProperties *applied_props);
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif
|