| 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 | |
| 4 | #include "qplatformmediaplayer_p.h" |
| 5 | #include <private/qmediaplayer_p.h> |
| 6 | #include "qmediaplayer.h" |
| 7 | #include "qplatformaudiodevices_p.h" |
| 8 | #include "qplatformmediaintegration_p.h" |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | QPlatformMediaPlayer::QPlatformMediaPlayer(QMediaPlayer *parent) : player(parent) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | QPlatformMediaPlayer::~QPlatformMediaPlayer() = default; |
| 17 | |
| 18 | void 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 | |
| 26 | void 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 | |
| 34 | void QPlatformMediaPlayer::error(QMediaPlayer::Error error, const QString &errorString) |
| 35 | { |
| 36 | player->d_func()->setError(error, errorString); |
| 37 | } |
| 38 | |
| 39 | QPlatformMediaPlayer::PitchCompensationAvailability |
| 40 | QPlatformMediaPlayer::pitchCompensationAvailability() const |
| 41 | { |
| 42 | return PitchCompensationAvailability::Unavailable; |
| 43 | } |
| 44 | |
| 45 | void QPlatformMediaPlayer::setPitchCompensation(bool /*enabled*/) |
| 46 | { |
| 47 | qWarning() << "QMediaPlayer::setPitchCompensation not supported on this QtMultimedia " |
| 48 | "backend"; |
| 49 | } |
| 50 | |
| 51 | bool QPlatformMediaPlayer::pitchCompensation() const |
| 52 | { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | void QPlatformMediaPlayer::pitchCompensationChanged(bool enabled) const |
| 57 | { |
| 58 | emit player->pitchCompensationChanged(enabled); |
| 59 | } |
| 60 | |
| 61 | QPlaybackOptions QPlatformMediaPlayer::playbackOptions() const |
| 62 | { |
| 63 | return player->playbackOptions(); |
| 64 | } |
| 65 | |
| 66 | QT_END_NAMESPACE |
| 67 |
