Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplatformaudiodecoder.cpp
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
5#include "qthread.h"
6
8
10
12
13void QPlatformAudioDecoder::error(int error, const QString &errorString)
14{
15 if (error == m_error && errorString == m_errorString)
16 return;
17 m_error = QAudioDecoder::Error(error);
18 m_errorString = errorString;
19
20 if (m_error != QAudioDecoder::NoError) {
21 setIsDecoding(false);
22 emit q->error(m_error);
23 }
24}
25
27{
28 if (m_bufferAvailable == available)
29 return;
30 m_bufferAvailable = available;
31
32 if (QThread::currentThread() != q->thread())
33 QMetaObject::invokeMethod(q, "bufferAvailableChanged", Qt::QueuedConnection, Q_ARG(bool, available));
34 else
35 emit q->bufferAvailableChanged(available);
36}
37
39{
40 if (QThread::currentThread() != q->thread())
42 else
43 emit q->bufferReady();
44}
45
47{
48 emit q->sourceChanged();
49}
50
52{
53 emit q->formatChanged(format);
54}
55
57{
59 setIsDecoding(false);
60 emit q->finished();
61}
62
64{
65 if (m_position == position)
66 return;
67 m_position = position;
68 emit q->positionChanged(position);
69}
70
72{
73 if (m_duration == duration)
74 return;
75 m_duration = duration;
76 emit q->durationChanged(duration);
77}
78
80
81#include "moc_qplatformaudiodecoder_p.cpp"
The QAudioDecoder class implements decoding audio.
Error
Defines a media player error condition.
The QAudioFormat class stores audio stream parameter information.
QPlatformAudioDecoder(QAudioDecoder *parent)
void durationChanged(qint64 duration)
virtual ~QPlatformAudioDecoder()
void positionChanged(qint64 position)
void bufferAvailableChanged(bool available)
QAudioDecoder::Error error() const
virtual qint64 position() const
virtual qint64 duration() const
void formatChanged(const QAudioFormat &format)
void setIsDecoding(bool running=true)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QThread * currentThread()
Definition qthread.cpp:1039
Combined button and popup list for selecting options.
@ QueuedConnection
DBusConnection const char DBusError * error
#define Q_ARG(Type, data)
Definition qobjectdefs.h:63
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define emit
long long qint64
Definition qtypes.h:60
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...