]> git.sesse.net Git - kdenlive/blobdiff - src/recmonitor.cpp
Moves VideoSurface into widgets folder.
[kdenlive] / src / recmonitor.cpp
index 58b24e65eb6e76624790fbca01e4096f4db31f68..f54e678b17e4f869115834f9b8f5b6b0890fc3a4 100644 (file)
 #include "monitormanager.h"
 #include "monitor.h"
 #include "profilesdialog.h"
+#include "widgets/videosurface.h"
 
 #include <KDebug>
-#include <KLocale>
+#include <KLocalizedString>
 #include <KStandardDirs>
 #include <KComboBox>
 #include <KIO/NetAccess>
@@ -45,7 +46,7 @@
 #include <QDesktopWidget>
 
 
-RecMonitor::RecMonitor(Kdenlive::MONITORID name, MonitorManager *manager, QWidget *parent) :
+RecMonitor::RecMonitor(Kdenlive::MonitorId name, MonitorManager *manager, QWidget *parent) :
     AbstractMonitor(name, manager, parent),
     m_isCapturing(false),
     m_didCapture(false),
@@ -181,7 +182,7 @@ RecMonitor::~RecMonitor()
     m_spaceTimer.stop();
     delete m_captureProcess;
     delete m_displayProcess;
-    if (m_captureDevice) delete m_captureDevice;
+    delete m_captureDevice;
 }
 
 void RecMonitor::mouseDoubleClickEvent(QMouseEvent * event)
@@ -612,7 +613,7 @@ void RecMonitor::slotRecord()
         while (QFile::exists(path)) {
             QString num = QString::number(i).rightJustified(4, '0', false);
             path = KUrl(m_capturePath).path(KUrl::AddTrailingSlash) + "capture" + num + '.' + extension;
-            i++;
+            ++i;
         }
         m_captureFile = KUrl(path);
 
@@ -723,14 +724,14 @@ void RecMonitor::slotRecord()
            m_captureArgs << "-f" << "x11grab";
            if (KdenliveSettings::grab_follow_mouse()) m_captureArgs << "-follow_mouse" << "centered";
            if (!KdenliveSettings::grab_hide_frame()) m_captureArgs << "-show_region" << "1";
+           captureSize = ":0.0";
             if (KdenliveSettings::grab_capture_type() == 0) {
                 // Full screen capture
-                captureSize = ":0.0";
                m_captureArgs << "-s" << QString::number(screenSize.width()) + "x" + QString::number(screenSize.height());
            } else {
                 // Region capture
                 m_captureArgs << "-s" << QString::number(KdenliveSettings::grab_width()) + "x" + QString::number(KdenliveSettings::grab_height());
-                captureSize = ":" + QString::number(KdenliveSettings::grab_offsetx()) + "." + QString::number(KdenliveSettings::grab_offsetx());
+                captureSize.append("+" + QString::number(KdenliveSettings::grab_offsetx()) + "." + QString::number(KdenliveSettings::grab_offsetx()));
             }
             // fps
             m_captureArgs << "-r" << QString::number(KdenliveSettings::grab_fps());
@@ -799,7 +800,8 @@ void RecMonitor::showWarningMessage(const QString &text, bool logAction)
        m_infoMessage->addAction(manualAction);
     }
 #if KDE_IS_VERSION(4,10,0)
-    m_infoMessage->animatedShow();
+    if (isVisible())
+       m_infoMessage->animatedShow();
 #else
     QTimer::singleShot(0, m_infoMessage, SLOT(animatedShow()));
 #endif
@@ -815,7 +817,7 @@ void RecMonitor::showWarningMessage(const QString &text, bool logAction)
 #endif
 }
 
-const QString RecMonitor::getV4lXmlPlaylist(MltVideoProfile profile, bool *isXml) 
+const QString RecMonitor::getV4lXmlPlaylist(const MltVideoProfile &profile, bool *isXml)
 {
     QString playlist;
     if (rec_video->isChecked() && rec_audio->isChecked()) {
@@ -969,7 +971,7 @@ void RecMonitor::manageCapturedFiles()
     kDebug() << "Found : " << capturedFiles.count() << " new capture files";
     kDebug() << capturedFiles;
 
-    if (capturedFiles.count() > 0) {
+    if (!capturedFiles.isEmpty()) {
         QPointer<ManageCapturesDialog> d = new ManageCapturesDialog(capturedFiles, this);
         if (d->exec() == QDialog::Accepted) {
             emit addProjectClipList(d->importFiles());