Changeset View
Changeset View
Standalone View
Standalone View
src/device.cpp
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | Lesser General Public License for more details. | 15 | Lesser General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "device.h" | 21 | #include "device.h" | ||
22 | 22 | | |||
23 | QPulseAudio::Device::State QPulseAudio::Device::state() const | ||||
24 | { | ||||
25 | return m_state; | ||||
26 | } | ||||
27 | | ||||
23 | QString QPulseAudio::Device::name() const | 28 | QString QPulseAudio::Device::name() const | ||
24 | { | 29 | { | ||
25 | return m_name; | 30 | return m_name; | ||
26 | } | 31 | } | ||
27 | 32 | | |||
28 | QString QPulseAudio::Device::description() const | 33 | QString QPulseAudio::Device::description() const | ||
29 | { | 34 | { | ||
30 | return m_description; | 35 | return m_description; | ||
Show All 13 Lines | |||||
44 | { | 49 | { | ||
45 | return m_activePortIndex; | 50 | return m_activePortIndex; | ||
46 | } | 51 | } | ||
47 | 52 | | |||
48 | QPulseAudio::Device::Device(QObject *parent) | 53 | QPulseAudio::Device::Device(QObject *parent) | ||
49 | : VolumeObject(parent) | 54 | : VolumeObject(parent) | ||
50 | { | 55 | { | ||
51 | } | 56 | } | ||
57 | | ||||
58 | QPulseAudio::Device::State QPulseAudio::Device::stateFromPaState(int value) const | ||||
59 | { | ||||
60 | switch (value) { | ||||
61 | case -1: // PA_X_INVALID_STATE | ||||
62 | return InvalidState; | ||||
63 | case 0: // PA_X_RUNNING | ||||
davidedmundson: Use the values from pa_sink_state ? | |||||
libpulse has pa_sink_state and pa_source_state, but here it is in Device - so for both sink and source. I can change it to use either PA_SOURCE_* or PA_SINK_* values (which are both exactly the same) but it won't be entirely "correct" (same as just using integer values). drosca: libpulse has pa_sink_state and pa_source_state, but here it is in Device - so for both sink and… | |||||
64 | return RunningState; | ||||
65 | case 1: // PA_X_IDLE | ||||
66 | return IdleState; | ||||
67 | case 2: // PA_X_SUSPENDED | ||||
68 | return SuspendedState; | ||||
69 | default: | ||||
70 | return UnknownState; | ||||
71 | } | ||||
72 | } |
Use the values from pa_sink_state ?