X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fabstractmonitor.h;h=e81d6339d1ed29acaa4865bb4eb2bdb457aa7a4b;hb=edb2e9a073ba73424d17da6e0821d0e1c0281a19;hp=58fc10931cfdf3486f7e84a9c1112857ee47d926;hpb=ce68de86827a11cd0dc96465fba021b2f7ceea55;p=kdenlive diff --git a/src/abstractmonitor.h b/src/abstractmonitor.h index 58fc1093..e81d6339 100644 --- a/src/abstractmonitor.h +++ b/src/abstractmonitor.h @@ -20,20 +20,20 @@ #ifndef ABSTRACTMONITOR_H #define ABSTRACTMONITOR_H -#include "definitions.h" +#include #include #include #include #include -#include #include -#include -#include +#include "definitions.h" +#include "widgets/videosurface.h" class MonitorManager; class VideoContainer; +class VideoSurface; class AbstractRender: public QObject { @@ -43,10 +43,16 @@ Q_OBJECT public: * @param name A unique identifier for this renderer * @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering * @param profile The MLT profile used for the renderer (default one will be used if empty). */ - AbstractRender(Kdenlive::MONITORID name, QWidget *parent = 0):QObject(parent), sendFrameForAnalysis(false), m_name(name) {}; + explicit AbstractRender(Kdenlive::MonitorId name, QWidget *parent = 0) + : QObject(parent), + sendFrameForAnalysis(false), + analyseAudio(false), + m_name(name) + { + } /** @brief Destroy the MLT Renderer. */ - virtual ~AbstractRender() {}; + virtual ~AbstractRender() {} /** @brief This property is used to decide if the renderer should convert it's frames to QImage for use in other Kdenlive widgets. */ bool sendFrameForAnalysis; @@ -54,7 +60,7 @@ Q_OBJECT public: /** @brief This property is used to decide if the renderer should send audio data for monitoring. */ bool analyseAudio; - const QString &name() const {return m_name;}; + const QString &name() const {return m_name;} /** @brief Someone needs us to send again a frame. */ virtual void sendFrameUpdate() = 0; @@ -64,34 +70,18 @@ private: signals: /** @brief The renderer refreshed the current frame. */ - void frameUpdated(QImage); + void frameUpdated(const QImage &); /** @brief This signal contains the audio of the current frame. */ - void audioSamplesSignal(QVector,int,int,int); -}; - - - -class VideoSurface : public QWidget -{ - Q_OBJECT -public: - VideoSurface(QWidget *parent = 0); - -signals: - void refreshMonitor(); - -protected: - virtual void paintEvent ( QPaintEvent * event ); + void audioSamplesSignal(const QVector&,int,int,int); }; - class AbstractMonitor : public QWidget { Q_OBJECT public: - AbstractMonitor(Kdenlive::MONITORID id, MonitorManager *manager, QWidget *parent = 0); - Kdenlive::MONITORID id() {return m_id;}; + AbstractMonitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *parent = 0); + Kdenlive::MonitorId id() {return m_id;} virtual ~AbstractMonitor(); virtual AbstractRender *abstractRender() = 0; bool isActive() const; @@ -105,11 +95,11 @@ public slots: virtual void start() = 0; virtual void slotPlay() = 0; virtual void slotMouseSeek(int eventDelta, bool fast) = 0; - bool slotActivateMonitor(); + bool slotActivateMonitor(bool forceRefresh = false); virtual void slotSwitchFullScreen() = 0; protected: - Kdenlive::MONITORID m_id; + Kdenlive::MonitorId m_id; MonitorManager *m_monitorManager; }; @@ -117,7 +107,7 @@ class VideoContainer : public QFrame { Q_OBJECT public: - VideoContainer(AbstractMonitor *monitor, QWidget *parent = 0); + explicit VideoContainer(AbstractMonitor *monitor, QWidget *parent = 0); void switchFullScreen(); protected: