]> git.sesse.net Git - kdenlive/blob - src/stopmotion/stopmotion.h
7742447b840f733e8549862802a96739bf00de09
[kdenlive] / src / stopmotion / stopmotion.h
1 /***************************************************************************
2                           titlewidget.h  -  description
3                              -------------------
4     begin                : Feb 28 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef STOPMOTION_H
19 #define STOPMOTION_H
20
21 #include "ui_stopmotion_ui.h"
22 #include "../blackmagic/capture.h"
23
24 #include <KUrl>
25
26 class StopmotionWidget : public QDialog , public Ui::Stopmotion_UI
27 {
28     Q_OBJECT
29
30 public:
31
32     /** @brief Build the stopmotion dialog.
33      * @param projectFolder The current project folder, where captured files will be stored.
34      * @param parent (optional) parent widget */
35     StopmotionWidget(KUrl projectFolder, QWidget *parent = 0);
36     virtual ~StopmotionWidget();
37
38
39 protected:
40
41
42 private:
43   /** @brief Current project folder (where the captured frames will be saved). */
44   KUrl m_projectFolder;
45
46   /** @brief Capture holder that will handle all video operation. */
47   CaptureHandler *m_bmCapture;
48
49   /** @brief Holds the name of the current sequence.
50    * Files will be saved in project folder with name: sequence001.png */
51   QString m_sequenceName;
52
53   /** @brief Holds the frame number of the current sequence. */
54   int m_sequenceFrame;
55
56   QAction *m_captureAction;
57   
58   /** @brief Holds the index of the frame to be displayed in the frame preview mode. */
59   int m_animatedIndex;
60   
61 private slots:
62   /** @brief Display the live feed from capture device.
63    @param isOn enable or disable the feature */
64   void slotLive(bool isOn);
65
66   /** @brief Display the last captured frame over current live feed.
67    @param isOn enable or disable the feature */
68   void slotShowOverlay(bool isOn);
69
70   /** @brief Display the last captured frame over current live feed. */
71   void slotUpdateOverlay();
72
73   /** @brief User changed the capture name. */
74   void sequenceNameChanged(const QString &name);
75
76   /** @brief Grab a frame from current capture feed. */
77   void slotCaptureFrame();
78
79   /** @brief Display a previous frame in monitor. */
80   void slotShowFrame(int);
81
82   /** @brief Get full path for a frame in the sequence.
83    *  @param ix the frame number.
84    *  @param seqName (optional) the name of the sequence. */
85   QString getPathForFrame(int ix, QString seqName = QString());
86
87   /** @brief Add sequence to current project. */
88   void slotAddSequence();
89
90   /** @brief Update the frame list widget with newly created frame. */
91   void slotUpdateFrameList(int ix = -1);
92   
93   /** @brief Display selected fram in monitor. */
94   void slotShowSelectedFrame();
95
96   /** @brief Start animation preview mode. */
97   void slotPlayPreview();
98   
99   /** @brief Simulate animation. */
100   void slotAnimate();
101
102 signals:
103   /** @brief Ask to add sequence to current project. */
104   void addOrUpdateSequence(const QString);
105 };
106
107 #endif