summaryrefslogtreecommitdiffstats
path: root/src/sourcewidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sourcewidget.cc')
-rw-r--r--src/sourcewidget.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sourcewidget.cc b/src/sourcewidget.cc
index 94e78b1..2779df4 100644
--- a/src/sourcewidget.cc
+++ b/src/sourcewidget.cc
@@ -75,3 +75,28 @@ void SourceWidget::onDefaultToggleButton() {
}
pa_operation_unref(o);
}
+
+void SourceWidget::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_source_port_by_index(get_context(), index, port.c_str(), NULL, NULL))) {
+ show_error(_("pa_context_set_source_port_by_index() failed"));
+ return;
+ }
+
+ pa_operation_unref(o);
+ }
+ }
+} \ No newline at end of file