Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcoreaudiosessionmanager_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 IOSAUDIOSESSIONMANAGER_H
5#define IOSAUDIOSESSIONMANAGER_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 <QObject>
19#ifdef QT_DEBUG_COREAUDIO
20# include <QtCore/QDebug>
21#endif
22
23@class CoreAudioSessionObserver;
24
25QT_BEGIN_NAMESPACE
26
27class CoreAudioSessionManager : public QObject
28{
29 Q_OBJECT
30public:
31 enum AudioSessionCategorys {
32 Ambient,
33 SoloAmbient,
34 Playback,
35 Record,
36 PlayAndRecord,
37 MultiRoute
38 };
39 enum AudioSessionCategoryOptions {
40 None = 0,
41 MixWithOthers = 1,
42 DuckOthers = 2,
43 AllowBluetooth = 4,
44 DefaultToSpeaker = 8
45 };
46 enum AudioSessionModes {
47 Default,
48 VoiceChat,
49 GameChat,
50 VideoRecording,
51 Measurement,
52 MoviePlayback
53 };
54
55 static CoreAudioSessionManager& instance();
56
57 bool setActive(bool active);
58 bool setCategory(AudioSessionCategorys category, AudioSessionCategoryOptions options = None);
59 bool setMode(AudioSessionModes mode);
60
61 AudioSessionCategorys category();
62 AudioSessionModes mode();
63
64 QList<QByteArray> inputDevices();
65 QList<QByteArray> outputDevices();
66
67 float currentIOBufferDuration();
68 float preferredSampleRate();
69
70signals:
71 void activeChanged();
72 void categoryChanged();
73 void modeChanged();
74 void routeChanged();
75 void devicesAvailableChanged();
76
77private:
78 CoreAudioSessionManager();
79 ~CoreAudioSessionManager();
80 CoreAudioSessionManager(CoreAudioSessionManager const &copy);
81 CoreAudioSessionManager& operator =(CoreAudioSessionManager const &copy);
82
83 CoreAudioSessionObserver *m_sessionObserver;
84};
85
86#ifdef QT_DEBUG_COREAUDIO
87QDebug operator <<(QDebug dbg, CoreAudioSessionManager::AudioSessionCategorys category);
88QDebug operator <<(QDebug dbg, CoreAudioSessionManager::AudioSessionCategoryOptions option);
89QDebug operator <<(QDebug dbg, CoreAudioSessionManager::AudioSessionModes mode);
90#endif
91
93
94#endif // IOSAUDIOSESSIONMANAGER_H