Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
12QPlatformMediaPlayer::QPlatformMediaPlayer(QMediaPlayer *parent) : player(parent)
13{
14}
15
16QPlatformMediaPlayer::~QPlatformMediaPlayer() = default;
17
18void QPlatformMediaPlayer::stateChanged(QMediaPlayer::PlaybackState newState)
19{
20 if (newState == m_state)
21 return;
22 m_state = newState;
23 player->d_func()->setState(newState);
24}
25
26void QPlatformMediaPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus status)
27{
28 if (m_status == status)
29 return;
30 m_status = status;
31 player->d_func()->setStatus(status);
32}
33
34void QPlatformMediaPlayer::error(QMediaPlayer::Error error, const QString &errorString)
35{
36 player->d_func()->setError(error, errorString);
37}
38
39QPlatformMediaPlayer::PitchCompensationAvailability
40QPlatformMediaPlayer::pitchCompensationAvailability() const
41{
42 return PitchCompensationAvailability::Unavailable;
43}
44
45void QPlatformMediaPlayer::setPitchCompensation(bool /*enabled*/)
46{
47 qWarning() << "QMediaPlayer::setPitchCompensation not supported on this QtMultimedia "
48 "backend";
49}
50
51bool QPlatformMediaPlayer::pitchCompensation() const
52{
53 return false;
54}
55
56void QPlatformMediaPlayer::pitchCompensationChanged(bool enabled) const
57{
58 emit player->pitchCompensationChanged(enabled);
59}
60
61QPlaybackOptions QPlatformMediaPlayer::playbackOptions() const
62{
63 return player->playbackOptions();
64}
65
66QT_END_NAMESPACE