Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsoundeffect.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
QSOUNDEFFECT_H
5
#
define
QSOUNDEFFECT_H
6
7
#
include
<
QtMultimedia
/
qaudio
.
h
>
8
#
include
<
QtMultimedia
/
qtmultimediaglobal
.
h
>
9
#
include
<
QtCore
/
qobject
.
h
>
10
#
include
<
QtCore
/
qstringlist
.
h
>
11
#
include
<
QtCore
/
qurl
.
h
>
12
13
14
QT_BEGIN_NAMESPACE
15
16
17
class
QSoundEffectPrivate;
18
class
QAudioDevice;
19
20
class
Q_MULTIMEDIA_EXPORT
QSoundEffect
:
public
QObject
21
{
22
Q_OBJECT
23
Q_CLASSINFO(
"DefaultMethod"
,
"play()"
)
24
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
25
Q_PROPERTY(
int
loops READ loopCount WRITE setLoopCount NOTIFY loopCountChanged)
26
Q_PROPERTY(
int
loopsRemaining READ loopsRemaining NOTIFY loopsRemainingChanged)
27
Q_PROPERTY(
float
volume READ volume WRITE setVolume NOTIFY volumeChanged)
28
Q_PROPERTY(
bool
muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
29
Q_PROPERTY(
bool
playing READ isPlaying NOTIFY playingChanged)
30
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
31
Q_PROPERTY(QAudioDevice audioDevice READ audioDevice WRITE setAudioDevice NOTIFY audioDeviceChanged)
32
33
public
:
34
enum
Loop
35
{
36
Infinite = -2
37
};
38
Q_ENUM(Loop)
39
40
enum
Status
41
{
42
Null,
43
Loading,
44
Ready,
45
Error
46
};
47
Q_ENUM(Status)
48
49
explicit
QSoundEffect(QObject *parent =
nullptr
);
50
explicit
QSoundEffect(
const
QAudioDevice &audioDevice, QObject *parent =
nullptr
);
51
~QSoundEffect() override;
52
53
static
QStringList supportedMimeTypes();
54
55
QUrl source()
const
;
56
void
setSource(
const
QUrl &url);
57
58
int
loopCount()
const
;
59
int
loopsRemaining()
const
;
60
void
setLoopCount(
int
loopCount);
61
62
QAudioDevice audioDevice();
63
void
setAudioDevice(
const
QAudioDevice &device);
64
65
float
volume()
const
;
66
void
setVolume(
float
volume);
67
68
bool
isMuted()
const
;
69
void
setMuted(
bool
muted);
70
71
bool
isLoaded()
const
;
72
73
bool
isPlaying()
const
;
74
Status status()
const
;
75
76
Q_SIGNALS:
77
void
sourceChanged();
78
void
loopCountChanged();
79
void
loopsRemainingChanged();
80
void
volumeChanged();
81
void
mutedChanged();
82
void
loadedChanged();
83
void
playingChanged();
84
void
statusChanged();
85
void
audioDeviceChanged();
86
87
public
Q_SLOTS:
88
void
play();
89
void
stop();
90
91
private
:
92
Q_DISABLE_COPY(QSoundEffect)
93
Q_DECLARE_PRIVATE(QSoundEffect)
94
95
// ### Qt7: remove unused member
96
QT6_ONLY(Q_DECL_UNUSED_MEMBER
void
*unused =
nullptr
;)
// for ABI compatibility
97
};
98
99
QT_END_NAMESPACE
100
101
102
#
endif
// QSOUNDEFFECT_H
QSoundEffectPrivate
Definition
qsoundeffect_p.h:33
QSoundEffect
The QSoundEffect class provides a way to play low latency sound effects.
Definition
qsoundeffect.h:21
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_BEGIN_NAMESPACE::makeSoundEffectPrivate
QSoundEffectPrivate * makeSoundEffectPrivate(QSoundEffect *fx, const QAudioDevice &audioDevice)
Definition
qsoundeffect.cpp:26
qtmultimedia
src
multimedia
audio
qsoundeffect.h
Generated on
for Qt by
1.18.0