]> git.sesse.net Git - kdenlive/commitdiff
Cleaner fix for dvgrab timestamp issue (disable option in settings dialog if dvgrab...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 11 Nov 2008 16:18:18 +0000 (16:18 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 11 Nov 2008 16:18:18 +0000 (16:18 +0000)
http://www.kdenlive.org/mantis/view.php?id=338

svn path=/branches/KDE4/; revision=2674

src/kdenlivesettingsdialog.cpp
src/recmonitor.cpp
src/recmonitor.h

index 9b87ac1cfd6a3cf975dbab188e5574fdef404be6..da997ca3817482c8256e26d7920d9b17efc1da3a 100644 (file)
@@ -121,6 +121,25 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
     m_audioDevice = KdenliveSettings::audio_device();
     initDevices();
     connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
+
+    //HACK: check dvgrab version, because only dvgrab >= 3.3 supports
+    //   --timestamp option without bug
+    double dvgrabVersion = 0;
+
+    QProcess *versionCheck = new QProcess;
+    versionCheck->setProcessChannelMode(QProcess::MergedChannels);
+    versionCheck->start("dvgrab", QStringList() << "--version");
+    if (versionCheck->waitForFinished()) {
+        QString version = QString(versionCheck->readAll()).simplified();
+        if (version.contains(' ')) version = version.section(' ', -1);
+        dvgrabVersion = version.toDouble();
+        kDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
+    }
+    if (versionCheck) delete versionCheck;
+    if (dvgrabVersion < 3.3) {
+        KdenliveSettings::setFirewiretimestamp(false);
+        m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
+    }
 }
 
 KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
index 46690122c83a51144dd1524a40e651ae2b0a3357..828a5ea82f0a2dd20779c71bf5de0d3a572fbc5c 100644 (file)
@@ -39,7 +39,7 @@
 #include "recmonitor.h"
 
 RecMonitor::RecMonitor(QString name, QWidget *parent)
-        : QWidget(parent), m_name(name), m_isActive(false), m_isCapturing(false), m_isPlaying(false), m_didCapture(false), m_dvgrabVersion(0) {
+        : QWidget(parent), m_name(name), m_isActive(false), m_isCapturing(false), m_isPlaying(false), m_didCapture(false) {
     ui.setupUi(this);
 
     ui.video_frame->setAttribute(Qt::WA_PaintOnScreen);
@@ -117,19 +117,6 @@ RecMonitor::RecMonitor(QString name, QWidget *parent)
         KdenliveSettings::setVideo4playback(playbackCommand);
     }
 
-    //HACK: check dvgrab version, because only dvgrab >= 3.3 supports 
-    //                 --timestamp option without bug
-    QProcess *versionCheck = new QProcess;
-    versionCheck->setProcessChannelMode(QProcess::MergedChannels);
-    versionCheck->start("dvgrab", QStringList() << "--version");
-    if (versionCheck->waitForFinished()) {
-        QString version = QString(versionCheck->readAll()).simplified();
-        if (version.contains(' ')) version = version.section(' ', -1);
-        m_dvgrabVersion = version.toDouble();
-        kDebug() << "// FOUND DVGRAB VERSION: " << m_dvgrabVersion;
-    }
-    if (versionCheck) delete versionCheck;
-
     kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
 }
 
@@ -343,7 +330,7 @@ void RecMonitor::slotStartCapture(bool play) {
             break;
         }
         if (KdenliveSettings::firewireautosplit()) m_captureArgs << "--autosplit";
-        if (KdenliveSettings::firewiretimestamp() && m_dvgrabVersion >= 3.3) m_captureArgs << "--timestamp";
+        if (KdenliveSettings::firewiretimestamp()) m_captureArgs << "--timestamp";
         m_captureArgs << "-i" << "capture" << "-";
         m_displayArgs << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
 
index fbaf0663f521f22cb0528136f29824a3393fbf04..855acb13b5c04c5f63bfbbc10333606987d69043 100644 (file)
@@ -56,7 +56,6 @@ private:
     RegionGrabber *rgnGrab;
     bool m_isActive;
     KDateTime m_captureTime;
-    double m_dvgrabVersion;
 
     KUrl m_captureFile;
     KIcon m_playIcon;