use true and false for boolean properties

So that it's easier to convert them to booleans in introspection
code later.
This commit is contained in:
Wim Taymans 2020-03-03 18:17:46 +01:00
parent b60d7bf2bc
commit c4b2be2aad
16 changed files with 28 additions and 28 deletions

View file

@ -2224,7 +2224,7 @@ jack_client_t * jack_client_open (const char *client_name,
}
props = SPA_DICT_INIT(items, 0);
items[props.n_items++] = SPA_DICT_ITEM_INIT("loop.cancel", "1");
items[props.n_items++] = SPA_DICT_ITEM_INIT("loop.cancel", "true");
client->loop = pw_data_loop_new(&props);
if (client->loop == NULL)
goto init_failed;
@ -2276,7 +2276,7 @@ jack_client_t * jack_client_open (const char *client_name,
if ((str = getenv("PIPEWIRE_LATENCY")) == NULL)
str = DEFAULT_LATENCY;
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, str);
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "1");
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "true");
client->node = pw_core_create_object(client->core,
"client-node",
@ -3665,7 +3665,7 @@ int jack_connect (jack_client_t *client,
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_OUTPUT_PORT, val[1]);
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_NODE, val[2]);
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_PORT, val[3]);
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_LINGER, "1");
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_LINGER, "true");
pw_core_create_object(c->core,
"link-factory",

View file

@ -991,7 +991,7 @@ static int create_stream(pa_stream_direction_t direction,
direction == PA_STREAM_PLAYBACK ?
"Playback" : "Capture");
items[3] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str);
items[4] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, monitor ? "1" : "0");
items[4] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, monitor ? "true" : "false");
pw_stream_update_properties(s->stream, &SPA_DICT_INIT(items, 5));

View file

@ -150,7 +150,7 @@ static void emit_port_info(struct impl *this, struct port *port, bool full)
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_FORMAT_DSP, "32 bit float mono audio");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_AUDIO_CHANNEL, port->position);
if (port->direction == SPA_DIRECTION_OUTPUT)
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_PORT_MONITOR, "1");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_PORT_MONITOR, "true");
}
port->info.props = &SPA_DICT_INIT(items, n_items);

View file

@ -928,7 +928,7 @@ impl_init(const struct spa_handle_factory *factory,
if ((str = spa_dict_lookup(info, "resample.quality")) != NULL)
this->props.quality = atoi(str);
if ((str = spa_dict_lookup(info, "resample.peaks")) != NULL)
this->peaks = atoi(str);
this->peaks = strcmp(str, "true") == 0 || atoi(str) == 1;
if ((str = spa_dict_lookup(info, "factory.mode")) != NULL) {
if (strcmp(str, "split") == 0)
this->mode = MODE_SPLIT;

View file

@ -196,7 +196,7 @@ static void emit_node_info(struct impl *this, bool full)
struct spa_dict_item items[1];
this->info.change_mask |= SPA_NODE_CHANGE_MASK_PROPS;
items[0] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, this->driver ? "1" : "0");
items[0] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_DRIVER, this->driver ? "true" : "false");
this->info.props = &SPA_DICT_INIT(items, 1);
spa_node_emit_info(&this->hooks, &this->info);

View file

@ -92,7 +92,7 @@ int main(int argc, char *argv[])
properties = pw_properties_new(
PW_KEY_CORE_NAME, daemon_name,
PW_KEY_CONTEXT_PROFILE_MODULES, "none",
PW_KEY_CORE_DAEMON, "1", NULL);
PW_KEY_CORE_DAEMON, "true", NULL);
/* parse configuration */
config = pw_daemon_config_new(properties);

View file

@ -463,7 +463,7 @@ static void make_node(struct data *data)
{
struct pw_properties *props;
props = pw_properties_new(PW_KEY_NODE_AUTOCONNECT, "1", NULL);
props = pw_properties_new(PW_KEY_NODE_AUTOCONNECT, "true", NULL);
if (data->path)
pw_properties_set(props, PW_KEY_NODE_TARGET, data->path);
pw_properties_set(props, PW_KEY_MEDIA_CLASS, "Stream/Input/Video");

View file

@ -469,8 +469,8 @@ static void make_node(struct data *data)
{
struct pw_properties *props;
props = pw_properties_new(PW_KEY_NODE_AUTOCONNECT, "1",
PW_KEY_NODE_EXCLUSIVE, "1",
props = pw_properties_new(PW_KEY_NODE_AUTOCONNECT, "true",
PW_KEY_NODE_EXCLUSIVE, "true",
PW_KEY_MEDIA_TYPE, "Audio",
PW_KEY_MEDIA_CATEGORY, "Playback",
PW_KEY_MEDIA_ROLE, "Music",

View file

@ -87,7 +87,7 @@ static int make_node(struct data *data)
data->node = iface;
if (data->path) {
pw_properties_set(props, PW_KEY_NODE_AUTOCONNECT, "1");
pw_properties_set(props, PW_KEY_NODE_AUTOCONNECT, "true");
pw_properties_set(props, PW_KEY_NODE_TARGET, data->path);
}

View file

@ -403,7 +403,7 @@ int main(int argc, char *argv[])
data.context = pw_context_new(
pw_main_loop_get_loop(data.loop),
pw_properties_new(
PW_KEY_CORE_DAEMON, "0",
PW_KEY_CORE_DAEMON, "false",
NULL), 0);
spa_hook_list_init(&data.hooks);

View file

@ -256,7 +256,7 @@ int main(int argc, char *argv[])
PW_KEY_MEDIA_TYPE, "Video",
PW_KEY_MEDIA_CATEGORY, "Capture",
PW_KEY_MEDIA_ROLE, "DSP",
PW_KEY_NODE_AUTOCONNECT, "1",
PW_KEY_NODE_AUTOCONNECT, data.target ? "true" : "false",
PW_KEY_NODE_TARGET, data.target,
PW_KEY_MEDIA_CLASS, "Stream/Input/Video",
NULL),

View file

@ -127,8 +127,8 @@ static void node_port_init(void *data, struct pw_impl_port *port)
}
if (direction == n->direction) {
if (is_device) {
pw_properties_set(new, PW_KEY_PORT_PHYSICAL, "1");
pw_properties_set(new, PW_KEY_PORT_TERMINAL, "1");
pw_properties_set(new, PW_KEY_PORT_PHYSICAL, "true");
pw_properties_set(new, PW_KEY_PORT_TERMINAL, "true");
}
}

View file

@ -388,9 +388,9 @@ struct pw_impl_port *pw_context_create_port(
if (info) {
if (SPA_FLAG_IS_SET(info->flags, SPA_PORT_FLAG_PHYSICAL))
pw_properties_set(properties, PW_KEY_PORT_PHYSICAL, "1");
pw_properties_set(properties, PW_KEY_PORT_PHYSICAL, "true");
if (SPA_FLAG_IS_SET(info->flags, SPA_PORT_FLAG_TERMINAL))
pw_properties_set(properties, PW_KEY_PORT_TERMINAL, "1");
pw_properties_set(properties, PW_KEY_PORT_TERMINAL, "true");
this->spa_flags = info->flags;
}
@ -855,7 +855,7 @@ int pw_impl_port_add(struct pw_impl_port *port, struct pw_impl_node *node)
control = PW_IMPL_PORT_IS_CONTROL(port);
if (control) {
dir = port->direction == PW_DIRECTION_INPUT ? "control" : "notify";
pw_properties_set(port->properties, PW_KEY_PORT_CONTROL, "1");
pw_properties_set(port->properties, PW_KEY_PORT_CONTROL, "true");
}
else {
dir = port->direction == PW_DIRECTION_INPUT ? "in" : "out";

View file

@ -378,8 +378,8 @@ void pw_init(int *argc, char **argv[])
support->registry = &global_registry;
n_items = 0;
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, "1");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_TIMESTAMP, "1");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_COLORS, "true");
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_TIMESTAMP, "true");
snprintf(level, sizeof(level), "%d", pw_log_level);
items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_LOG_LEVEL, level);
if ((str = getenv("PIPEWIRE_LOG")) != NULL)

View file

@ -1073,7 +1073,7 @@ stream_new(struct pw_context *context, const char *name,
}
if (pw_properties_get(props, PW_KEY_STREAM_IS_LIVE) == NULL)
pw_properties_set(props, PW_KEY_STREAM_IS_LIVE, "1");
pw_properties_set(props, PW_KEY_STREAM_IS_LIVE, "true");
if (pw_properties_get(props, PW_KEY_NODE_NAME) == NULL && extra) {
str = pw_properties_get(extra, PW_KEY_APP_NAME);
@ -1417,13 +1417,13 @@ pw_stream_connect(struct pw_stream *stream,
if (target_id != PW_ID_ANY)
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
if (flags & PW_STREAM_FLAG_AUTOCONNECT)
pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, "1");
pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, "true");
if (flags & PW_STREAM_FLAG_DRIVER)
pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "1");
pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true");
if (flags & PW_STREAM_FLAG_EXCLUSIVE)
pw_properties_set(stream->properties, PW_KEY_NODE_EXCLUSIVE, "1");
pw_properties_set(stream->properties, PW_KEY_NODE_EXCLUSIVE, "true");
if (flags & PW_STREAM_FLAG_DONT_RECONNECT)
pw_properties_set(stream->properties, PW_KEY_NODE_DONT_RECONNECT, "1");
pw_properties_set(stream->properties, PW_KEY_NODE_DONT_RECONNECT, "true");
if ((pw_properties_get(stream->properties, PW_KEY_MEDIA_CLASS) == NULL)) {
pw_properties_setf(stream->properties, PW_KEY_MEDIA_CLASS, "Stream/%s/%s",
@ -1456,7 +1456,7 @@ pw_stream_connect(struct pw_stream *stream,
if ((str = pw_properties_get(props, PW_KEY_STREAM_MONITOR)) &&
pw_properties_parse_bool(str)) {
pw_properties_set(props, "resample.peaks", "1");
pw_properties_set(props, "resample.peaks", "true");
}
follower = pw_context_create_node(impl->context, pw_properties_copy(props), 0);

View file

@ -6579,7 +6579,7 @@ int main(int argc, char *argv[])
spa_list_init(&data.remotes);
pw_map_init(&data.vars, 64, 16);
data.context = pw_context_new(l, pw_properties_new(PW_KEY_CORE_DAEMON, "1", NULL), 0);
data.context = pw_context_new(l, pw_properties_new(PW_KEY_CORE_DAEMON, "true", NULL), 0);
pw_context_load_module(data.context, "libpipewire-module-link-factory", NULL, NULL);