summaryrefslogtreecommitdiff
path: root/src/modules/module-device-restore.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@jollamobile.com>2012-10-23 18:55:42 +0300
committerColin Guthrie <colin@mageia.org>2012-11-04 10:07:31 +0100
commit485106d5608224b43952d1c0a58ee7f84c72740b (patch)
tree2a5f2cc33ecd2a894279a4fcc588cfbbb8f04006 /src/modules/module-device-restore.c
parent3e5b872dc2f8372824dc21324152d257b990d9f8 (diff)
device-restore: When restoring volume, print the restored volume to the log.
Diffstat (limited to 'src/modules/module-device-restore.c')
-rw-r--r--src/modules/module-device-restore.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index b9bd498e5..16acfd8d2 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -779,12 +779,13 @@ static pa_hook_result_t sink_fixate_hook_callback(pa_core *c, pa_sink_new_data *
if (!new_data->volume_is_set) {
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for sink %s.", new_data->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &new_data->channel_map);
pa_sink_new_data_set_volume(new_data, &v);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &new_data->volume));
new_data->save_volume = TRUE;
} else
@@ -823,14 +824,15 @@ static pa_hook_result_t sink_port_hook_callback(pa_core *c, pa_sink *sink, struc
if ((e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
if (u->restore_volume && e->volume_valid) {
-
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for sink %s.", sink->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &sink->channel_map);
pa_sink_set_volume(sink, &v, TRUE, FALSE);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &sink->reference_volume));
+
sink->save_volume = TRUE;
}
@@ -920,12 +922,13 @@ static pa_hook_result_t source_fixate_hook_callback(pa_core *c, pa_source_new_da
if (!new_data->volume_is_set) {
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for source %s.", new_data->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &new_data->channel_map);
pa_source_new_data_set_volume(new_data, &v);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &new_data->volume));
new_data->save_volume = TRUE;
} else
@@ -964,14 +967,15 @@ static pa_hook_result_t source_port_hook_callback(pa_core *c, pa_source *source,
if ((e = perportentry_read(u, name, (source->active_port ? source->active_port->name : NULL)))) {
if (u->restore_volume && e->volume_valid) {
-
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for source %s.", source->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &source->channel_map);
pa_source_set_volume(source, &v, TRUE, FALSE);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &source->reference_volume));
+
source->save_volume = TRUE;
}