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