keys: add keys.h with defines and docs

Add a keys.h file that lists and documents all keys available to
be used in properties.
This commit is contained in:
Wim Taymans 2019-05-24 15:47:48 +02:00
parent 7bb6515800
commit 3ad73f0532
52 changed files with 483 additions and 291 deletions

View file

@ -33,14 +33,15 @@
#include <pipewire/log.h>
#include <pipewire/module.h>
#include <pipewire/utils.h>
#include <pipewire/keys.h>
#include "spa-monitor.h"
#include "spa-device.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Load and manage an SPA device" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_KEY_MODULE_DESCRIPTION, "Load and manage an SPA device" },
{ PW_KEY_MODULE_VERSION, PACKAGE_VERSION },
};
struct device_data {

View file

@ -35,13 +35,14 @@
#include <pipewire/log.h>
#include <pipewire/core.h>
#include <pipewire/module.h>
#include <pipewire/keys.h>
#include "spa-monitor.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Manage SPA monitors" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_KEY_MODULE_DESCRIPTION, "Manage SPA monitors" },
{ PW_KEY_MODULE_VERSION, PACKAGE_VERSION },
};
struct data {

View file

@ -34,9 +34,9 @@
#include "spa-node.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Provide a factory to make SPA nodes" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_KEY_MODULE_DESCRIPTION, "Provide a factory to make SPA nodes" },
{ PW_KEY_MODULE_VERSION, PACKAGE_VERSION },
};
struct factory_data {

View file

@ -32,6 +32,7 @@
#include <limits.h>
#include <pipewire/core.h>
#include <pipewire/keys.h>
#include <pipewire/log.h>
#include <pipewire/module.h>
#include <pipewire/utils.h>
@ -40,9 +41,9 @@
#include "spa-node.h"
static const struct spa_dict_item module_props[] = {
{ PW_MODULE_PROP_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_MODULE_PROP_DESCRIPTION, "Load and manage an SPA node" },
{ PW_MODULE_PROP_VERSION, PACKAGE_VERSION },
{ PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
{ PW_KEY_MODULE_DESCRIPTION, "Load and manage an SPA node" },
{ PW_KEY_MODULE_VERSION, PACKAGE_VERSION },
};
struct node_data {

View file

@ -42,6 +42,7 @@
#include <pipewire/type.h>
#include <pipewire/node.h>
#include <pipewire/device.h>
#include <pipewire/keys.h>
#include "spa-monitor.h"
#include "spa-device.h"
@ -117,11 +118,11 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
}
}
if ((str = pw_properties_get(props, "device.form_factor")) != NULL)
if ((str = pw_properties_get(props, PW_KEY_DEVICE_FORM_FACTOR)) != NULL)
if (strcmp(str, "internal") == 0)
now = 0;
if (now != 0 && pw_properties_get(props, "device.plugged") == NULL)
pw_properties_setf(props, "device.plugged", "%"PRIu64, now);
if (now != 0 && pw_properties_get(props, PW_KEY_DEVICE_PLUGGED) == NULL)
pw_properties_setf(props, PW_KEY_DEVICE_PLUGGED, "%"PRIu64, now);
support = pw_core_get_support(impl->core, &n_support);