X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmonitor.h;h=d3f1ba93d740bc1c91e5052bb2af75debfdf1eac;hb=a3eee7be24126f5a3458d488f44cd61c66135e17;hp=ba949ff0417a35a427af682d44ce705c0d849861;hpb=bae96d4b906092465a7624195a55b6527529cd7c;p=kdenlive diff --git a/src/monitor.h b/src/monitor.h index ba949ff0..d3f1ba93 100644 --- a/src/monitor.h +++ b/src/monitor.h @@ -23,20 +23,16 @@ #include "gentime.h" #include "renderer.h" +#include "definitions.h" #include "timecodedisplay.h" -#include "abstractmonitor.h" -#ifdef USE_OPENGL -#include "videoglwidget.h" -#endif +#include "widgets/abstractmonitor.h" +#include "widgets/videoglwidget.h" #include #include #include -#include #include -#include -#include class SmallRuler; class DocClipBase; @@ -46,37 +42,9 @@ class ClipItem; class MonitorEditWidget; class Monitor; class MonitorManager; - -class VideoContainer : public QFrame -{ - Q_OBJECT -public: - VideoContainer(Monitor *parent = 0); - void switchFullScreen(); - -protected: - virtual void mouseDoubleClickEvent(QMouseEvent * event); - virtual void mousePressEvent(QMouseEvent * event); - virtual void mouseReleaseEvent(QMouseEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); - void keyPressEvent(QKeyEvent *event); - virtual void wheelEvent(QWheelEvent * event); - -private: - Qt::WindowFlags m_baseFlags; - Monitor *m_monitor; -}; - -class MonitorRefresh : public QWidget -{ - Q_OBJECT -public: - MonitorRefresh(QWidget *parent = 0); - void setRenderer(Render* render); - -private: - Render *m_renderer; -}; +class QSlider; +class VideoGLWidget; +class QGLWidget; class Overlay : public QLabel { @@ -85,13 +53,10 @@ public: Overlay(QWidget* parent = 0); void setOverlayText(const QString &, bool isZone = true); -private: - bool m_isZone; - protected: - virtual void mouseDoubleClickEvent ( QMouseEvent * event ); - virtual void mousePressEvent ( QMouseEvent * event ); - virtual void mouseReleaseEvent ( QMouseEvent * event ); + void mouseDoubleClickEvent ( QMouseEvent * event ); + void mousePressEvent ( QMouseEvent * event ); + void mouseReleaseEvent ( QMouseEvent * event ); signals: void editMarker(); @@ -102,15 +67,15 @@ class Monitor : public AbstractMonitor Q_OBJECT public: - Monitor(QString name, MonitorManager *manager, QString profile = QString(), QWidget *parent = 0); + Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QGLWidget *glContext, QString profile = QString(), QWidget *parent = 0); ~Monitor(); Render *render; AbstractRender *abstractRender(); void resetProfile(const QString &profile); - const QString name() const; + void setCustomProfile(const QString &profile, const Timecode &tc); void resetSize(); - bool isActive() const; void pause(); + void unpause(); void setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL, QAction *loopClip = NULL); const QString sceneList(); DocClipBase *activeClip(); @@ -118,23 +83,34 @@ public: void checkOverlay(); void updateTimecodeFormat(); void updateMarkers(DocClipBase *source); + void setMarkers(const QList &markers); MonitorEditWidget *getEffectEdit(); QWidget *container(); + void reloadProducer(const QString &id); QFrame *m_volumePopup; + /** @brief Reimplemented from QWidget, updates the palette colors. */ + void setPalette ( const QPalette & p); + /** @brief Returns a hh:mm:ss timecode from a frame number. */ + QString getTimecodeFromFrames(int pos); + /** @brief Returns current project's fps. */ + double fps() const; + /** @brief Get url for the clip's thumbnail */ + QString getMarkerThumb(GenTime pos); protected: - virtual void mousePressEvent(QMouseEvent * event); - virtual void mouseReleaseEvent(QMouseEvent * event); - virtual void resizeEvent(QResizeEvent *event); + void mousePressEvent(QMouseEvent * event); + void mouseReleaseEvent(QMouseEvent * event); + void resizeEvent(QResizeEvent *event); /** @brief Move to another position on mouse wheel event. * * Moves towards the end of the clip/timeline on mouse wheel down/back, the * opposite on mouse wheel up/forward. * Ctrl + wheel moves by a second, without Ctrl it moves by a single frame. */ - virtual void wheelEvent(QWheelEvent * event); - virtual void mouseMoveEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent * event); + void mouseMoveEvent(QMouseEvent *event); virtual QStringList mimeTypes() const; + /*virtual void dragMoveEvent(QDragMoveEvent * event); virtual Qt::DropActions supportedDropActions() const;*/ @@ -142,15 +118,12 @@ protected: //virtual void paintEvent(QPaintEvent * event); private: - QString m_name; - MonitorManager *m_monitorManager; DocClipBase *m_currentClip; SmallRuler *m_ruler; Overlay *m_overlay; double m_scale; int m_length; bool m_dragStarted; - MonitorRefresh *m_monitorRefresh; KIcon m_playIcon; KIcon m_pauseIcon; TimecodeDisplay *m_timePos; @@ -163,17 +136,15 @@ private: QMenu *m_markerMenu; QPoint m_DragStartPosition; MonitorEditWidget *m_effectWidget; - VideoContainer *m_videoBox; /** Selected clip/transition in timeline. Used for looping it. */ AbstractClipItem *m_selectedClip; /** true if selected clip is transition, false = selected clip is clip. * Necessary because sometimes we get two signals, e.g. we get a clip and we get selected transition = NULL. */ bool m_loopClipTransition; -#ifdef USE_OPENGL + QGLWidget *m_parentGLContext; VideoGLWidget *m_glWidget; - bool createOpenGlWidget(QWidget *parent, const QString profile); -#endif + void createOpenGlWidget(QWidget *parent, const QString &profile); GenTime getSnapForPos(bool previous); Qt::WindowFlags m_baseFlags; @@ -191,24 +162,24 @@ private slots: void slotSetSizeOneToTwo(); void slotSaveZone(); void slotSeek(); - void setClipZone(QPoint pos); + void setClipZone(const QPoint &pos); void slotSwitchMonitorInfo(bool show); void slotSwitchDropFrames(bool show); void slotGoToMarker(QAction *action); void slotSetVolume(int volume); void slotShowVolume(); void slotEditMarker(); + void slotExtractCurrentZone(); public slots: void slotOpenFile(const QString &); - void slotSetClipProducer(DocClipBase *clip, QPoint zone = QPoint(), int position = -1); + void slotSetClipProducer(DocClipBase *clip, QPoint zone = QPoint(), bool forceUpdate = false, int position = -1); void updateClipProducer(Mlt::Producer *prod); void refreshMonitor(bool visible); void refreshMonitor(); void slotSeek(int pos); void stop(); void start(); - bool activateMonitor(); void slotPlay(); void slotPlayZone(); void slotLoopZone(); @@ -218,7 +189,7 @@ public slots: void slotRewind(double speed = 0); void slotRewindOneFrame(int diff = 1); void slotForwardOneFrame(int diff = 1); - void saveSceneList(QString path, QDomElement info = QDomElement()); + void saveSceneList(const QString &path, const QDomElement &info = QDomElement()); void slotStart(); void slotEnd(); void slotSetZoneStart(); @@ -231,7 +202,8 @@ public slots: void adjustRulerSize(int length); void setTimePos(const QString &pos); QStringList getZoneInfo() const; - void slotEffectScene(bool show = true); + /** @brief Display the on monitor effect scene (to adjust geometry over monitor). */ + void slotShowEffectScene(bool show = true, bool manuallyTriggered = false); bool effectSceneDisplayed(); /** @brief Sets m_selectedClip to @param item. Used for looping it. */ @@ -246,11 +218,13 @@ signals: void durationChanged(int); void refreshClipThumbnail(const QString &, bool); void adjustMonitorSize(); - void zoneUpdated(QPoint); - void saveZone(Render *, QPoint, DocClipBase *); + void zoneUpdated(const QPoint&); + void saveZone(Render *, const QPoint&, DocClipBase *); /** @brief Editing transitions / effects over the monitor requires the renderer to send frames as QImage. * This causes a major slowdown, so we only enable it if required */ void requestFrameForAnalysis(bool); + /** @brief Request a zone extraction (ffmpeg transcoding). */ + void extractZone(const QString &id, const QPoint &zone); }; #endif