blob: c30df8b5058e2809dff09ee00b0941c3e4ac1cf1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*
SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "device.h"
#include "device_p.h"
namespace PulseAudioQt
{
Device::State Device::state() const
{
return d->m_state;
}
QString Device::description() const
{
return d->m_description;
}
QString Device::formFactor() const
{
return d->m_formFactor;
}
quint32 Device::cardIndex() const
{
return d->m_cardIndex;
}
QList<Port *> Device::ports() const
{
return d->m_ports;
}
quint32 Device::activePortIndex() const
{
return d->m_activePortIndex;
}
Device::Device(QObject *parent)
: VolumeObject(parent)
, d(new DevicePrivate(this))
{
}
DevicePrivate::DevicePrivate(Device *q)
: q(q)
{
}
Device::State DevicePrivate::stateFromPaState(int value) const
{
switch (value) {
case -1: // PA_X_INVALID_STATE
return Device::InvalidState;
case 0: // PA_X_RUNNING
return Device::RunningState;
case 1: // PA_X_IDLE
return Device::IdleState;
case 2: // PA_X_SUSPENDED
return Device::SuspendedState;
default:
return Device::UnknownState;
}
}
Device::~Device()
{
delete d;
}
} // namespace PulseAudioQt
|