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
qplatformmediaplayer.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 <private/qmediaplayer_p.h>
6#include "qmediaplayer.h"
9
11
13{
14 QPlatformMediaIntegration::instance()->mediaDevices()->prepareAudio();
15}
16
20
22{
23 if (newState == m_state)
24 return;
25 m_state = newState;
26 player->d_func()->setState(newState);
27}
28
30{
31 if (m_status == status)
32 return;
33 m_status = status;
34 player->d_func()->setStatus(status);
35}
36
37void QPlatformMediaPlayer::error(int error, const QString &errorString)
38{
39 player->d_func()->setError(QMediaPlayer::Error(error), errorString);
40}
41
43{
44 if (!player)
45 return nullptr;
46
47 auto playerPrivate = player->d_func();
48 if (!playerPrivate || !playerPrivate->control)
49 return nullptr;
50
51 return playerPrivate->control->nativePipeline();
52}
53
QMediaPlayer player
Definition audio.cpp:213
The QMediaPlayer class allows the playing of a media files.
MediaStatus
\qmlproperty enumeration QtMultimedia::MediaPlayer::playbackState
PlaybackState
Defines the current state of a media player.
Error
\qmlproperty enumeration QtMultimedia::MediaPlayer::mediaStatus
static QPlatformMediaIntegration * instance()
void error(int error, const QString &errorString)
void stateChanged(QMediaPlayer::PlaybackState newState)
QPlatformMediaPlayer(QMediaPlayer *parent=nullptr)
void mediaStatusChanged(QMediaPlayer::MediaStatus status)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error