Skip to content

Commit

Permalink
SoundDeviceId: add comments; code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Sep 30, 2019
1 parent 8ffb16e commit 9d0bc65
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/soundio/soundmanagerutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 9d0bc65

Please sign in to comment.