summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klemkow <web2p10@wemelug.de>2010-07-13 18:01:48 +0200
committerJan Klemkow <web2p10@wemelug.de>2010-07-13 18:01:48 +0200
commitaa7ef2d6681b05deb458e4dc94a4a9cc8940790e (patch)
treee4462d8b9f64065fea66f2ca70542e1e8404d76a
parent5423f68eb39adb4cc0165032efb7d53d38ccd10c (diff)
downloadpa-sink-ctl-aa7ef2d6681b05deb458e4dc94a4a9cc8940790e.tar.gz
pa-sink-ctl-aa7ef2d6681b05deb458e4dc94a4a9cc8940790e.tar.bz2
pa-sink-ctl-aa7ef2d6681b05deb458e4dc94a4a9cc8940790e.zip
change sink-name to sink-device
sink-device is the name of the device
-rw-r--r--src/interface.c2
-rw-r--r--src/pa-sink-ctl.c2
-rw-r--r--src/sink.c4
-rw-r--r--src/sink.h1
4 files changed, 8 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index f6c1ab6..aa7c96c 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -80,7 +80,7 @@ void print_sink_list(void) {
mvwprintw(menu_win, y+i+offset, x, "%2d %-13s",
sink_list[i]->index,
- sink_list[i]->name);
+ sink_list[i]->device);
if (i == chooser_sink && chooser_input == -1)
wattroff(menu_win, A_REVERSE);
diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c
index 1417064..13ab681 100644
--- a/src/pa-sink-ctl.c
+++ b/src/pa-sink-ctl.c
@@ -114,6 +114,8 @@ void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_last, v
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_list[sink_counter]->device = strdup(pa_proplist_gets(i->proplist, "device.product.name"));
+
++sink_counter;
}
diff --git a/src/sink.c b/src/sink.c
index 01f0e04..c5ac593 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -15,6 +15,7 @@ sink_info* sink_init(void) {
sink_info* sink = (sink_info*) calloc(1, sizeof(sink_info));
sink->name = NULL;
+ sink->device = NULL;
sink->input_counter = 0;
sink->input_max = 1;
sink->input_list = NULL;
@@ -31,6 +32,9 @@ void sink_clear(sink_info* sink) {
if (sink->name != NULL)
free(sink->name);
+
+ if (sink->device != NULL)
+ free(sink->device);
sink_input_list_clear(sink->input_list, &sink->input_max);
diff --git a/src/sink.h b/src/sink.h
index 8bd1624..e47b8ff 100644
--- a/src/sink.h
+++ b/src/sink.h
@@ -12,6 +12,7 @@
typedef struct _sink_info {
uint32_t index;
char* name;
+ char* device;
int mute;
uint8_t channels;
pa_volume_t vol;