Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qaudioengine_pulse_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPULSEAUDIOENGINE_H
5#define QPULSEAUDIOENGINE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qmap.h>
19#include <QtCore/qbytearray.h>
20#include <QtCore/qreadwritelock.h>
21#include <pulse/pulseaudio.h>
22#include "qpulsehelpers_p.h"
23#include <qaudioformat.h>
24
26
28{
30
31public:
34
36 pa_threaded_mainloop *mainloop() { return m_mainLoop; }
37 pa_context *context() { return m_context; }
38
39 inline void lock()
40 {
41 if (m_mainLoop)
42 pa_threaded_mainloop_lock(m_mainLoop);
43 }
44
45 inline void unlock()
46 {
47 if (m_mainLoop)
48 pa_threaded_mainloop_unlock(m_mainLoop);
49 }
50
51 inline void wait(pa_operation *op)
52 {
53 while (m_mainLoop && pa_operation_get_state(op) == PA_OPERATION_RUNNING)
54 pa_threaded_mainloop_wait(m_mainLoop);
55 }
56
57 QList<QAudioDevice> availableDevices(QAudioDevice::Mode mode) const;
59
64
65private Q_SLOTS:
66 void prepare();
67 void onContextFailed();
68
69private:
70 void updateDevices();
71 void release();
72
73public:
74 QMap<int, QAudioDevice> m_sinks;
75 QMap<int, QAudioDevice> m_sources;
76
79
83
84private:
85 pa_mainloop_api *m_mainLoopApi;
86 pa_threaded_mainloop *m_mainLoop;
87 pa_context *m_context;
88 bool m_prepared;
89 };
90
92
93#endif
Mode
Describes the mode of this device.
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QReadWriteLock m_sinkLock
QMap< int, QAudioDevice > m_sinks
static QPulseAudioEngine * instance()
QPulseAudioEngine(QObject *parent=0)
pa_threaded_mainloop * mainloop()
QByteArray defaultDevice(QAudioDevice::Mode mode) const
void audioOutputsChanged()
QMap< int, QAudioDevice > m_sources
void wait(pa_operation *op)
QList< QAudioDevice > availableDevices(QAudioDevice::Mode mode) const
QReadWriteLock m_sourceLock
void audioInputsChanged()
QReadWriteLock m_serverLock
\inmodule QtCore
Combined button and popup list for selecting options.
GLenum mode
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS