]> git.sesse.net Git - kdenlive/blobdiff - src/stopmotion/stopmotion.cpp
Merge branch 'refs/heads/v0.8.2'
[kdenlive] / src / stopmotion / stopmotion.cpp
index 136273cd039762ae66fc548f273f5b2e5bea1dfb..f3251fa68306078c26fa9a8a132928e4fa956507 100644 (file)
  ***************************************************************************/
 
 #include "stopmotion.h"
-#include "../blackmagic/devices.h"
-#if !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD)
-#include "../v4l/v4lcapture.h"
+#include "blackmagic/devices.h"
+#ifdef USE_V4L
+#include "v4l/v4lcapture.h"
 #endif
-#include "../slideshowclip.h"
-#include "../profilesdialog.h"
-#include "../mltdevicecapture.h"
-#include "../recmonitor.h"
-#include "../monitormanager.h"
+#include "slideshowclip.h"
+#include "profilesdialog.h"
+#include "mltdevicecapture.h"
+#include "recmonitor.h"
+#include "monitormanager.h"
 #include "ui_smconfig_ui.h"
 #include "kdenlivesettings.h"
 
-
 #include <KDebug>
 #include <KGlobalSettings>
 #include <KFileDialog>
@@ -257,7 +256,7 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder,
         // Found a BlackMagic device
     }
     if (QFile::exists(KdenliveSettings::video4vdevice())) {
-#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD)
+#ifdef USE_V4L
         // Video 4 Linux device detection
         for (int i = 0; i < 10; i++) {
             QString path = "/dev/video" + QString::number(i);
@@ -271,12 +270,12 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder,
                 }
             }
         }
-#endif
+#endif /* USE_V4L */
     }
 
     connect(capture_device, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDeviceHandler()));
     /*if (m_bmCapture) {
-        connect(m_bmCapture, SIGNAL(frameSaved(const QString)), this, SLOT(slotNewThumb(const QString)));
+        connect(m_bmCapture, SIGNAL(frameSaved(const QString &)), this, SLOT(slotNewThumb(const QString &)));
         connect(m_bmCapture, SIGNAL(gotFrame(QImage)), this, SIGNAL(gotFrame(QImage)));
     } else live_button->setEnabled(false);*/
 
@@ -303,7 +302,7 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder,
     m_captureDevice = new MltDeviceCapture(profilePath, m_videoBox, this);
     m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
     m_monitor->setRender(m_captureDevice);
-    connect(m_captureDevice, SIGNAL(frameSaved(const QString)), this, SLOT(slotNewThumb(const QString)));
+    connect(m_captureDevice, SIGNAL(frameSaved(const QString &)), this, SLOT(slotNewThumb(const QString &)));
 
     live_button->setChecked(false);
     button_addsequence->setEnabled(false);
@@ -400,7 +399,7 @@ void StopmotionWidget::slotUpdateDeviceHandler()
     }
     m_layout->removeWidget(m_frame_preview);
     if (data == "v4l") {
-#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD)
+#ifdef USE_V4L
         m_bmCapture = new V4lCaptureHandler(m_layout);
         m_bmCapture->setDevice(capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 1).toString(), capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 2).toString());
 #endif
@@ -461,6 +460,7 @@ void StopmotionWidget::slotLive(bool isOn)
     if (isOn) {
         m_frame_preview->setHidden(true);
         m_videoBox->setHidden(false);
+        QLocale locale;
 
         MltVideoProfile profile;
         QString resource;
@@ -487,7 +487,7 @@ void StopmotionWidget::slotLive(bool isOn)
             m_captureDevice = new MltDeviceCapture(profilePath, m_videoBox, this);
             m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
             m_monitor->setRender(m_captureDevice);
-            connect(m_captureDevice, SIGNAL(frameSaved(const QString)), this, SLOT(slotNewThumb(const QString)));
+            connect(m_captureDevice, SIGNAL(frameSaved(const QString &)), this, SLOT(slotNewThumb(const QString &)));
         }
 
         m_manager->activateMonitor("stopmotion");
@@ -499,7 +499,7 @@ void StopmotionWidget::slotLive(bool isOn)
             }
             capture_button->setEnabled(true);
             live_button->setChecked(true);
-            log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, QString::number((double)profile.frame_rate_num/profile.frame_rate_den).rightJustified(2, '0')));
+            log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, locale.toString((double)profile.frame_rate_num/profile.frame_rate_den).rightJustified(2, '0')));
             log_box->setCurrentIndex(0);
         }
         else {
@@ -663,7 +663,7 @@ void StopmotionWidget::slotPreNotify()
 }
 
 
-void StopmotionWidget::slotNewThumb(const QString path)
+void StopmotionWidget::slotNewThumb(const QString &path)
 {
     if (!KdenliveSettings::showstopmotionthumbs()) return;
     m_filesList.append(path);
@@ -882,8 +882,9 @@ void StopmotionWidget::slotSwitchMirror(bool isOn)
     if (m_captureDevice) m_captureDevice->mirror(isOn);
 }
 
-const QString StopmotionWidget::createProducer(MltVideoProfile profile, const QString service, const QString resource)
+const QString StopmotionWidget::createProducer(MltVideoProfile profile, const QString &service, const QString &resource)
 {
+    Q_UNUSED(profile)
 
     QString playlist = "<mlt title=\"capture\"><producer id=\"producer0\" in=\"0\" out=\"99999\"><property name=\"mlt_type\">producer</property><property name=\"length\">100000</property><property name=\"eof\">pause</property><property name=\"resource\">" + resource + "</property><property name=\"mlt_service\">" + service + "</property></producer>";