Comment=A frame was captured to disk
Comment[es]=Se ha capturado un fotograma al disco
Comment[ru]=Кадр снят и сохранён на диск
+Sound=KDE-Sys-App-Message.ogg
+Action=Sound
+
+[Event/ReadyToCapture]
+Name=Ready to capture
Sound=KDE-Sys-App-Positive.ogg
Action=Sound
<entry name="captureinterval" type="Int">
<label>Interval between each capture (in seconds).</label>
<default>5</default>
- </entry>
+ </entry>
+
+ <entry name="sm_notifytime" type="Int">
+ <label>Seconds before triggering a capture notification.</label>
+ <default>3</default>
+ </entry>
+
+ <entry name="sm_prenotify" type="Bool">
+ <label>Send a notification a few seconds before capture.</label>
+ <default>false</default>
+ </entry>
<entry name="sm_loop" type="Bool">
<label>Should we loop in stop motion playback.</label>
m_captureAction = actions.at(0);
connect(m_captureAction, SIGNAL(triggered()), this, SLOT(slotCaptureFrame()));
+ m_captureAction->setCheckable(true);
+ m_captureAction->setChecked(false);
capture_button->setDefaultAction(m_captureAction);
connect(actions.at(1), SIGNAL(triggered()), this, SLOT(slotSwitchLive()));
+ QAction *intervalCapture = new QAction(i18n("Interval capture"), this);
+ intervalCapture->setIcon(KIcon("chronometer"));
+ intervalCapture->setCheckable(true);
+ intervalCapture->setChecked(false);
+ capture_interval->setDefaultAction(intervalCapture);
+
preview_button->setIcon(KIcon("media-playback-start"));
capture_button->setEnabled(false);
+
// Build config menu
QMenu* confMenu = new QMenu;
config_button->setIcon(KIcon("configure"));
config_button->setMenu(confMenu);
- // Build capture menu
- QMenu* capMenu = new QMenu;
- m_intervalCapture = new QAction(KIcon("edit-redo"), i18n("Interval capture"), this);
- m_intervalCapture->setCheckable(true);
- m_intervalCapture->setChecked(false);
- connect(m_intervalCapture, SIGNAL(triggered(bool)), this, SLOT(slotIntervalCapture(bool)));
- capMenu->addAction(m_intervalCapture);
- capture_button->setMenu(capMenu);
-
connect(sequence_name, SIGNAL(textChanged(const QString&)), this, SLOT(sequenceNameChanged(const QString&)));
connect(sequence_name, SIGNAL(currentIndexChanged(int)), live_button, SLOT(setFocus()));
frame_list->setHidden(!KdenliveSettings::showstopmotionthumbs());
parseExistingSequences();
QTimer::singleShot(500, this, SLOT(slotLive()));
+ connect(&m_intervalTimer, SIGNAL(timeout()), this, SLOT(slotCaptureFrame()));
+ m_intervalTimer.setSingleShot(true);
+ m_intervalTimer.setInterval(KdenliveSettings::captureinterval() * 1000);
}
StopmotionWidget::~StopmotionWidget()
ui.setupUi(&d);
d.setWindowTitle(i18n("Configure Stop Motion"));
ui.sm_interval->setValue(KdenliveSettings::captureinterval());
+ ui.sm_interval->setSuffix(ki18np(" second", " seconds"));
+ ui.sm_notifytime->setSuffix(ki18np(" second", " seconds"));
+ ui.sm_notifytime->setValue(KdenliveSettings::sm_notifytime());
+ connect(ui.sm_prenotify, SIGNAL(checked(bool)), ui.sm_notifytime, SLOT(setEnabled(bool)));
+ ui.sm_prenotify->setChecked(KdenliveSettings::sm_prenotify());
ui.sm_loop->setChecked(KdenliveSettings::sm_loop());
ui.sm_framesplayback->setValue(KdenliveSettings::sm_framesplayback());
+
if (d.exec() == QDialog::Accepted) {
KdenliveSettings::setSm_loop(ui.sm_loop->isChecked());
KdenliveSettings::setCaptureinterval(ui.sm_interval->value());
KdenliveSettings::setSm_framesplayback(ui.sm_framesplayback->value());
+ KdenliveSettings::setSm_notifytime(ui.sm_notifytime->value());
+ KdenliveSettings::setSm_prenotify(ui.sm_prenotify->isChecked());
+ m_intervalTimer.setInterval(KdenliveSettings::captureinterval() * 1000);
}
}
frame_list->setHidden(!show);
}
-void StopmotionWidget::slotIntervalCapture(bool capture)
-{
- if (capture) slotCaptureFrame();
-}
-
void StopmotionWidget::slotUpdateHandler()
{
if (m_bmCapture == NULL) return;
if (sequence_name->currentText().isEmpty()) {
QString seqName = QInputDialog::getText(this, i18n("Create New Sequence"), i18n("Enter sequence name"));
- if (seqName.isEmpty()) return;
+ if (seqName.isEmpty()) {
+ m_captureAction->setChecked(false);
+ return;
+ }
sequence_name->blockSignals(true);
sequence_name->setItemText(sequence_name->currentIndex(), seqName);
sequence_name->blockSignals(false);
m_sequenceFrame = 0;
}
//capture_button->setEnabled(false);
+ if (m_intervalTimer.isActive()) {
+ // stop interval capture
+ m_intervalTimer.stop();
+ return;
+ }
QString currentPath = getPathForFrame(m_sequenceFrame);
m_bmCapture->captureFrame(currentPath);
KNotification::event("FrameCaptured", i18n("Frame Captured"), QPixmap(), this);
m_sequenceFrame++;
button_addsequence->setEnabled(true);
- if (m_intervalCapture->isChecked()) QTimer::singleShot(KdenliveSettings::captureinterval() * 1000, this, SLOT(slotCaptureFrame()));
+ if (capture_interval->isChecked()) {
+ if (KdenliveSettings::sm_prenotify()) QTimer::singleShot((KdenliveSettings::captureinterval() - KdenliveSettings::sm_notifytime()) * 1000, this, SLOT(slotPreNotify()));
+ m_intervalTimer.start();
+ }
+ else m_captureAction->setChecked(false);
+}
+
+void StopmotionWidget::slotPreNotify()
+{
+ if (m_captureAction->isChecked()) KNotification::event("ReadyToCapture", i18n("Going to Capture Frame"), QPixmap(), this);
}
#include <QLabel>
#include <QFuture>
#include <QVBoxLayout>
+#include <QTimer>
class MyLabel : public QLabel
{
/** @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;
/** @brief Tells if we are in animation (playback) mode. */
bool m_animate;
+
+ /** @brief Timer for interval capture. */
+ QTimer m_intervalTimer;
#ifdef QIMAGEBLITZ
/** @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 Delete current frame from disk. */
void slotRemoveFrame();
+
/** @brief Enable / disable frame analysis (in color scopes). */
void slotSwitchAnalyse(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);
<x>0</x>
<y>0</y>
<width>338</width>
- <height>190</height>
+ <height>217</height>
</rect>
</property>
<property name="windowTitle">
<item row="0" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
- <string>Capture</string>
+ <string>Interval Capture</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
- <string>Capture interval (seconds)</string>
+ <string>Capture delay</string>
</property>
</widget>
</item>
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="sm_prenotify">
+ <property name="text">
+ <string>Notify before capture</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KIntSpinBox" name="sm_notifytime">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0" colspan="14">
+ <item row="0" column="0" colspan="15">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</widget>
</widget>
</item>
- <item row="1" column="8">
+ <item row="1" column="9">
<widget class="KComboBox" name="sequence_name">
<property name="toolTip">
<string>Sequence name</string>
</property>
</widget>
</item>
- <item row="1" column="10">
+ <item row="1" column="11">
<widget class="KComboBox" name="capture_device">
<property name="toolTip">
<string>Capture device</string>
</property>
</widget>
</item>
- <item row="1" column="11">
+ <item row="1" column="12">
<widget class="KComboBox" name="log_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</property>
</widget>
</item>
- <item row="1" column="12">
+ <item row="1" column="13">
<widget class="QPushButton" name="button_addsequence">
<property name="text">
<string>Add to project</string>
</property>
</widget>
</item>
- <item row="1" column="6">
+ <item row="1" column="7">
<widget class="QToolButton" name="preview_button">
<property name="toolTip">
<string>Preview sequence</string>
</property>
</widget>
</item>
- <item row="1" column="4">
- <widget class="QToolButton" name="capture_button">
- <property name="toolTip">
- <string>Capture frame</string>
- </property>
- <property name="whatsThis">
- <string/>
+ <item row="1" column="8">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Sequence name</string>
</property>
+ </widget>
+ </item>
+ <item row="1" column="6">
+ <widget class="QToolButton" name="overlay_button">
<property name="text">
<string>...</string>
</property>
- <property name="popupMode">
- <enum>QToolButton::MenuButtonPopup</enum>
- </property>
</widget>
</item>
- <item row="1" column="7">
- <widget class="QLabel" name="label">
+ <item row="1" column="5">
+ <widget class="QToolButton" name="capture_interval">
+ <property name="toolTip">
+ <string>Interval capture</string>
+ </property>
<property name="text">
- <string>Sequence name</string>
+ <string>...</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="5">
- <widget class="QToolButton" name="overlay_button">
+ <item row="1" column="4">
+ <widget class="QToolButton" name="capture_button">
+ <property name="toolTip">
+ <string>Capture frame</string>
+ </property>
<property name="text">
<string>...</string>
</property>