summaryrefslogtreecommitdiffstats
path: root/src/sinkwidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sinkwidget.cc')
-rw-r--r--src/sinkwidget.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sinkwidget.cc b/src/sinkwidget.cc
index 56159e8..7a7aad9 100644
--- a/src/sinkwidget.cc
+++ b/src/sinkwidget.cc
@@ -75,3 +75,28 @@ void SinkWidget::onDefaultToggleButton() {
}
pa_operation_unref(o);
}
+
+void SinkWidget::onPortChange() {
+ Gtk::TreeModel::iterator iter;
+
+ if (updating)
+ return;
+
+ iter = portList->get_active();
+ if (iter)
+ {
+ Gtk::TreeModel::Row row = *iter;
+ if (row)
+ {
+ pa_operation* o;
+ Glib::ustring port = row[portModel.name];
+
+ if (!(o = pa_context_set_sink_port_by_index(get_context(), index, port.c_str(), NULL, NULL))) {
+ show_error(_("pa_context_set_sink_port_by_index() failed"));
+ return;
+ }
+
+ pa_operation_unref(o);
+ }
+ }
+}