PulseAudio Qt Bindings

device.cpp
1 /*
2  SPDX-FileCopyrightText: 2014-2015 Harald Sitter <[email protected]>
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 
10 namespace PulseAudioQt
11 {
12 Device::State Device::state() const
13 {
14  return d->m_state;
15 }
16 
17 QString Device::description() const
18 {
19  return d->m_description;
20 }
21 
22 QString Device::formFactor() const
23 {
24  return d->m_formFactor;
25 }
26 
27 quint32 Device::cardIndex() const
28 {
29  return d->m_cardIndex;
30 }
31 
32 QList<Port *> Device::ports() const
33 {
34  return d->m_ports;
35 }
36 
37 quint32 Device::activePortIndex() const
38 {
39  return d->m_activePortIndex;
40 }
41 
42 Device::Device(QObject *parent)
43  : VolumeObject(parent)
44  , d(new DevicePrivate(this))
45 {
46 }
47 
48 DevicePrivate::DevicePrivate(Device *q)
49  : q(q)
50 {
51 }
52 
53 Device::State DevicePrivate::stateFromPaState(int value) const
54 {
55  switch (value) {
56  case -1: // PA_X_INVALID_STATE
57  return Device::InvalidState;
58  case 0: // PA_X_RUNNING
59  return Device::RunningState;
60  case 1: // PA_X_IDLE
61  return Device::IdleState;
62  case 2: // PA_X_SUSPENDED
63  return Device::SuspendedState;
64  default:
65  return Device::UnknownState;
66  }
67 }
68 
69 Device::~Device()
70 {
71  delete d;
72 }
73 
74 } // namespace PulseAudioQt
The primary namespace of PulseAudioQt.
Definition: card.cpp:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:12:40 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.