Krita Source Code Documentation
Loading...
Searching...
No Matches
KisPlaybackEngineMLT.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2022 Emmet O'Neill <emmetoneill.pdx@gmail.com>
3 SPDX-FileCopyrightText: 2022 Eoin O'Neill <eoinoneill1991@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KISPLAYBACKENGINEMLT_H
9#define KISPLAYBACKENGINEMLT_H
10
11#include <QObject>
13#include "KisPlaybackEngine.h"
14#include <kritaui_export.h>
15
16#include <QScopedPointer>
17#include <QFileInfo>
18#include <boost/optional.hpp>
19
20
22 PLAYBACK_PUSH, // MLT is being pushed to, used during pause and stop state for scrubbing.
23 PLAYBACK_PULL // MLT is updating itself, we are getting regular updates from it about when we need to show our next frame.
24};
25
35class KRITAUI_EXPORT KisPlaybackEngineMLT : public KisPlaybackEngine
36{
37 Q_OBJECT
38public:
39 explicit KisPlaybackEngineMLT(QObject *parent = nullptr);
41
42Q_SIGNALS:
43 void sigChangeActiveCanvasFrame(int p_frame);
44
45public Q_SLOTS:
46 void seek(int frameIndex, SeekOptionFlags flags = SEEK_FINALIZE | SEEK_PUSH_AUDIO) override;
47
48 void setMute(bool val) override;
49 bool isMute() override;
50
51 bool supportsAudio() override { return true; }
52 bool supportsVariablePlaybackSpeed() override { return true; }
53
54 void setDropFramesMode(bool value) override;
55
56 PlaybackStats playbackStatistics() const override;
57
58protected Q_SLOTS:
59 void setCanvas(KoCanvasBase* canvas) override;
60 void unsetCanvas() override;
61 void canvasDestroyed(QObject *canvas);
62
72 void throttledShowFrame(const int frame);
73
81 void throttledSetSpeed(const double speed);
82
83
88 void setAudioVolume(qreal volumeNormalized);
89
90public:
91 struct FrameWaitingInterface;
92 FrameWaitingInterface* frameWaitingInterface();
93
94private:
100 void setupProducer(boost::optional<QFileInfo> file);
101
102 struct Private;
103 struct StopAndResume;
104 QScopedPointer<Private> m_d;
105};
106
107#endif // KISPLAYBACKENGINEMLT_H
float value(const T *src, size_t ch)
@ PLAYBACK_PUSH
@ PLAYBACK_PULL
@ SEEK_PUSH_AUDIO
@ SEEK_FINALIZE
The KisPlaybackEngineMLT class is an implementation of KisPlaybackEngine that uses MLT (Media Lovin' ...
void sigChangeActiveCanvasFrame(int p_frame)
bool supportsAudio() override
QScopedPointer< Private > m_d
bool supportsVariablePlaybackSpeed() override
Krita's base animation playback engine for producing image frame changes and associated audio.
virtual void setDropFramesMode(bool value)
virtual bool isMute()=0
virtual void unsetCanvas() override
virtual PlaybackStats playbackStatistics() const =0
virtual void seek(int frameIndex, SeekOptionFlags options=SEEK_FINALIZE|SEEK_PUSH_AUDIO)=0
virtual void setMute(bool val)=0
virtual void setCanvas(KoCanvasBase *p_canvas) override