mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
and:
sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
-e '181,194!s/\bTRUE\b/true/' -e \
'181,194!s/\bFALSE\b/false/' pulsecore/macro.h
This commit is contained in:
parent
e9822bfcb0
commit
d806b19714
288 changed files with 3360 additions and 3360 deletions
|
|
@ -336,7 +336,7 @@ static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DB
|
|||
return;
|
||||
}
|
||||
|
||||
if ((r = pa_card_set_profile(c->card, pa_dbusiface_card_profile_get_name(new_active), TRUE)) < 0) {
|
||||
if ((r = pa_card_set_profile(c->card, pa_dbusiface_card_profile_get_name(new_active), true)) < 0) {
|
||||
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED,
|
||||
"Internal error in PulseAudio: pa_card_set_profile() failed with error code %i.", r);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ static void handle_remove_properties(DBusConnection *conn, DBusMessage *msg, voi
|
|||
pa_dbusiface_client *c = userdata;
|
||||
char **keys = NULL;
|
||||
int n_keys = 0;
|
||||
pa_bool_t changed = FALSE;
|
||||
bool changed = false;
|
||||
int i = 0;
|
||||
|
||||
pa_assert(conn);
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ static dbus_bool_t get_is_local(DBusConnection *conn) {
|
|||
pa_assert(conn);
|
||||
|
||||
if (!dbus_connection_get_socket(conn, &conn_fd))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return pa_socket_is_local(conn_fd);
|
||||
}
|
||||
|
|
@ -1407,9 +1407,9 @@ static void handle_upload_sample(DBusConnection *conn, DBusMessage *msg, void *u
|
|||
sample->volume.channels = n_channels;
|
||||
for (i = 0; i < n_volume_entries; ++i)
|
||||
sample->volume.values[i] = default_volume[i];
|
||||
sample->volume_is_set = TRUE;
|
||||
sample->volume_is_set = true;
|
||||
} else {
|
||||
sample->volume_is_set = FALSE;
|
||||
sample->volume_is_set = false;
|
||||
}
|
||||
|
||||
dbus_sample = pa_dbusiface_sample_new(c, sample);
|
||||
|
|
@ -1427,17 +1427,17 @@ finish:
|
|||
pa_memblock_unref(chunk.memblock);
|
||||
}
|
||||
|
||||
static pa_bool_t contains_space(const char *string) {
|
||||
static bool contains_space(const char *string) {
|
||||
const char *p;
|
||||
|
||||
pa_assert(string);
|
||||
|
||||
for (p = string; *p; ++p) {
|
||||
if (isspace(*p))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void handle_load_module(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
|
|
@ -1530,7 +1530,7 @@ static void handle_exit(DBusConnection *conn, DBusMessage *msg, void *userdata)
|
|||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
|
||||
pa_core_exit(c->core, FALSE, 0);
|
||||
pa_core_exit(c->core, false, 0);
|
||||
}
|
||||
|
||||
static void handle_listen_for_signal(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
|
|
|
|||
|
|
@ -440,29 +440,29 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag
|
|||
}
|
||||
|
||||
if (d->type == PA_DEVICE_TYPE_SINK)
|
||||
pa_sink_set_volume(d->sink, &new_vol, TRUE, TRUE);
|
||||
pa_sink_set_volume(d->sink, &new_vol, true, true);
|
||||
else
|
||||
pa_source_set_volume(d->source, &new_vol, TRUE, TRUE);
|
||||
pa_source_set_volume(d->source, &new_vol, true, true);
|
||||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
}
|
||||
|
||||
static void handle_get_has_flat_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t has_flat_volume = FALSE;
|
||||
dbus_bool_t has_flat_volume = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
pa_assert(d);
|
||||
|
||||
has_flat_volume = (d->type == PA_DEVICE_TYPE_SINK) ? (d->sink->flags & PA_SINK_FLAT_VOLUME) : FALSE;
|
||||
has_flat_volume = (d->type == PA_DEVICE_TYPE_SINK) ? (d->sink->flags & PA_SINK_FLAT_VOLUME) : false;
|
||||
|
||||
pa_dbus_send_basic_variant_reply(conn, msg, DBUS_TYPE_BOOLEAN, &has_flat_volume);
|
||||
}
|
||||
|
||||
static void handle_get_has_convertible_to_decibel_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t has_convertible_to_decibel_volume = FALSE;
|
||||
dbus_bool_t has_convertible_to_decibel_volume = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -513,7 +513,7 @@ static void handle_get_mute(DBusConnection *conn, DBusMessage *msg, void *userda
|
|||
|
||||
static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t mute = FALSE;
|
||||
dbus_bool_t mute = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -523,16 +523,16 @@ static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageI
|
|||
dbus_message_iter_get_basic(iter, &mute);
|
||||
|
||||
if (d->type == PA_DEVICE_TYPE_SINK)
|
||||
pa_sink_set_mute(d->sink, mute, TRUE);
|
||||
pa_sink_set_mute(d->sink, mute, true);
|
||||
else
|
||||
pa_source_set_mute(d->source, mute, TRUE);
|
||||
pa_source_set_mute(d->source, mute, true);
|
||||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
}
|
||||
|
||||
static void handle_get_has_hardware_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t has_hardware_volume = FALSE;
|
||||
dbus_bool_t has_hardware_volume = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -547,7 +547,7 @@ static void handle_get_has_hardware_volume(DBusConnection *conn, DBusMessage *ms
|
|||
|
||||
static void handle_get_has_hardware_mute(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t has_hardware_mute = FALSE;
|
||||
dbus_bool_t has_hardware_mute = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -577,7 +577,7 @@ static void handle_get_configured_latency(DBusConnection *conn, DBusMessage *msg
|
|||
|
||||
static void handle_get_has_dynamic_latency(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t has_dynamic_latency = FALSE;
|
||||
dbus_bool_t has_dynamic_latency = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -617,7 +617,7 @@ static void handle_get_latency(DBusConnection *conn, DBusMessage *msg, void *use
|
|||
|
||||
static void handle_get_is_hardware_device(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t is_hardware_device = FALSE;
|
||||
dbus_bool_t is_hardware_device = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -632,7 +632,7 @@ static void handle_get_is_hardware_device(DBusConnection *conn, DBusMessage *msg
|
|||
|
||||
static void handle_get_is_network_device(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t is_network_device = FALSE;
|
||||
dbus_bool_t is_network_device = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -753,13 +753,13 @@ static void handle_set_active_port(DBusConnection *conn, DBusMessage *msg, DBusM
|
|||
}
|
||||
|
||||
if (d->type == PA_DEVICE_TYPE_SINK) {
|
||||
if ((r = pa_sink_set_port(d->sink, pa_dbusiface_device_port_get_name(new_active), TRUE)) < 0) {
|
||||
if ((r = pa_sink_set_port(d->sink, pa_dbusiface_device_port_get_name(new_active), true)) < 0) {
|
||||
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED,
|
||||
"Internal error in PulseAudio: pa_sink_set_port() failed with error code %i.", r);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ((r = pa_source_set_port(d->source, pa_dbusiface_device_port_get_name(new_active), TRUE)) < 0) {
|
||||
if ((r = pa_source_set_port(d->source, pa_dbusiface_device_port_get_name(new_active), true)) < 0) {
|
||||
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED,
|
||||
"Internal error in PulseAudio: pa_source_set_port() failed with error code %i.", r);
|
||||
return;
|
||||
|
|
@ -796,17 +796,17 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat
|
|||
pa_channel_map *channel_map = NULL;
|
||||
dbus_uint32_t channels[PA_CHANNELS_MAX];
|
||||
dbus_uint32_t volume[PA_CHANNELS_MAX];
|
||||
dbus_bool_t has_flat_volume = FALSE;
|
||||
dbus_bool_t has_convertible_to_decibel_volume = FALSE;
|
||||
dbus_bool_t has_flat_volume = false;
|
||||
dbus_bool_t has_convertible_to_decibel_volume = false;
|
||||
dbus_uint32_t base_volume = 0;
|
||||
dbus_uint32_t volume_steps = 0;
|
||||
dbus_bool_t has_hardware_volume = FALSE;
|
||||
dbus_bool_t has_hardware_mute = FALSE;
|
||||
dbus_bool_t has_hardware_volume = false;
|
||||
dbus_bool_t has_hardware_mute = false;
|
||||
dbus_uint64_t configured_latency = 0;
|
||||
dbus_bool_t has_dynamic_latency = FALSE;
|
||||
dbus_bool_t has_dynamic_latency = false;
|
||||
dbus_uint64_t latency = 0;
|
||||
dbus_bool_t is_hardware_device = FALSE;
|
||||
dbus_bool_t is_network_device = FALSE;
|
||||
dbus_bool_t is_hardware_device = false;
|
||||
dbus_bool_t is_network_device = false;
|
||||
dbus_uint32_t state = 0;
|
||||
const char **ports = NULL;
|
||||
unsigned n_ports = 0;
|
||||
|
|
@ -847,7 +847,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat
|
|||
sample_format = d->source->sample_spec.format;
|
||||
sample_rate = d->source->sample_spec.rate;
|
||||
channel_map = &d->source->channel_map;
|
||||
has_flat_volume = FALSE;
|
||||
has_flat_volume = false;
|
||||
has_convertible_to_decibel_volume = d->source->flags & PA_SOURCE_DECIBEL_VOLUME;
|
||||
base_volume = d->source->base_volume;
|
||||
volume_steps = d->source->n_volume_steps;
|
||||
|
|
@ -922,7 +922,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat
|
|||
|
||||
static void handle_suspend(DBusConnection *conn, DBusMessage *msg, void *userdata) {
|
||||
pa_dbusiface_device *d = userdata;
|
||||
dbus_bool_t suspend = FALSE;
|
||||
dbus_bool_t suspend = false;
|
||||
pa_client *client;
|
||||
|
||||
pa_assert(conn);
|
||||
|
|
@ -1074,7 +1074,7 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
|
|||
pa_dbusiface_device *d = userdata;
|
||||
DBusMessage *signal_msg = NULL;
|
||||
const pa_cvolume *new_volume = NULL;
|
||||
pa_bool_t new_mute = FALSE;
|
||||
bool new_mute = false;
|
||||
pa_sink_state_t new_sink_state = 0;
|
||||
pa_source_state_t new_source_state = 0;
|
||||
pa_device_port *new_active_port = NULL;
|
||||
|
|
@ -1096,8 +1096,8 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
|
|||
&& ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE)));
|
||||
|
||||
new_volume = (d->type == PA_DEVICE_TYPE_SINK)
|
||||
? pa_sink_get_volume(d->sink, FALSE)
|
||||
: pa_source_get_volume(d->source, FALSE);
|
||||
? pa_sink_get_volume(d->sink, false)
|
||||
: pa_source_get_volume(d->source, false);
|
||||
|
||||
if (!pa_cvolume_equal(&d->volume, new_volume)) {
|
||||
dbus_uint32_t volume[PA_CHANNELS_MAX];
|
||||
|
|
@ -1120,7 +1120,7 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
|
|||
signal_msg = NULL;
|
||||
}
|
||||
|
||||
new_mute = (d->type == PA_DEVICE_TYPE_SINK) ? pa_sink_get_mute(d->sink, FALSE) : pa_source_get_mute(d->source, FALSE);
|
||||
new_mute = (d->type == PA_DEVICE_TYPE_SINK) ? pa_sink_get_mute(d->sink, false) : pa_source_get_mute(d->source, false);
|
||||
|
||||
if (d->mute != new_mute) {
|
||||
d->mute = new_mute;
|
||||
|
|
@ -1211,8 +1211,8 @@ pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_si
|
|||
d->sink = pa_sink_ref(sink);
|
||||
d->type = PA_DEVICE_TYPE_SINK;
|
||||
d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SINK_OBJECT_NAME, sink->index);
|
||||
d->volume = *pa_sink_get_volume(sink, FALSE);
|
||||
d->mute = pa_sink_get_mute(sink, FALSE);
|
||||
d->volume = *pa_sink_get_volume(sink, false);
|
||||
d->mute = pa_sink_get_mute(sink, false);
|
||||
d->sink_state = pa_sink_get_state(sink);
|
||||
d->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
d->next_port_index = 0;
|
||||
|
|
@ -1245,8 +1245,8 @@ pa_dbusiface_device *pa_dbusiface_device_new_source(pa_dbusiface_core *core, pa_
|
|||
d->source = pa_source_ref(source);
|
||||
d->type = PA_DEVICE_TYPE_SOURCE;
|
||||
d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SOURCE_OBJECT_NAME, source->index);
|
||||
d->volume = *pa_source_get_volume(source, FALSE);
|
||||
d->mute = pa_source_get_mute(source, FALSE);
|
||||
d->volume = *pa_source_get_volume(source, false);
|
||||
d->mute = pa_source_get_mute(source, false);
|
||||
d->source_state = pa_source_get_state(source);
|
||||
d->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||
d->next_port_index = 0;
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ static void handle_unload(DBusConnection *conn, DBusMessage *msg, void *userdata
|
|||
return;
|
||||
}
|
||||
|
||||
pa_module_unload_request(m->module, FALSE);
|
||||
pa_module_unload_request(m->module, false);
|
||||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct pa_dbusiface_stream {
|
|||
dbus_bool_t mute;
|
||||
pa_proplist *proplist;
|
||||
|
||||
pa_bool_t has_volume;
|
||||
bool has_volume;
|
||||
|
||||
pa_dbus_protocol *dbus_protocol;
|
||||
pa_subscription *subscription;
|
||||
|
|
@ -356,7 +356,7 @@ static void handle_get_volume(DBusConnection *conn, DBusMessage *msg, void *user
|
|||
|
||||
static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) {
|
||||
pa_dbusiface_stream *s = userdata;
|
||||
pa_bool_t volume_writable = TRUE;
|
||||
bool volume_writable = true;
|
||||
DBusMessageIter array_iter;
|
||||
int stream_channels = 0;
|
||||
dbus_uint32_t *volume = NULL;
|
||||
|
|
@ -369,7 +369,7 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag
|
|||
pa_assert(iter);
|
||||
pa_assert(s);
|
||||
|
||||
volume_writable = (s->type == STREAM_TYPE_PLAYBACK) ? s->sink_input->volume_writable : FALSE;
|
||||
volume_writable = (s->type == STREAM_TYPE_PLAYBACK) ? s->sink_input->volume_writable : false;
|
||||
|
||||
if (!s->has_volume || !volume_writable) {
|
||||
char *str = stream_to_string(s);
|
||||
|
|
@ -405,7 +405,7 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag
|
|||
new_vol.values[i] = volume[i];
|
||||
}
|
||||
|
||||
pa_sink_input_set_volume(s->sink_input, &new_vol, TRUE, TRUE);
|
||||
pa_sink_input_set_volume(s->sink_input, &new_vol, true, true);
|
||||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
}
|
||||
|
|
@ -427,7 +427,7 @@ static void handle_get_mute(DBusConnection *conn, DBusMessage *msg, void *userda
|
|||
|
||||
static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) {
|
||||
pa_dbusiface_stream *s = userdata;
|
||||
dbus_bool_t mute = FALSE;
|
||||
dbus_bool_t mute = false;
|
||||
|
||||
pa_assert(conn);
|
||||
pa_assert(msg);
|
||||
|
|
@ -441,7 +441,7 @@ static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageI
|
|||
return;
|
||||
}
|
||||
|
||||
pa_sink_input_set_mute(s->sink_input, mute, TRUE);
|
||||
pa_sink_input_set_mute(s->sink_input, mute, true);
|
||||
|
||||
pa_dbus_send_empty_reply(conn, msg);
|
||||
}
|
||||
|
|
@ -621,7 +621,7 @@ static void handle_move(DBusConnection *conn, DBusMessage *msg, void *userdata)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pa_sink_input_move_to(s->sink_input, sink, TRUE) < 0) {
|
||||
if (pa_sink_input_move_to(s->sink_input, sink, true) < 0) {
|
||||
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED,
|
||||
"Moving playback stream %u to sink %s failed.", s->sink_input->index, sink->name);
|
||||
return;
|
||||
|
|
@ -634,7 +634,7 @@ static void handle_move(DBusConnection *conn, DBusMessage *msg, void *userdata)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pa_source_output_move_to(s->source_output, source, TRUE) < 0) {
|
||||
if (pa_source_output_move_to(s->source_output, source, true) < 0) {
|
||||
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED,
|
||||
"Moving record stream %u to source %s failed.", s->source_output->index, source->name);
|
||||
return;
|
||||
|
|
@ -736,12 +736,12 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t
|
|||
}
|
||||
|
||||
if (s->type == STREAM_TYPE_PLAYBACK) {
|
||||
pa_bool_t new_mute = FALSE;
|
||||
bool new_mute = false;
|
||||
|
||||
if (s->has_volume) {
|
||||
pa_cvolume new_volume;
|
||||
|
||||
pa_sink_input_get_volume(s->sink_input, &new_volume, TRUE);
|
||||
pa_sink_input_get_volume(s->sink_input, &new_volume, true);
|
||||
|
||||
if (!pa_cvolume_equal(&s->volume, &new_volume)) {
|
||||
dbus_uint32_t volume[PA_CHANNELS_MAX];
|
||||
|
|
@ -857,7 +857,7 @@ pa_dbusiface_stream *pa_dbusiface_stream_new_playback(pa_dbusiface_core *core, p
|
|||
s->has_volume = pa_sink_input_is_volume_readable(sink_input);
|
||||
|
||||
if (s->has_volume)
|
||||
pa_sink_input_get_volume(sink_input, &s->volume, TRUE);
|
||||
pa_sink_input_get_volume(sink_input, &s->volume, true);
|
||||
else
|
||||
pa_cvolume_init(&s->volume);
|
||||
|
||||
|
|
@ -889,9 +889,9 @@ pa_dbusiface_stream *pa_dbusiface_stream_new_record(pa_dbusiface_core *core, pa_
|
|||
s->source = pa_source_ref(source_output->source);
|
||||
s->sample_rate = source_output->sample_spec.rate;
|
||||
pa_cvolume_init(&s->volume);
|
||||
s->mute = FALSE;
|
||||
s->mute = false;
|
||||
s->proplist = pa_proplist_copy(source_output->proplist);
|
||||
s->has_volume = FALSE;
|
||||
s->has_volume = false;
|
||||
s->dbus_protocol = pa_dbus_protocol_get(source_output->core);
|
||||
s->subscription = pa_subscription_new(source_output->core, PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT, subscription_cb, s);
|
||||
s->send_event_slot = pa_hook_connect(&source_output->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_SEND_EVENT],
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ PA_MODULE_USAGE(
|
|||
"access=local|remote|local,remote "
|
||||
"tcp_port=<port number> "
|
||||
"tcp_listen=<hostname>");
|
||||
PA_MODULE_LOAD_ONCE(TRUE);
|
||||
PA_MODULE_LOAD_ONCE(true);
|
||||
PA_MODULE_AUTHOR("Tanu Kaskinen");
|
||||
PA_MODULE_VERSION(PACKAGE_VERSION);
|
||||
|
||||
|
|
@ -64,8 +64,8 @@ struct connection;
|
|||
|
||||
struct userdata {
|
||||
pa_module *module;
|
||||
pa_bool_t local_access;
|
||||
pa_bool_t remote_access;
|
||||
bool local_access;
|
||||
bool remote_access;
|
||||
uint32_t tcp_port;
|
||||
char *tcp_listen;
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ static void client_send_event_cb(pa_client *c, const char *name, pa_proplist *da
|
|||
static dbus_bool_t user_check_cb(DBusConnection *connection, unsigned long uid, void *data) {
|
||||
pa_log_debug("Allowing connection by user %lu.", uid);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static DBusHandlerResult disconnection_filter_cb(DBusConnection *connection, DBusMessage *message, void *user_data) {
|
||||
|
|
@ -198,12 +198,12 @@ static void connection_new_cb(DBusServer *dbus_server, DBusConnection *new_conne
|
|||
/* FIXME: Here we allow anyone from anywhere to access the server,
|
||||
* anonymously. Access control should be configurable. */
|
||||
dbus_connection_set_unix_user_function(new_connection, user_check_cb, NULL, NULL);
|
||||
dbus_connection_set_allow_anonymous(new_connection, TRUE);
|
||||
dbus_connection_set_allow_anonymous(new_connection, true);
|
||||
}
|
||||
|
||||
c = pa_xnew(struct connection, 1);
|
||||
c->server = s;
|
||||
c->wrap_conn = pa_dbus_wrap_connection_new_from_existing(s->userdata->module->core->mainloop, TRUE, new_connection);
|
||||
c->wrap_conn = pa_dbus_wrap_connection_new_from_existing(s->userdata->module->core->mainloop, true, new_connection);
|
||||
c->client = client;
|
||||
|
||||
c->client->kill = client_kill_cb;
|
||||
|
|
@ -302,7 +302,7 @@ static dbus_bool_t watch_add_cb(DBusWatch *watch, void *data) {
|
|||
|
||||
dbus_watch_set_data(watch, ev, NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Called by D-Bus when a D-Bus fd watch event is removed. */
|
||||
|
|
@ -342,7 +342,7 @@ static dbus_bool_t timeout_add_cb(DBusTimeout *timeout, void *data) {
|
|||
pa_assert(s);
|
||||
|
||||
if (!dbus_timeout_get_enabled(timeout))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
mainloop = s->userdata->module->core->mainloop;
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ static dbus_bool_t timeout_add_cb(DBusTimeout *timeout, void *data) {
|
|||
|
||||
dbus_timeout_set_data(timeout, ev, NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Called by D-Bus when a D-Bus timer event is removed. */
|
||||
|
|
@ -482,7 +482,7 @@ static struct server *start_tcp_server(struct userdata *u) {
|
|||
return s;
|
||||
}
|
||||
|
||||
static int get_access_arg(pa_modargs *ma, pa_bool_t *local_access, pa_bool_t *remote_access) {
|
||||
static int get_access_arg(pa_modargs *ma, bool *local_access, bool *remote_access) {
|
||||
const char *value = NULL;
|
||||
|
||||
pa_assert(ma);
|
||||
|
|
@ -493,14 +493,14 @@ static int get_access_arg(pa_modargs *ma, pa_bool_t *local_access, pa_bool_t *re
|
|||
return 0;
|
||||
|
||||
if (pa_streq(value, "local")) {
|
||||
*local_access = TRUE;
|
||||
*remote_access = FALSE;
|
||||
*local_access = true;
|
||||
*remote_access = false;
|
||||
} else if (pa_streq(value, "remote")) {
|
||||
*local_access = FALSE;
|
||||
*remote_access = TRUE;
|
||||
*local_access = false;
|
||||
*remote_access = true;
|
||||
} else if (pa_streq(value, "local,remote")) {
|
||||
*local_access = TRUE;
|
||||
*remote_access = TRUE;
|
||||
*local_access = true;
|
||||
*remote_access = true;
|
||||
} else
|
||||
return -1;
|
||||
|
||||
|
|
@ -536,8 +536,8 @@ int pa__init(pa_module *m) {
|
|||
|
||||
m->userdata = u = pa_xnew0(struct userdata, 1);
|
||||
u->module = m;
|
||||
u->local_access = TRUE;
|
||||
u->remote_access = FALSE;
|
||||
u->local_access = true;
|
||||
u->remote_access = false;
|
||||
u->tcp_port = PA_DBUS_DEFAULT_PORT;
|
||||
|
||||
if (get_access_arg(ma, &u->local_access, &u->remote_access) < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue