Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qaudiooutput.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QAUDIOOUTPUTDEVICE_H
5#define QAUDIOOUTPUTDEVICE_H
6
7#include <QtCore/qobject.h>
8#include <QtMultimedia/qtmultimediaglobal.h>
9#include <QtMultimedia/qaudio.h>
10
11#include <functional>
12
14
15class QAudioDevice;
17
18class Q_MULTIMEDIA_EXPORT QAudioOutput : public QObject
19{
21 Q_PROPERTY(QAudioDevice device READ device WRITE setDevice NOTIFY deviceChanged)
22 Q_PROPERTY(float volume READ volume WRITE setVolume NOTIFY volumeChanged)
23 Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
24
25public:
26 explicit QAudioOutput(QObject *parent = nullptr);
27 explicit QAudioOutput(const QAudioDevice &device, QObject *parent = nullptr);
29
30 QAudioDevice device() const;
31 float volume() const;
32 bool isMuted() const;
33
34public Q_SLOTS:
35 void setDevice(const QAudioDevice &device);
36 void setVolume(float volume);
37 void setMuted(bool muted);
38
41 void volumeChanged(float volume);
42 void mutedChanged(bool muted);
43
44private:
45 QPlatformAudioOutput *handle() const { return d; }
46 void setDisconnectFunction(std::function<void()> disconnectFunction);
48 friend class QMediaPlayer;
49 Q_DISABLE_COPY(QAudioOutput)
50 QPlatformAudioOutput *d = nullptr;
51};
52
54
55#endif // QAUDIOOUTPUTDEVICE_H
IOBluetoothDevice * device
The QAudioDevice class provides an information about audio devices and their functionality.
\qmltype AudioOutput \instantiates QAudioOutput
void deviceChanged()
void mutedChanged(bool muted)
void volumeChanged(float volume)
The QMediaCaptureSession class allows capturing of audio and video content.
The QMediaPlayer class allows the playing of a media files.
\inmodule QtCore
Definition qobject.h:90
Combined button and popup list for selecting options.
GLuint64 GLenum void * handle
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent