File indexing completed on 2024-09-08 05:01:26
0001 /* 0002 SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #include "device.h" 0008 0009 QPulseAudio::Device::State QPulseAudio::Device::state() const 0010 { 0011 return m_state; 0012 } 0013 0014 QString QPulseAudio::Device::name() const 0015 { 0016 return m_name; 0017 } 0018 0019 QString QPulseAudio::Device::description() const 0020 { 0021 return m_description; 0022 } 0023 0024 QString QPulseAudio::Device::formFactor() const 0025 { 0026 return m_formFactor; 0027 } 0028 0029 quint32 QPulseAudio::Device::cardIndex() const 0030 { 0031 return m_cardIndex; 0032 } 0033 0034 QList<QObject *> QPulseAudio::Device::ports() const 0035 { 0036 return m_ports; 0037 } 0038 0039 quint32 QPulseAudio::Device::activePortIndex() const 0040 { 0041 return m_activePortIndex; 0042 } 0043 0044 bool QPulseAudio::Device::isVirtualDevice() const 0045 { 0046 return m_virtualDevice; 0047 } 0048 0049 QVariantMap QPulseAudio::Device::pulseProperties() const 0050 { 0051 return m_pulseProperties; 0052 } 0053 0054 QPulseAudio::Device::Device(QObject *parent) 0055 : VolumeObject(parent) 0056 { 0057 } 0058 0059 QPulseAudio::Device::State QPulseAudio::Device::stateFromPaState(int value) const 0060 { 0061 switch (value) { 0062 case -1: // PA_X_INVALID_STATE 0063 return InvalidState; 0064 case 0: // PA_X_RUNNING 0065 return RunningState; 0066 case 1: // PA_X_IDLE 0067 return IdleState; 0068 case 2: // PA_X_SUSPENDED 0069 return SuspendedState; 0070 default: 0071 return UnknownState; 0072 } 0073 }