From 2feedb2d1b438ecf1fe9b28465d738c72cf71d06 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Fri, 8 May 2020 13:14:39 +0200 Subject: [PATCH 1/7] Add optional seed = 0 parameter to qHash functions --- src/effects/defs.h | 6 ++++-- src/engine/channelhandle.h | 12 +++++++---- src/preferences/configobject.h | 13 ++++++++---- src/soundio/soundmanagerutil.cpp | 23 -------------------- src/soundio/soundmanagerutil.h | 36 ++++++++++++++++++++++---------- src/track/trackfile.h | 4 +++- src/track/trackref.h | 8 +++++-- src/util/db/dbid.h | 6 ++++-- 8 files changed, 59 insertions(+), 49 deletions(-) diff --git a/src/effects/defs.h b/src/effects/defs.h index c6ce474f90e..6393cf4b329 100644 --- a/src/effects/defs.h +++ b/src/effects/defs.h @@ -22,8 +22,10 @@ enum class SignalProcessingStage { Postfader }; -inline uint qHash(SignalProcessingStage stage) { - return static_cast(stage); +inline uint qHash( + SignalProcessingStage stage, + uint seed = 0) { + return qHash(static_cast(stage), seed); }; enum class EffectChainMixMode { diff --git a/src/engine/channelhandle.h b/src/engine/channelhandle.h index 239f0c20dc3..86d891c324f 100644 --- a/src/engine/channelhandle.h +++ b/src/engine/channelhandle.h @@ -66,8 +66,10 @@ inline QDebug operator<<(QDebug stream, const ChannelHandle& h) { return stream; } -inline uint qHash(const ChannelHandle& handle) { - return qHash(handle.handle()); +inline uint qHash( + const ChannelHandle& handle, + uint seed = 0) { + return qHash(handle.handle(), seed); } // Convenience class that mimics QPair except with @@ -104,8 +106,10 @@ inline QDebug operator<<(QDebug stream, const ChannelHandleAndGroup& g) { return stream; } -inline uint qHash(const ChannelHandleAndGroup& handle_group) { - return qHash(handle_group.handle()); +inline uint qHash( + const ChannelHandleAndGroup& handle_group, + uint seed = 0) { + return qHash(handle_group.handle(), seed); } // A helper class used by EngineMaster to assign ChannelHandles to channel group diff --git a/src/preferences/configobject.h b/src/preferences/configobject.h index 93d1b242523..6f261ebb635 100644 --- a/src/preferences/configobject.h +++ b/src/preferences/configobject.h @@ -64,8 +64,11 @@ inline QDebug operator<<(QDebug stream, const ConfigKey& configKey) { } // QHash hash function for ConfigKey objects. -inline uint qHash(const ConfigKey& key) { - return qHash(key.group) ^ qHash(key.item); +inline uint qHash( + const ConfigKey& key, + uint seed = 0) { + return qHash(key.group, seed) ^ + qHash(key.item, seed); } // The value corresponding to a key. The basic value is a string, but can be @@ -97,8 +100,10 @@ inline bool operator!=(const ConfigValue& lhs, const ConfigValue& rhs) { return !(lhs == rhs); } -inline uint qHash(const ConfigValue& key) { - return qHash(key.value.toUpper()); +inline uint qHash( + const ConfigValue& key, + uint seed = 0) { + return qHash(key.value.toUpper(), seed); } class ConfigValueKbd : public ConfigValue { diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index 91041ad1b28..6a24c9c3d9f 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -69,14 +69,6 @@ bool ChannelGroup::clashesWith(const ChannelGroup &other) const { || m_channelBase == other.m_channelBase; } -/** - * Generates a hash of this ChannelGroup, so it can act as a key in a QHash. - * @return a hash for this ChannelGroup - */ -unsigned int ChannelGroup::getHash() const { - return 0 | (m_channels << 8) | m_channelBase; -} - /** * Constructs an AudioPath object (must be called by a child class's * constructor, AudioPath is abstract). @@ -119,14 +111,6 @@ bool AudioPath::operator==(const AudioPath &other) const { && m_index == other.m_index; } -/** - * Generates a hash of this AudioPath, so it can act as a key in a QHash. - * @return a hash for this AudioPath - */ -unsigned int AudioPath::getHash() const { - return 0 | (m_type << 8) | m_index; -} - /** * Checks if this AudioPath's channels clash with another's * (see ChannelGroup::clashesWith). @@ -470,13 +454,6 @@ QString SoundDeviceId::debugName() const { } } -/** - * Defined for QHash, so ChannelGroup can be used as a QHash key. - */ -unsigned int qHash(const ChannelGroup &group) { - return group.getHash(); -} - /** * Defined for QHash, so AudioOutput can be used as a QHash key. */ diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index 6cd757e00de..dff1cd5eaa3 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -30,14 +30,21 @@ * Mixxx. */ class ChannelGroup { -public: + public: ChannelGroup(unsigned char channelBase, unsigned char channels); unsigned char getChannelBase() const; unsigned char getChannelCount() const; - bool operator==(const ChannelGroup &other) const; - bool clashesWith(const ChannelGroup &other) const; - unsigned int getHash() const; -private: + bool operator==(const ChannelGroup& other) const; + bool clashesWith(const ChannelGroup& other) const; + + friend uint qHash( + const ChannelGroup& group, + uint seed = 0) { + return qHash(group.m_channelBase, seed) | + qHash(group.m_channels, seed); + } + + private: unsigned char m_channelBase; // base (first) channel used on device unsigned char m_channels; // number of channels used (s/b 2 in most cases) }; @@ -71,7 +78,6 @@ class AudioPath { ChannelGroup getChannelGroup() const; unsigned char getIndex() const; bool operator==(const AudioPath &other) const; - unsigned int getHash() const; bool channelsClash(const AudioPath &other) const; QString getString() const; static QString getStringFromType(AudioPathType type); @@ -88,6 +94,13 @@ class AudioPath { // AudioPathType. static unsigned char maxChannelsForType(AudioPathType type); + friend uint qHash( + const AudioPath& path, + uint seed = 0) { + return qHash(static_cast(path.m_type), seed) ^ + qHash(path.m_index, seed); + } + protected: virtual void setType(AudioPathType type) = 0; AudioPathType m_type; @@ -227,17 +240,18 @@ inline bool operator<(const SoundDeviceId& lhs, const SoundDeviceId& rhs) { Q_DECLARE_METATYPE(SoundDeviceId); -inline unsigned int qHash(const SoundDeviceId& id) { - return qHash(id.name) + qHash(id.alsaHwDevice) + id.portAudioIndex; +inline uint qHash( + const SoundDeviceId& id, + uint seed = 0) { + return qHash(id.name, seed) ^ + qHash(id.alsaHwDevice, seed) ^ + qHash(id.portAudioIndex, seed); } inline QDebug operator<<(QDebug dbg, const SoundDeviceId& soundDeviceId) { return dbg << QString("SoundDeviceId(" + soundDeviceId.debugName() + ")"); } -// globals for QHash -unsigned int qHash(const ChannelGroup &group); unsigned int qHash(const AudioOutput &output); unsigned int qHash(const AudioInput &input); - #endif diff --git a/src/track/trackfile.h b/src/track/trackfile.h index 96c73f4a3aa..7e037840a94 100644 --- a/src/track/trackfile.h +++ b/src/track/trackfile.h @@ -124,6 +124,8 @@ inline QDebug operator<<(QDebug debug, const TrackFile& trackFile) { #endif } -inline uint qHash(const TrackFile& key, uint seed) { +inline uint qHash( + const TrackFile& key, + uint seed = 0) { return qHash(key.location(), seed); } diff --git a/src/track/trackref.h b/src/track/trackref.h index 7a60e045cef..ef238dad0e6 100644 --- a/src/track/trackref.h +++ b/src/track/trackref.h @@ -116,6 +116,10 @@ std::ostream& operator<<(std::ostream& os, const TrackRef& trackRef); QDebug operator<<(QDebug debug, const TrackRef& trackRef); -inline uint qHash(const TrackRef& key, uint seed) { - return qHash(key.getLocation(), seed) ^ qHash(key.getId(), seed); +inline uint qHash( + const TrackRef& key, + uint seed = 0) { + return qHash( + key.getLocation(), seed) ^ + qHash(key.getId(), seed); } diff --git a/src/util/db/dbid.h b/src/util/db/dbid.h index bbbd433f56c..a5d68f4a8f7 100644 --- a/src/util/db/dbid.h +++ b/src/util/db/dbid.h @@ -102,8 +102,10 @@ class DbId { return debug << dbId.m_value; } - friend uint qHash(const DbId& dbId) { - return qHash(dbId.m_value); + friend uint qHash( + const DbId& dbId, + uint seed = 0) { + return qHash(dbId.m_value, seed); } private: From 4cd4140ee7aaab438571303d07c47ce803a2a582 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Fri, 8 May 2020 13:35:40 +0200 Subject: [PATCH 2/7] AudioPath: Add missing member to qHash calculation --- src/soundio/soundmanagerutil.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index dff1cd5eaa3..0b610ee3ece 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -98,6 +98,7 @@ class AudioPath { const AudioPath& path, uint seed = 0) { return qHash(static_cast(path.m_type), seed) ^ + qHash(path.m_channelGroup, seed) ^ qHash(path.m_index, seed); } From cdb84045dfe81495077bfdf36fcddcc55a85b5b1 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Fri, 8 May 2020 13:36:14 +0200 Subject: [PATCH 3/7] Delete unused and undefined qHash functions --- src/soundio/soundmanagerutil.cpp | 14 -------------- src/soundio/soundmanagerutil.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index 6a24c9c3d9f..e26bd9e921c 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -453,17 +453,3 @@ QString SoundDeviceId::debugName() const { return name + QStringLiteral(", ") + alsaHwDevice + QStringLiteral(", ") + QString::number(portAudioIndex); } } - -/** - * Defined for QHash, so AudioOutput can be used as a QHash key. - */ -unsigned int qHash(const AudioOutput &output) { - return output.getHash(); -} - -/** - * Defined for QHash, so AudioInput can be used as a QHash key. - */ -unsigned int qHash(const AudioInput &input) { - return input.getHash(); -} diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index 0b610ee3ece..9bf2bf8a2f7 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -253,6 +253,4 @@ inline QDebug operator<<(QDebug dbg, const SoundDeviceId& soundDeviceId) { return dbg << QString("SoundDeviceId(" + soundDeviceId.debugName() + ")"); } -unsigned int qHash(const AudioOutput &output); -unsigned int qHash(const AudioInput &input); #endif From 30f3556e56b516cb10dfde963d74df76217e7c2a Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 9 May 2020 12:42:07 +0200 Subject: [PATCH 4/7] Fix operator==/!= definitions --- src/soundio/soundmanagerutil.cpp | 10 ---------- src/soundio/soundmanagerutil.h | 24 ++++++++++++++++++++++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index e26bd9e921c..36eadb4fd94 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -41,16 +41,6 @@ unsigned char ChannelGroup::getChannelCount() const { return m_channels; } -/** - * Defines equality between two ChannelGroups. - * @return true if the two ChannelGroups share a common base channel - * and channel count, otherwise false. - */ -bool ChannelGroup::operator==(const ChannelGroup &other) const { - return m_channelBase == other.m_channelBase - && m_channels == other.m_channels; -} - /** * Checks if another ChannelGroup shares channels with this one. * @param other the other ChannelGroup to check for a clash with. diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index 9bf2bf8a2f7..a7afc2954be 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -34,7 +34,6 @@ class ChannelGroup { ChannelGroup(unsigned char channelBase, unsigned char channels); unsigned char getChannelBase() const; unsigned char getChannelCount() const; - bool operator==(const ChannelGroup& other) const; bool clashesWith(const ChannelGroup& other) const; friend uint qHash( @@ -44,11 +43,24 @@ class ChannelGroup { qHash(group.m_channels, seed); } + friend bool operator==( + const ChannelGroup& lhs, + const ChannelGroup& rhs) { + return lhs.m_channelBase == rhs.m_channelBase && + lhs.m_channels == rhs.m_channels; + } + private: unsigned char m_channelBase; // base (first) channel used on device unsigned char m_channels; // number of channels used (s/b 2 in most cases) }; +inline bool operator!=( + const ChannelGroup& lhs, + const ChannelGroup& rhs) { + return !(lhs == rhs); +} + /** * @class AudioPath * @brief Describes a path for audio to take. @@ -228,12 +240,20 @@ class SoundDeviceId { // 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) { +inline bool operator==( + const SoundDeviceId& lhs, + const SoundDeviceId& rhs) { return lhs.name == rhs.name && lhs.alsaHwDevice == rhs.alsaHwDevice && lhs.portAudioIndex == rhs.portAudioIndex; } +inline bool operator!=( + const SoundDeviceId& lhs, + const SoundDeviceId& rhs) { + return !(lhs == rhs); +} + // There is not really a use case for this, but it is required for QMetaType::registerComparators. inline bool operator<(const SoundDeviceId& lhs, const SoundDeviceId& rhs) { return lhs.portAudioIndex < rhs.portAudioIndex; From 16c67a7ffe98e423ecbb1fb390c81cd79670deb4 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 9 May 2020 12:42:42 +0200 Subject: [PATCH 5/7] Add debug assertion to a function that should never be invoked --- src/soundio/soundmanagerutil.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index a7afc2954be..ab80097eb7a 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -256,6 +256,7 @@ inline bool operator!=( // There is not really a use case for this, but it is required for QMetaType::registerComparators. inline bool operator<(const SoundDeviceId& lhs, const SoundDeviceId& rhs) { + DEBUG_ASSERT(!"should never be invoked"); return lhs.portAudioIndex < rhs.portAudioIndex; } From 2e3a7226b2e01d7462cb83800d4dfa1fa6a6302e Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 9 May 2020 12:43:11 +0200 Subject: [PATCH 6/7] Add missing virtual destructors to inheritance hierarchy --- src/soundio/soundmanagerutil.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index ab80097eb7a..77803b59f01 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -86,6 +86,8 @@ class AudioPath { INVALID, // if this isn't last bad things will happen -bkgood }; AudioPath(unsigned char channelBase, unsigned char channels); + virtual ~AudioPath() = default; + AudioPathType getType() const; ChannelGroup getChannelGroup() const; unsigned char getIndex() const; @@ -132,7 +134,7 @@ class AudioOutput : public AudioPath { AudioOutput(AudioPathType type, unsigned char channelBase, unsigned char channels, unsigned char index = 0); - virtual ~AudioOutput(); + ~AudioOutput() override; QDomElement toXML(QDomElement *element) const; static AudioOutput fromXML(const QDomElement &xml); static QList getSupportedTypes(); @@ -149,6 +151,7 @@ class AudioOutputBuffer : public AudioOutput { m_pBuffer(pBuffer) { }; + ~AudioOutputBuffer() override = default; inline const CSAMPLE* getBuffer() const { return m_pBuffer; } private: const CSAMPLE* m_pBuffer; @@ -164,7 +167,7 @@ class AudioInput : public AudioPath { public: AudioInput(AudioPathType type = INVALID, unsigned char channelBase = 0, unsigned char channels = 0, unsigned char index = 0); - virtual ~AudioInput(); + ~AudioInput() override; QDomElement toXML(QDomElement *element) const; static AudioInput fromXML(const QDomElement &xml); static QList getSupportedTypes(); @@ -181,6 +184,7 @@ class AudioInputBuffer : public AudioInput { m_pBuffer(pBuffer) { } + ~AudioInputBuffer() override = default; inline CSAMPLE* getBuffer() const { return m_pBuffer; } private: CSAMPLE* m_pBuffer; @@ -189,6 +193,8 @@ class AudioInputBuffer : public AudioInput { class AudioSource { public: + virtual ~AudioSource() = default; + virtual const CSAMPLE* buffer(AudioOutput output) const = 0; // This is called by SoundManager whenever an output is connected for this @@ -204,6 +210,8 @@ class AudioSource { class AudioDestination { public: + virtual ~AudioDestination() = default; + // This is called by SoundManager whenever there are new samples from the // configured input to be processed. This is run in the clock reference // callback thread @@ -223,7 +231,7 @@ class AudioDestination { typedef AudioPath::AudioPathType AudioPathType; -class SoundDeviceId { +class SoundDeviceId final { public: QString name; // The "hw:X,Y" device name. Remains an empty string if not using ALSA From 09bb5400ba953e3c4dece221d0a2b5c3b56aae51 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 13 May 2020 16:45:20 +0200 Subject: [PATCH 7/7] Update #include guards and doc comments in header file --- src/soundio/soundmanagerutil.h | 107 ++++++++++++--------------------- 1 file changed, 38 insertions(+), 69 deletions(-) diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index 77803b59f01..a98f34ad5d6 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -1,20 +1,4 @@ -/** - * @file soundmanagerutil.h - * @author Bill Good - * @date 20100611 - */ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef SOUNDMANAGERUTIL_U -#define SOUNDMANAGERUTIL_U +#pragma once #include #include @@ -24,11 +8,7 @@ #include "util/types.h" #include "util/fifo.h" -/** - * @class ChannelGroup - * @brief Describes a group of channels, typically a pair for stereo sound in - * Mixxx. - */ +/// Describes a group of channels, typically a pair for stereo sound in Mixxx. class ChannelGroup { public: ChannelGroup(unsigned char channelBase, unsigned char channels); @@ -61,18 +41,17 @@ inline bool operator!=( return !(lhs == rhs); } -/** - * @class AudioPath - * @brief Describes a path for audio to take. - * @note This needs a new name, the current one sucks. If you find one, - * feel free to rename as necessary. - */ +/// Describes a path for audio to take. +/// +/// TODO: Choose a better name for this class class AudioPath { public: - // XXX if you add a new type here, be sure to add it to the various - // methods including getStringFromType, isIndexed, getTypeFromInt, - // channelsNeededForType (if necessary), the subclasses' getSupportedTypes - // (if necessary), etc. -- bkgood + /// Predefined types. + /// + /// If you add a new type here, be sure to add it to the various + /// methods including getStringFromType, isIndexed, getTypeFromInt, + /// channelsNeededForType (if necessary), the subclasses' getSupportedTypes + /// (if necessary), etc. enum AudioPathType { MASTER, HEADPHONES, @@ -100,8 +79,8 @@ class AudioPath { static bool isIndexed(AudioPathType type); static AudioPathType getTypeFromInt(int typeInt); - // Returns the minimum number of channels needed on a sound device for an - // AudioPathType. + /// Returns the minimum number of channels needed on a sound device for an + /// AudioPathType. static unsigned char minChannelsForType(AudioPathType type); // Returns the maximum number of channels needed on a sound device for an @@ -123,12 +102,8 @@ class AudioPath { unsigned char m_index; }; -/** - * @class AudioOutput - * @extends AudioPath - * @brief A source of audio in Mixxx that is to be output to a group of - * channels on an audio interface. - */ +/// A source of audio in Mixxx that is to be output to a group of +/// channels on an audio interface. class AudioOutput : public AudioPath { public: AudioOutput(AudioPathType type, unsigned char channelBase, @@ -157,12 +132,8 @@ class AudioOutputBuffer : public AudioOutput { const CSAMPLE* m_pBuffer; }; -/** - * @class AudioInput - * @extends AudioPath - * @brief A source of audio at a group of channels on an audio interface - * that is be processed in Mixxx. - */ +/// A source of audio at a group of channels on an audio interface +/// that is be processed in Mixxx. class AudioInput : public AudioPath { public: AudioInput(AudioPathType type = INVALID, unsigned char channelBase = 0, @@ -197,14 +168,14 @@ class AudioSource { virtual const CSAMPLE* buffer(AudioOutput output) const = 0; - // This is called by SoundManager whenever an output is connected for this - // source. When this is called it is guaranteed that no callback is - // active. + /// This is called by SoundManager whenever an output is connected for this + /// source. When this is called it is guaranteed that no callback is + /// active. virtual void onOutputConnected(AudioOutput output) { Q_UNUSED(output); }; - // This is called by SoundManager whenever an output is disconnected for - // this source. When this is called it is guaranteed that no callback is - // active. + /// This is called by SoundManager whenever an output is disconnected for + /// this source. When this is called it is guaranteed that no callback is + /// active. virtual void onOutputDisconnected(AudioOutput output) { Q_UNUSED(output); }; }; @@ -212,20 +183,20 @@ class AudioDestination { public: virtual ~AudioDestination() = default; - // This is called by SoundManager whenever there are new samples from the - // configured input to be processed. This is run in the clock reference - // callback thread + /// This is called by SoundManager whenever there are new samples from the + /// configured input to be processed. This is run in the clock reference + /// callback thread virtual void receiveBuffer(AudioInput input, const CSAMPLE* pBuffer, unsigned int iNumFrames) = 0; - // This is called by SoundManager whenever an input is configured for this - // destination. When this is called it is guaranteed that no callback is - // active. + /// This is called by SoundManager whenever an input is configured for this + /// destination. When this is called it is guaranteed that no callback is + /// active. virtual void onInputConfigured(AudioInput input) { Q_UNUSED(input); }; - // This is called by SoundManager whenever an input is unconfigured for this - // destination. When this is called it is guaranteed that no callback is - // active. + /// This is called by SoundManager whenever an input is unconfigured for this + /// destination. When this is called it is guaranteed that no callback is + /// active. virtual void onInputUnconfigured(AudioInput input) { Q_UNUSED(input); }; }; @@ -234,8 +205,8 @@ typedef AudioPath::AudioPathType AudioPathType; class SoundDeviceId final { 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". + /// 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; @@ -245,9 +216,9 @@ class SoundDeviceId final { : 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. +/// 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) { @@ -262,7 +233,7 @@ inline bool operator!=( return !(lhs == rhs); } -// There is not really a use case for this, but it is required for QMetaType::registerComparators. +/// There is not really a use case for this, but it is required for QMetaType::registerComparators. inline bool operator<(const SoundDeviceId& lhs, const SoundDeviceId& rhs) { DEBUG_ASSERT(!"should never be invoked"); return lhs.portAudioIndex < rhs.portAudioIndex; @@ -281,5 +252,3 @@ inline uint qHash( inline QDebug operator<<(QDebug dbg, const SoundDeviceId& soundDeviceId) { return dbg << QString("SoundDeviceId(" + soundDeviceId.debugName() + ")"); } - -#endif