diff options
-rw-r--r-- | src/pavucontrol.cc | 10 | ||||
-rw-r--r-- | src/pavucontrol.h | 2 | ||||
-rw-r--r-- | src/sinkwidget.cc | 1 | ||||
-rw-r--r-- | src/sourcewidget.cc | 1 |
4 files changed, 14 insertions, 0 deletions
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 4b1d502..4e62f33 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -665,6 +665,16 @@ pa_context* get_context(void) { return context; } +void update_default_sinks(MainWindow *w) { + pa_operation *o; + if (!(o = pa_context_get_server_info(context, server_info_cb, w))) { + show_error(QObject::tr("pa_context_get_server_info() failed").toUtf8().constData()); + return; + } + pa_operation_unref(o); + n_outstanding++; +} + void connectToPulse(void) { pa_proplist *proplist = pa_proplist_new(); pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, QObject::tr("PulseAudio Volume Control").toUtf8().constData()); diff --git a/src/pavucontrol.h b/src/pavucontrol.h index 925be4f..3d7fa88 100644 --- a/src/pavucontrol.h +++ b/src/pavucontrol.h @@ -61,6 +61,8 @@ enum SourceType { SOURCE_MONITOR, }; +class MainWindow; +void update_default_sinks(MainWindow *w); pa_context* get_context(void); void show_error(const char *txt); diff --git a/src/sinkwidget.cc b/src/sinkwidget.cc index 7bec630..f404a0b 100644 --- a/src/sinkwidget.cc +++ b/src/sinkwidget.cc @@ -111,6 +111,7 @@ void SinkWidget::onDefaultToggleButton() { return; } pa_operation_unref(o); + update_default_sinks(mpMainWindow); } void SinkWidget::onPortChange() { diff --git a/src/sourcewidget.cc b/src/sourcewidget.cc index cecd893..6dbfeea 100644 --- a/src/sourcewidget.cc +++ b/src/sourcewidget.cc @@ -65,6 +65,7 @@ void SourceWidget::onDefaultToggleButton() { return; } pa_operation_unref(o); + update_default_sinks(mpMainWindow); } void SourceWidget::onPortChange() { |