Notify user when enumerating audio devices

This commit is contained in:
Bill Somerville 2020-09-13 17:12:11 +01:00
parent 617d4eaa7f
commit 5014c62bfa
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
3 changed files with 10 additions and 0 deletions

View File

@ -2806,6 +2806,7 @@ void Configuration::impl::load_audio_devices (QAudio::Mode mode, QComboBox * com
combo_box->clear (); combo_box->clear ();
Q_EMIT self_->enumerating_audio_devices ();
int current_index = -1; int current_index = -1;
auto const& devices = QAudioDeviceInfo::availableDevices (mode); auto const& devices = QAudioDeviceInfo::availableDevices (mode);
Q_FOREACH (auto const& p, devices) Q_FOREACH (auto const& p, devices)

View File

@ -293,6 +293,12 @@ public:
// the fault condition has been rectified or is transient. // the fault condition has been rectified or is transient.
Q_SIGNAL void transceiver_failure (QString const& reason) const; Q_SIGNAL void transceiver_failure (QString const& reason) const;
// signal announces audio devices are being enumerated
//
// As this can take some time, particularly on Linux, consumers
// might like to notify the user.
Q_SIGNAL void enumerating_audio_devices ();
private: private:
class impl; class impl;
pimpl<impl> m_; pimpl<impl> m_;

View File

@ -781,6 +781,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect (&m_config, &Configuration::udp_server_changed, m_messageClient, &MessageClient::set_server); connect (&m_config, &Configuration::udp_server_changed, m_messageClient, &MessageClient::set_server);
connect (&m_config, &Configuration::udp_server_port_changed, m_messageClient, &MessageClient::set_server_port); connect (&m_config, &Configuration::udp_server_port_changed, m_messageClient, &MessageClient::set_server_port);
connect (&m_config, &Configuration::accept_udp_requests_changed, m_messageClient, &MessageClient::enable); connect (&m_config, &Configuration::accept_udp_requests_changed, m_messageClient, &MessageClient::enable);
connect (&m_config, &Configuration::enumerating_audio_devices, [this] () {
showStatusMessage (tr ("Enumerating audio devices"));
});
// set up configurations menu // set up configurations menu
connect (m_multi_settings, &MultiSettings::configurationNameChanged, [this] (QString const& name) { connect (m_multi_settings, &MultiSettings::configurationNameChanged, [this] (QString const& name) {