]> git.sesse.net Git - kdenlive/blobdiff - src/stopmotion/stopmotion.cpp
Fix Blackmagic Decklink output, cleanup pause / play stuff in all configs (SDL /...
[kdenlive] / src / stopmotion / stopmotion.cpp
index 5611f2d41a10efbf511d0f9a23b04810dc532f7e..b937eff3dbdd605a8b8b93dece083131b63ee7f3 100644 (file)
@@ -16,9 +16,6 @@
  ***************************************************************************/
 
 #include "stopmotion.h"
-#ifdef USE_BLACKMAGIC
-#include "blackmagic/devices.h"
-#endif
 #ifdef USE_V4L
 #include "v4l/v4lcapture.h"
 #endif
@@ -97,6 +94,7 @@ StopmotionMonitor::StopmotionMonitor(MonitorManager *manager, QWidget *parent) :
     AbstractMonitor(Kdenlive::stopmotionMonitor, manager, parent),
     m_captureDevice(NULL)
 {
+    createVideoSurface();
 }
 
 StopmotionMonitor::~StopmotionMonitor()
@@ -133,14 +131,6 @@ void StopmotionMonitor::start()
 {
 }
 
-void StopmotionMonitor::pause()
-{
-}
-
-void StopmotionMonitor::unpause()
-{
-}
-
 void StopmotionMonitor::slotPlay()
 {
 }
@@ -266,15 +256,13 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder,
     QVBoxLayout *layout = new QVBoxLayout;
     layout->setContentsMargins(0, 0, 0, 0);
     layout->setSpacing(0);
-    m_videoBox = new VideoContainer(m_monitor);
-    m_videoBox->setLineWidth(4);
-    layout->addWidget(m_videoBox);
+    m_monitor->videoBox->setLineWidth(4);
+    layout->addWidget(m_monitor->videoBox);
 
-#ifdef USE_BLACKMAGIC
-    if (BMInterface::getBlackMagicDeviceList(capture_device)) {
+    if (KdenliveSettings::decklink_device_found()) {
         // Found a BlackMagic device
     }
-#endif
+
     if (QFile::exists(KdenliveSettings::video4vdevice())) {
 #ifdef USE_V4L
         // Video 4 Linux device detection
@@ -319,7 +307,7 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder,
         profilePath = KdenliveSettings::current_profile();
     }
 
-    m_captureDevice = new MltDeviceCapture(profilePath, m_videoBox, this);
+    m_captureDevice = new MltDeviceCapture(profilePath, m_monitor->videoSurface, this);
     m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
     m_monitor->setRender(m_captureDevice);
     connect(m_captureDevice, SIGNAL(frameSaved(const QString &)), this, SLOT(slotNewThumb(const QString &)));
@@ -446,8 +434,8 @@ void StopmotionWidget::parseExistingSequences()
     //dir.setNameFilters(filters);
     QStringList sequences = dir.entryList(filters, QDir::Files, QDir::Name);
     //kDebug()<<"PF: "<<<<", sm: "<<sequences;
-    foreach(QString sequencename, sequences) {
-        sequence_name->addItem(sequencename.section("_", 0, -2));
+    foreach(const QString &sequencename, sequences) {
+        sequence_name->addItem(sequencename.section('_', 0, -2));
     }
 }
 
@@ -479,7 +467,7 @@ void StopmotionWidget::slotLive(bool isOn)
     capture_button->setEnabled(false);
     if (isOn) {
         m_frame_preview->setHidden(true);
-        m_videoBox->setHidden(false);
+        m_monitor->videoBox->setHidden(false);
         QLocale locale;
 
         MltVideoProfile profile;
@@ -504,7 +492,7 @@ void StopmotionWidget::slotLive(bool isOn)
         }
 
         if (m_captureDevice == NULL) {
-            m_captureDevice = new MltDeviceCapture(profilePath, m_videoBox, this);
+            m_captureDevice = new MltDeviceCapture(profilePath, m_monitor->videoSurface, this);
             m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
             m_monitor->setRender(m_captureDevice);
             connect(m_captureDevice, SIGNAL(frameSaved(const QString &)), this, SLOT(slotNewThumb(const QString &)));
@@ -533,7 +521,7 @@ void StopmotionWidget::slotLive(bool isOn)
         live_button->setChecked(false);
         if (m_captureDevice) {
             m_captureDevice->stop();
-            m_videoBox->setHidden(true);
+            m_monitor->videoBox->setHidden(true);
             log_box->insertItem(-1, i18n("Stopped"));
             log_box->setCurrentIndex(0);
             //delete m_captureDevice;
@@ -730,7 +718,7 @@ void StopmotionWidget::slotCreateThumbs(QImage img, int ix)
 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";
+    return m_projectFolder.path(KUrl::AddTrailingSlash) + seqName + '_' + QString::number(ix).rightJustified(4, '0', false) + ".png";
 }
 
 void StopmotionWidget::slotShowFrame(const QString& path)