//virtual
void MyLabel::wheelEvent(QWheelEvent* event)
{
- if (event->delta() > 0) emit seek(true);
- else emit seek(false);
+ if (event->delta() > 0)
+ emit seek(true);
+ else
+ emit seek(false);
}
//virtual
StopmotionMonitor::StopmotionMonitor(MonitorManager *manager, QWidget *parent) :
- AbstractMonitor(Kdenlive::stopmotionMonitor, manager, parent),
+ AbstractMonitor(Kdenlive::StopMotionMonitor, manager, parent),
m_captureDevice(NULL)
{
createVideoSurface();
return m_captureDevice;
}
-Kdenlive::MONITORID StopmotionMonitor::id() const
+Kdenlive::MonitorId StopmotionMonitor::id() const
{
- return Kdenlive::stopmotionMonitor;
+ return Kdenlive::StopMotionMonitor;
}
StopmotionWidget::StopmotionWidget(MonitorManager *manager, const KUrl &projectFolder, const QList<QAction *> &actions, QWidget* parent) :
QDialog(parent)
- , Ui::Stopmotion_UI()
- , m_projectFolder(projectFolder)
- , m_captureDevice(NULL)
- , m_sequenceFrame(0)
- , m_animatedIndex(-1)
- , m_animate(false)
- , m_manager(manager)
- , m_monitor(new StopmotionMonitor(manager, this))
+ , Ui::Stopmotion_UI()
+ , m_projectFolder(projectFolder)
+ , m_captureDevice(NULL)
+ , m_sequenceFrame(0)
+ , m_animatedIndex(-1)
+ , m_animate(false)
+ , m_manager(manager)
+ , m_monitor(new StopmotionMonitor(manager, this))
{
//setAttribute(Qt::WA_DeleteOnClose);
//HACK: the monitor widget is hidden, it is just used to control the capturedevice from monitormanager
void StopmotionWidget::slotUpdateOverlayEffect(QAction* act)
{
- if (act) m_effectIndex = act->data().toInt();
+ if (act)
+ m_effectIndex = act->data().toInt();
KdenliveSettings::setStopmotioneffect(m_effectIndex);
slotUpdateOverlay();
}
connect(m_captureDevice, SIGNAL(frameSaved(QString)), this, SLOT(slotNewThumb(QString)));
}
- m_manager->activateMonitor(Kdenlive::stopmotionMonitor);
+ m_manager->activateMonitor(Kdenlive::StopMotionMonitor);
QString producer = createProducer(profile, service, resource);
if (m_captureDevice->slotStartPreview(producer, true)) {
if (m_showOverlay->isChecked()) {
void StopmotionWidget::reloadOverlay()
{
- QString path = getPathForFrame(m_sequenceFrame - 1);
+ const QString path = getPathForFrame(m_sequenceFrame - 1);
if (!QFile::exists(path)) {
log_box->insertItem(-1, i18n("No previous frame found"));
log_box->setCurrentIndex(0);
m_sequenceFrame++;
button_addsequence->setEnabled(true);
if (capture_interval->isChecked()) {
- if (KdenliveSettings::sm_prenotify()) QTimer::singleShot((KdenliveSettings::captureinterval() - KdenliveSettings::sm_notifytime()) * 1000, this, SLOT(slotPreNotify()));
+ if (KdenliveSettings::sm_prenotify())
+ QTimer::singleShot((KdenliveSettings::captureinterval() - KdenliveSettings::sm_notifytime()) * 1000, this, SLOT(slotPreNotify()));
m_intervalTimer.start();
}
- else m_captureAction->setChecked(false);
+ else
+ m_captureAction->setChecked(false);
}
void StopmotionWidget::slotPreNotify()
void StopmotionWidget::slotPrepareThumbs()
{
- if (m_filesList.isEmpty()) return;
+ if (m_filesList.isEmpty())
+ return;
QString path = m_filesList.takeFirst();
emit doCreateThumbs(QImage(path), SlideshowClip::getFrameNumberFromPath(path));
QString StopmotionWidget::getPathForFrame(int ix, QString seqName)
{
- if (seqName.isEmpty()) seqName = m_sequenceName;
- return m_projectFolder.path(KUrl::AddTrailingSlash) + seqName + '_' + QString::number(ix).rightJustified(4, '0', false) + ".png";
+ if (seqName.isEmpty())
+ seqName = m_sequenceName;
+ return m_projectFolder.path(KUrl::AddTrailingSlash) + seqName + QLatin1Char('_') + QString::number(ix).rightJustified(4, '0', false) + QLatin1String(".png");
}
void StopmotionWidget::slotShowFrame(const QString& path)
{
frame_list->blockSignals(true);
QListWidgetItem* item = getFrameFromIndex(ix);
- if (!item) return;
+ if (!item)
+ return;
frame_list->setCurrentItem(item);
frame_list->blockSignals(false);
}
{
if (frame_list->currentItem() == NULL) return;
QString path = frame_list->currentItem()->toolTip();
- if (KMessageBox::questionYesNo(this, i18n("Delete frame %1 from disk?", path), i18n("Delete Frame")) != KMessageBox::Yes) return;
+ if (KMessageBox::questionYesNo(this, i18n("Delete frame %1 from disk?", path), i18n("Delete Frame")) != KMessageBox::Yes)
+ return;
+
QFile f(path);
if (f.remove()) {
QListWidgetItem* item = frame_list->takeItem(frame_list->currentRow());
void StopmotionWidget::slotSwitchMirror(bool isOn)
{
//KdenliveSettings::setAnalyse_stopmotion(isOn);
- if (m_captureDevice) m_captureDevice->mirror(isOn);
+ if (m_captureDevice)
+ m_captureDevice->mirror(isOn);
}