PulseAudio Qt Bindings

device.cpp
1/*
2 SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#include "device.h"
8#include "device_p.h"
9
10namespace PulseAudioQt
11{
12Device::State Device::state() const
13{
14 return d->m_state;
15}
16
17QString Device::description() const
18{
19 return d->m_description;
20}
21
22QString Device::formFactor() const
23{
24 return d->m_formFactor;
25}
26
27quint32 Device::cardIndex() const
28{
29 return d->m_cardIndex;
30}
31
32QList<Port *> Device::ports() const
33{
34 return d->m_ports;
35}
36
37quint32 Device::activePortIndex() const
38{
39 return d->m_activePortIndex;
40}
41
42qint64 Device::baseVolume() const
43{
44 return d->m_baseVolume;
45}
46
47QVariantMap Device::pulseProperties() const
48{
49 return d->m_pulseProperties;
50}
51
53{
54 return d->m_virtualDevice;
55}
56
57Device::Device(QObject *parent)
58 : VolumeObject(parent)
59 , d(new DevicePrivate(this))
60{
61}
62
63DevicePrivate::DevicePrivate(Device *q)
64 : q(q)
65{
66}
67
68Device::State DevicePrivate::stateFromPaState(int value) const
69{
70 switch (value) {
71 case -1: // PA_X_INVALID_STATE
73 case 0: // PA_X_RUNNING
75 case 1: // PA_X_IDLE
76 return Device::IdleState;
77 case 2: // PA_X_SUSPENDED
79 default:
80 return Device::UnknownState;
81 }
82}
83
84Device::~Device()
85{
86}
87
88} // namespace PulseAudioQt
@ SuspendedState
When suspended, actual sink/source access can be closed, for instance.
Definition device.h:47
@ InvalidState
This state is used when the server does not support sink/source state introspection.
Definition device.h:41
@ IdleState
When idle, the sink/source is playing/recording but there is no non-corked sink-input/source-output a...
Definition device.h:45
@ RunningState
Running, sink/source is playing/recording and used by at least one non-corked sink-input/source-outpu...
Definition device.h:43
bool isVirtualDevice() const
Definition device.cpp:52
An PulseObject that has a volume.
The primary namespace of PulseAudioQt.
Definition card.cpp:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.