summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-13 16:57:16 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-13 16:57:16 +0200
commit28c43b727c113d170e8a55b4b060e409665dd9d7 (patch)
treee076cb7ec988a4ecb2c17aa74acd22de963c9a1e
parent66e647d0254de74ee44535aba4d8e6d99f7031b9 (diff)
downloadpa-sink-ctl-28c43b727c113d170e8a55b4b060e409665dd9d7.tar.gz
pa-sink-ctl-28c43b727c113d170e8a55b4b060e409665dd9d7.tar.bz2
pa-sink-ctl-28c43b727c113d170e8a55b4b060e409665dd9d7.zip
add volume output for sinks
-rw-r--r--src/interface.c1
-rw-r--r--src/pa-sink-ctl.c2
-rw-r--r--src/sink.h1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index dd00c0e..282dd3f 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -84,6 +84,7 @@ void print_sink_list(void) {
if (i == chooser_sink && chooser_input == -1)
wattroff(menu_win, A_REVERSE);
+ print_volume(sink_list[i]->vol, y+i+offset);
print_input_list(i);
diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c
index fce5a84..1417064 100644
--- a/src/pa-sink-ctl.c
+++ b/src/pa-sink-ctl.c
@@ -111,6 +111,8 @@ void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_last, v
sink_check(&(sink_list[sink_counter]));
sink_list[sink_counter]->index = i->index;
sink_list[sink_counter]->mute = i->mute;
+ sink_list[sink_counter]->vol = pa_cvolume_avg(&i->volume);
+ sink_list[sink_counter]->channels = i->volume.channels;
sink_list[sink_counter]->name = strdup(i->name);
++sink_counter;
}
diff --git a/src/sink.h b/src/sink.h
index 03c557f..8bd1624 100644
--- a/src/sink.h
+++ b/src/sink.h
@@ -13,6 +13,7 @@ typedef struct _sink_info {
uint32_t index;
char* name;
int mute;
+ uint8_t channels;
pa_volume_t vol;
// input list