]> git.sesse.net Git - kdenlive/blobdiff - src/recmonitor.cpp
Disable screen grab if FFmpeg does not support it: http://kdenlive.org/mantis/view...
[kdenlive] / src / recmonitor.cpp
index 3c9f3cea7dd1a105dc88fc25823ff3f254acf6cf..06dba63e6608e14d17fabf6d0eb14bc83c119632 100644 (file)
@@ -229,6 +229,7 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
     QString capturename;
     m_previewSettings->setEnabled(ix == VIDEO4LINUX || ix == BLACKMAGIC);
     control_frame->setVisible(ix == VIDEO4LINUX);
+    m_playAction->setVisible(ix != SCREENGRAB);
     m_fwdAction->setVisible(ix == FIREWIRE);
     m_discAction->setVisible(ix == FIREWIRE);
     m_rewAction->setVisible(ix == FIREWIRE);
@@ -261,7 +262,14 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
            if (exepath.isEmpty()) video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("ffmpeg or avconv not found,\n please install it for screen grabs")));
            else KdenliveSettings::setFfmpegpath(exepath);
        }
-        if (!KdenliveSettings::ffmpegpath().isEmpty()) video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", m_capturePath)));
+        if (!KdenliveSettings::ffmpegpath().isEmpty()) {
+           if (!Render::checkX11Grab()) {
+               // FFmpeg does not support screen grab
+               video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Your FFmpeg / Libav installation\n does not support screen grab")));
+               m_recAction->setEnabled(false);
+           }
+           else video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", m_capturePath)));
+       }
         //video_frame->setText(i18n("Press record button\nto start screen capture"));
         break;
     case VIDEO4LINUX:
@@ -717,6 +725,7 @@ void RecMonitor::slotRecord()
            m_captureArgs << path;
            
             m_isCapturing = true;
+           m_recAction->setEnabled(false);
             /*if (KdenliveSettings::rmd_capture_audio()) {
                 m_captureArgs << "--freq" << KdenliveSettings::rmd_freq();
                 m_captureArgs << "--channels" << QString::number(KdenliveSettings::rmd_audio_channels());
@@ -835,6 +844,9 @@ void RecMonitor::slotProcessStatus(QProcess::ProcessState status)
             m_fwdAction->setEnabled(false);
             m_recAction->setEnabled(false);
         }
+        else {
+           m_recAction->setEnabled(true);
+       }
         m_isPlaying = false;
         m_playAction->setIcon(m_playIcon);
         m_recAction->setChecked(false);
@@ -860,7 +872,7 @@ void RecMonitor::slotProcessStatus(QProcess::ProcessState status)
         // update free space info
         slotUpdateFreeSpace();
     } else {
-        if (device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
+        if (device_selector->currentIndex()) m_stopAction->setEnabled(true);
         device_selector->setEnabled(false);
     }
 }