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
38void QPlatformMediaPlayer::setInvalidMediaWithError(QMediaPlayer::Error err,
39 const QString &errString)
40{
41 mediaStatusChanged(QMediaPlayer::InvalidMedia);
42 error(err, errString);
43}
44
45QPlatformMediaPlayer::PitchCompensationAvailability
46QPlatformMediaPlayer::pitchCompensationAvailability() const
47{
48 return PitchCompensationAvailability::Unavailable;
49}
50
51void QPlatformMediaPlayer::setPitchCompensation(bool /*enabled*/)
52{
53 qWarning() << "QMediaPlayer::setPitchCompensation not supported on this QtMultimedia "
54 "backend";
55}
56
57bool QPlatformMediaPlayer::pitchCompensation() const
58{
59 return false;
60}
61
62void QPlatformMediaPlayer::pitchCompensationChanged(bool enabled) const
63{
64 emit player->pitchCompensationChanged(enabled);
65}
66
67QPlaybackOptions QPlatformMediaPlayer::playbackOptions() const
68{
69 return player->playbackOptions();
70}
71
72QT_END_NAMESPACE
Combined button and popup list for selecting options.