diff options
author | Simon Rettberg | 2022-08-18 20:27:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-08-18 20:27:25 +0200 |
commit | c48cebd620d3f5330c104d85ac32f0aaffadaa14 (patch) | |
tree | 8fc74d8aa05fcdc75bfcdf93fdc89c0f071692eb /src/PulseAudioQt/port_p.h | |
parent | When changing default output of card, also set default sink (diff) | |
download | pavucontrol-slx-c48cebd620d3f5330c104d85ac32f0aaffadaa14.tar.gz pavucontrol-slx-c48cebd620d3f5330c104d85ac32f0aaffadaa14.tar.xz pavucontrol-slx-c48cebd620d3f5330c104d85ac32f0aaffadaa14.zip |
Replace everything with new "slxmix" (work in progress)
Diffstat (limited to 'src/PulseAudioQt/port_p.h')
-rw-r--r-- | src/PulseAudioQt/port_p.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/PulseAudioQt/port_p.h b/src/PulseAudioQt/port_p.h new file mode 100644 index 0000000..7501c66 --- /dev/null +++ b/src/PulseAudioQt/port_p.h @@ -0,0 +1,47 @@ +/* + SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de> + + SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL +*/ + +#pragma once + +#include "port.h" +#include "profile_p.h" +#include <pulse/def.h> + +namespace PulseAudioQt +{ +class PortPrivate +{ +public: + explicit PortPrivate(Port *q); + virtual ~PortPrivate(); + + Port *q; + Port::Type m_type = Port::Type::Unknown; + + template<typename PAInfo> + void setInfo(const PAInfo *info) + { + Profile::Availability newAvailability; + switch (info->available) { + case PA_PORT_AVAILABLE_NO: + newAvailability = Profile::Unavailable; + break; + case PA_PORT_AVAILABLE_YES: + newAvailability = Profile::Available; + break; + default: + newAvailability = Profile::Unknown; + } + +#if PA_CHECK_VERSION(14, 0, 0) + m_type = static_cast<Port::Type>(info->type); +#endif + Q_EMIT q->typeChanged(); + + q->Profile::d->setCommonInfo(info, newAvailability); + } +}; +} |