From 9d0bc6561abe0ca119a4f941ee36e9a0e688bc7b Mon Sep 17 00:00:00 2001 From: Be Date: Mon, 30 Sep 2019 12:56:19 -0500 Subject: [PATCH] SoundDeviceId: add comments; code formatting --- src/soundio/soundmanagerutil.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index a8fb7190b17..aa9e5c5af3f 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -200,6 +200,8 @@ typedef AudioPath::AudioPathType AudioPathType; class SoundDeviceId { public: QString name; + // The "hw:X,Y" device name. Remains an empty string if not using ALSA + // or using a non-hw ALSA device such as "default" or "pulse". QString alsaHwDevice; int portAudioIndex; @@ -210,10 +212,16 @@ class SoundDeviceId { return name + ", " + alsaHwDevice + ", " + QString::number(portAudioIndex); } } - SoundDeviceId() : - name(""), alsaHwDevice(""), portAudioIndex(-1) {}; + + SoundDeviceId() + : name(""), + alsaHwDevice(""), + portAudioIndex(-1) {}; }; +// This must be registered with QMetaType::registerComparators for +// QVariant::operator== to use it, which is required for QComboBox::findData to +// work in DlgPrefSoundItem. inline bool operator==(const SoundDeviceId& lhs, const SoundDeviceId& rhs) { return lhs.name == rhs.name && lhs.alsaHwDevice == rhs.alsaHwDevice