1 /***************************************************************************
2 titlewidget.h - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
21 #include "ui_stopmotion_ui.h"
22 #include "../blackmagic/capture.h"
27 class MyLabel : public QLabel
31 MyLabel(QWidget *parent = 0);
32 void setImage(QImage img);
35 virtual void paintEvent( QPaintEvent * event);
36 virtual void wheelEvent(QWheelEvent * event);
42 /** @brief Seek to next or previous frame.
43 * @param forward set to true to go to next frame, fals to go to previous frame */
44 void seek(bool forward);
47 class StopmotionWidget : public QDialog , public Ui::Stopmotion_UI
53 /** @brief Build the stopmotion dialog.
54 * @param projectFolder The current project folder, where captured files will be stored.
55 * @param parent (optional) parent widget */
56 StopmotionWidget(KUrl projectFolder, QWidget *parent = 0);
57 virtual ~StopmotionWidget();
64 /** @brief Current project folder (where the captured frames will be saved). */
67 /** @brief Capture holder that will handle all video operation. */
68 CaptureHandler *m_bmCapture;
70 /** @brief Holds the name of the current sequence.
71 * Files will be saved in project folder with name: sequence001.png */
72 QString m_sequenceName;
74 /** @brief Holds the frame number of the current sequence. */
77 QAction *m_captureAction;
79 /** @brief Holds the index of the frame to be displayed in the frame preview mode. */
82 /** @brief Find all stopmotion sequences in current project folder. */
83 void parseExistingSequences();
85 /** @brief Select a frame in the list. */
86 void selectFrame(int ix);
88 /** @brief This widget will hold the frame preview. */
89 MyLabel *m_frame_preview;
92 /** @brief Display the live feed from capture device.
93 @param isOn enable or disable the feature */
94 void slotLive(bool isOn);
96 /** @brief Display the last captured frame over current live feed.
97 @param isOn enable or disable the feature */
98 void slotShowOverlay(bool isOn);
100 /** @brief Display the last captured frame over current live feed. */
101 void slotUpdateOverlay();
103 /** @brief User changed the capture name. */
104 void sequenceNameChanged(const QString &name);
106 /** @brief Grab a frame from current capture feed. */
107 void slotCaptureFrame();
109 /** @brief Display a previous frame in monitor. */
110 void slotShowFrame(int);
112 /** @brief Get full path for a frame in the sequence.
113 * @param ix the frame number.
114 * @param seqName (optional) the name of the sequence. */
115 QString getPathForFrame(int ix, QString seqName = QString());
117 /** @brief Add sequence to current project. */
118 void slotAddSequence();
120 /** @brief Update the frame list widget with newly created frame. */
121 void slotUpdateFrameList(int ix = -1);
123 /** @brief Display selected fram in monitor. */
124 void slotShowSelectedFrame();
126 /** @brief Start animation preview mode. */
127 void slotPlayPreview();
129 /** @brief Simulate animation. */
132 /** @brief Seek to previous or next captured frame.
133 * @param forward set to true for next frame, false for previous one. */
134 void slotSeekFrame(bool forward);
137 /** @brief Ask to add sequence to current project. */
138 void addOrUpdateSequence(const QString);