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