Commit 72e7ab18 authored by Antonio Rojas's avatar Antonio Rojas
Browse files

Implement power management supression for the qtmultimedia backend

Allow elisa to supress suspension with the qtmultimedia backend, following a44ad7b4 for the vlc backend

BUG: 409382

Differential Revision: https://phabricator.kde.org/D22519
parent 8202bdfe
......@@ -16,6 +16,7 @@
*/
#include "audiowrapper.h"
#include "powermanagementinterface.h"
#include "qtMultimediaLogging.h"
......@@ -29,6 +30,8 @@ class AudioWrapperPrivate
public:
PowerManagementInterface mPowerInterface;
QMediaPlayer mPlayer;
qint64 mSavedPosition = 0.0;
......@@ -199,12 +202,15 @@ void AudioWrapper::playerStateChanged()
{
case QMediaPlayer::State::StoppedState:
Q_EMIT stopped();
d->mPowerInterface.setPreventSleep(false);
break;
case QMediaPlayer::State::PlayingState:
Q_EMIT playing();
d->mPowerInterface.setPreventSleep(true);
break;
case QMediaPlayer::State::PausedState:
Q_EMIT paused();
d->mPowerInterface.setPreventSleep(false);
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment