| 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 QMEDIADEVICES_H |
| 5 | #define QMEDIADEVICES_H |
| 6 | |
| 7 | #include <QtMultimedia/qtmultimediaglobal.h> |
| 8 | #include <QtCore/qobject.h> |
| 9 | #include <QtCore/qstringlist.h> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QAudioDevice; |
| 14 | class QCameraDevice; |
| 15 | |
| 16 | class Q_MULTIMEDIA_EXPORT QMediaDevices : public QObject |
| 17 | { |
| 18 | Q_OBJECT |
| 19 | Q_PROPERTY(QList<QAudioDevice> audioInputs READ audioInputs NOTIFY audioInputsChanged) |
| 20 | Q_PROPERTY(QList<QAudioDevice> audioOutputs READ audioOutputs NOTIFY audioOutputsChanged) |
| 21 | Q_PROPERTY(QList<QCameraDevice> videoInputs READ videoInputs NOTIFY videoInputsChanged) |
| 22 | Q_PROPERTY(QAudioDevice defaultAudioInput READ defaultAudioInput NOTIFY audioInputsChanged) |
| 23 | Q_PROPERTY(QAudioDevice defaultAudioOutput READ defaultAudioOutput NOTIFY audioOutputsChanged) |
| 24 | Q_PROPERTY(QCameraDevice defaultVideoInput READ defaultVideoInput NOTIFY videoInputsChanged) |
| 25 | |
| 26 | public: |
| 27 | QMediaDevices(QObject *parent = nullptr); |
| 28 | ~QMediaDevices() override; |
| 29 | |
| 30 | static QList<QAudioDevice> audioInputs(); |
| 31 | static QList<QAudioDevice> audioOutputs(); |
| 32 | static QList<QCameraDevice> videoInputs(); |
| 33 | |
| 34 | static QAudioDevice defaultAudioInput(); |
| 35 | static QAudioDevice defaultAudioOutput(); |
| 36 | static QCameraDevice defaultVideoInput(); |
| 37 | |
| 38 | Q_SIGNALS: |
| 39 | void audioInputsChanged(); |
| 40 | void audioOutputsChanged(); |
| 41 | void videoInputsChanged(); |
| 42 | |
| 43 | protected: |
| 44 | void connectNotify(const QMetaMethod &signal) override; |
| 45 | }; |
| 46 | |
| 47 | QT_END_NAMESPACE |
| 48 | |
| 49 | |
| 50 | #endif // QABSTRACTMEDIASERVICE_H |
| 51 | |
| 52 | |