wireplumber/lib/wp/settings.h
Ashok Sidipotu 7d304096e5 lib: Add _get_{int,string}() APIs
- add integer and string version of the APIs,
- Also Refine the APIs, return value to indicate the setting existance
  and a new param to return the value of the setting.
- add their lua bindings as well, in lua binding the return value nil
  indicates that the setting is not defnied.
- Add corresponding C and lua tests as well.
- Add a few handy debug msgs.
2023-04-17 07:44:19 -04:00

55 lines
1.2 KiB
C

/* 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"
G_BEGIN_DECLS
/*!
* \brief Flags to be used as WpObjectFeatures on WpSettings subclasses.
* \ingroup wpsettings
*/
typedef enum {
/* loads the metadata */
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
WpSettings * wp_settings_get_instance (WpCore * core,
const gchar *metadata_name);
WP_API
gboolean wp_settings_get_boolean (WpSettings *self, const gchar *setting,
gboolean *value);
WP_API
gboolean wp_settings_get_string (WpSettings *self, const gchar *setting,
const char **value);
WP_API
gboolean wp_settings_get_int (WpSettings *self, const gchar *setting,
gint64 *val);
WP_API
gboolean wp_settings_apply_rule (WpSettings *self, const gchar *rule,
WpProperties *client_props, WpProperties *applied_props);
G_END_DECLS
#endif