X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fstopmotion%2Fstopmotion.h;h=bbda1a6f4d8fbfe7885897dc78a5709c9c25842b;hb=054ff5c40ed015661e7cea3eaf683239e5b0839a;hp=c76f634cb98d68ad303897b6a4e10858350c6c43;hpb=b5e930a237a4f71ef89835a37eaf6cd1fe15d93e;p=kdenlive diff --git a/src/stopmotion/stopmotion.h b/src/stopmotion/stopmotion.h index c76f634c..bbda1a6f 100644 --- a/src/stopmotion/stopmotion.h +++ b/src/stopmotion/stopmotion.h @@ -19,19 +19,25 @@ #define STOPMOTION_H #include "ui_stopmotion_ui.h" -#include "../blackmagic/capture.h" +#include "definitions.h" #include #include #include #include +#include +#include + +class MltDeviceCapture; +class MonitorManager; +class MltVideoProfile; class MyLabel : public QLabel { Q_OBJECT public: MyLabel(QWidget* parent = 0); - void setImage(QImage img); + void setImage(const QImage &img); protected: virtual void paintEvent(QPaintEvent* event); @@ -50,7 +56,33 @@ signals: void switchToLive(); }; -class StopmotionWidget : public QDialog , public Ui::Stopmotion_UI + +class StopmotionMonitor : public AbstractMonitor +{ + Q_OBJECT +public: + StopmotionMonitor(MonitorManager *manager, QWidget *parent); + ~StopmotionMonitor(); + AbstractRender *abstractRender(); + Kdenlive::MONITORID id() const; + void setRender(MltDeviceCapture *render); + +private: + MltDeviceCapture *m_captureDevice; + +public slots: + void stop(); + void start(); + void slotPlay(); + void slotMouseSeek(int eventDelta, bool fast); + void slotSwitchFullScreen(); + +signals: + void stopCapture(); +}; + + +class StopmotionWidget : public QDialog, public Ui::Stopmotion_UI { Q_OBJECT @@ -60,21 +92,18 @@ public: * @param projectFolder The current project folder, where captured files will be stored. * @param actions The actions for this widget that can have a keyboard shortcut. * @param parent (optional) parent widget */ - StopmotionWidget(KUrl projectFolder, QList< QAction* > actions, QWidget* parent = 0); + StopmotionWidget(MonitorManager *manager, const KUrl &projectFolder, const QList< QAction* > &actions, QWidget* parent = 0); virtual ~StopmotionWidget(); protected: virtual void closeEvent(QCloseEvent* e); private: - /** @brief Widget layout holding video and frame preview. */ - QVBoxLayout* m_layout; - /** @brief Current project folder (where the captured frames will be saved). */ KUrl m_projectFolder; /** @brief Capture holder that will handle all video operation. */ - CaptureHandler* m_bmCapture; + MltDeviceCapture *m_captureDevice; /** @brief Holds the name of the current sequence. * Files will be saved in project folder with name: sequence001.png */ @@ -106,9 +135,6 @@ private: /** @brief Get the frame number ix. */ QListWidgetItem* getFrameFromIndex(int ix); - /** @brief The action triggering interval capture. */ - QAction* m_intervalCapture; - /** @brief The action triggering display of last frame over current live video feed. */ QAction* m_showOverlay; @@ -117,16 +143,30 @@ private: /** @brief Tells if we are in animation (playback) mode. */ bool m_animate; + + /** @brief Timer for interval capture. */ + QTimer m_intervalTimer; + + MonitorManager *m_manager; + /** @brief The monitor is used to control the v4l capture device from the monitormanager class. */ + StopmotionMonitor *m_monitor; -#ifdef QIMAGEBLITZ + /** @brief Create the XML playlist. */ + const QString createProducer(MltVideoProfile profile, const QString &service, const QString &resource); + + /** @brief A new frame arrived, reload overlay. */ + void reloadOverlay(); + + /** @brief Holds the index of the effect to be applied to the video feed. */ int m_effectIndex; -#endif + public slots: /** @brief Display the live feed from capture device. @param isOn enable or disable the feature */ void slotLive(bool isOn = true); + void slotStopCapture(); private slots: @@ -177,19 +217,16 @@ private slots: void slotPrepareThumbs(); /** @brief Called when user switches the video capture backend. */ - void slotUpdateHandler(); + void slotUpdateDeviceHandler(); /** @brief Show / hide sequence thumbnails. */ void slotShowThumbs(bool show); - /** @brief Capture one frame every interval time. */ - void slotIntervalCapture(bool capture); - /** @brief Show the config dialog */ void slotConfigure(); /** @brief Prepare to crete thumb for newly captured frame. */ - void slotNewThumb(const QString path); + void slotNewThumb(const QString &path); /** @brief Set the effect to be applied to overlay frame. */ void slotUpdateOverlayEffect(QAction* act); @@ -199,11 +236,19 @@ private slots: /** @brief Delete current frame from disk. */ void slotRemoveFrame(); + /** @brief Enable / disable frame analysis (in color scopes). */ void slotSwitchAnalyse(bool isOn); + + /** @brief Enable / disable horizontal mirror effect. */ + void slotSwitchMirror(bool isOn); + + /** @brief Send a notification a few seconds before capturing. */ + void slotPreNotify(); + signals: /** @brief Ask to add sequence to current project. */ - void addOrUpdateSequence(const QString); + void addOrUpdateSequence(const QString &); void doCreateThumbs(QImage, int); void gotFrame(QImage);