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
qambientsound.h
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-3.0-only
3
#
ifndef
QAMBIENTSOUND_H
4
#
define
QAMBIENTSOUND_H
5
6
#
include
<
QtSpatialAudio
/
qtspatialaudioglobal
.
h
>
7
#
include
<
QtMultimedia
/
qtmultimediaglobal
.
h
>
8
#
include
<
QtCore
/
qurl
.
h
>
9
#
include
<
QtCore
/
qobject
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
class
QAudioEngine;
14
class
QAmbientSoundPrivate
;
15
16
class
Q_SPATIALAUDIO_EXPORT
QAmbientSound
:
public
QObject
17
{
18
Q_OBJECT
19
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
20
Q_PROPERTY(
float
volume READ volume WRITE setVolume NOTIFY volumeChanged)
21
Q_PROPERTY(
int
loops READ loops WRITE setLoops NOTIFY loopsChanged)
22
Q_PROPERTY(
bool
autoPlay READ autoPlay WRITE setAutoPlay NOTIFY autoPlayChanged)
23
24
public
:
25
explicit
QAmbientSound(QAudioEngine *engine);
26
~QAmbientSound() override;
27
28
void
setSource(
const
QUrl &url);
29
QUrl source()
const
;
30
31
enum
Loops
32
{
33
Infinite = -1,
34
Once = 1
35
};
36
Q_ENUM(Loops)
37
38
int
loops()
const
;
39
void
setLoops(
int
loops);
40
41
bool
autoPlay()
const
;
42
void
setAutoPlay(
bool
autoPlay);
43
44
void
setVolume(
float
volume);
45
float
volume()
const
;
46
47
QAudioEngine *engine()
const
;
48
49
Q_SIGNALS:
50
void
sourceChanged();
51
void
loopsChanged();
52
void
autoPlayChanged();
53
void
volumeChanged();
54
55
public
Q_SLOTS:
56
void
play();
57
void
pause();
58
void
stop();
59
60
private
:
61
Q_DECLARE_PRIVATE(QAmbientSound)
62
friend
class
QSpatialAudioSoundPrivate;
63
64
// ### Qt7: remove unused member
65
QT6_ONLY(Q_DECL_UNUSED_MEMBER
void
*unused =
nullptr
;)
// for ABI compatibility
66
};
67
68
QT_END_NAMESPACE
69
70
#
endif
QAmbientSoundPrivate::QAmbientSoundPrivate
QAmbientSoundPrivate(QAudioEngine *engine)
Definition
qambientsound.cpp:37
QAmbientSound
\inmodule QtSpatialAudio
Definition
qambientsound.h:17
QT_BEGIN_NAMESPACE::addStereoSource
int addStereoSource(QAudioEngine *engine)
Definition
qambientsound.cpp:19
qtmultimedia
src
spatialaudio
qambientsound.h
Generated on
for Qt by
1.18.0