]> git.sesse.net Git - kdenlive/blobdiff - src/recmonitor.cpp
* Clip Markers are now displayed over the clip monitor
[kdenlive] / src / recmonitor.cpp
index 4160d102eceeea7315b75bdcf0296623eca5e685..c0c602fa3bb391b3c71674ee9ac599ac23b6a6d0 100644 (file)
@@ -143,10 +143,10 @@ void RecMonitor::slotVideoDeviceChanged(int ix) {
         m_playAction->setEnabled(false);
         if (KdenliveSettings::rmd_path().isEmpty()) {
             QString rmdpath = KStandardDirs::findExe("recordmydesktop");
-            if (rmdpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found, please install it for screen grabs")));
+            if (rmdpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found,\n please install it for screen grabs")));
             else KdenliveSettings::setRmd_path(rmdpath);
         }
-        ui.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", KdenliveSettings::capturefolder())));
+        if (!KdenliveSettings::rmd_path().isEmpty()) ui.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", KdenliveSettings::capturefolder())));
         //ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
         break;
     case VIDEO4LINUX:
@@ -166,7 +166,13 @@ void RecMonitor::slotVideoDeviceChanged(int ix) {
         m_rewAction->setEnabled(false);
         m_fwdAction->setEnabled(false);
         //ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
-        ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+        if (KdenliveSettings::dvgrab_path().isEmpty()) {
+            QString dvgrabpath = KStandardDirs::findExe("dvgrab");
+            if (dvgrabpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("dvgrab utility not found,\n please install it for firewire capture")));
+            else KdenliveSettings::setDvgrab_path(dvgrabpath);
+        }
+
+        if (!KdenliveSettings::dvgrab_path().isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
         break;
     }
 }
@@ -340,7 +346,7 @@ void RecMonitor::slotStartCapture(bool play) {
         captureProcess->setStandardOutputProcess(displayProcess);
         captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
         kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
-        captureProcess->start("dvgrab", m_captureArgs);
+        captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
         if (play) captureProcess->write(" ", 1);
         m_discAction->setEnabled(true);
         break;
@@ -422,7 +428,7 @@ void RecMonitor::slotRecord() {
             m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
             captureProcess->setStandardOutputProcess(displayProcess);
             kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
-            captureProcess->start("dvgrab", m_captureArgs);
+            captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
             break;
         case VIDEO4LINUX:
             m_captureArgs << KdenliveSettings::video4capture().simplified().split(' ') << "-y" << m_captureFile.path() << "-f" << KdenliveSettings::video4vencoding() << "-";
@@ -441,17 +447,30 @@ void RecMonitor::slotRecord() {
                 m_captureArgs << "-width" << QString::number(KdenliveSettings::rmd_width()) << "-height" << QString::number(KdenliveSettings::rmd_height());
                 if (!KdenliveSettings::rmd_follow_mouse()) {
                     m_captureArgs << "-x" << QString::number(KdenliveSettings::rmd_offsetx()) << "-y" << QString::number(KdenliveSettings::rmd_offsety());
-                } else m_captureArgs << "--follow-mouse";
+                } else {
+                    m_captureArgs << "--follow-mouse";
+                    if (KdenliveSettings::rmd_hide_frame()) m_captureArgs << "--no-frame";
+                }
                 break;
             }
             m_isCapturing = true;
             if (KdenliveSettings::rmd_capture_audio()) {
-                if (KdenliveSettings::rmd_use_jack()) m_captureArgs << "-use-jack" << KdenliveSettings::rmd_jackports();
-                else if (!KdenliveSettings::rmd_alsadevicename().isEmpty())
-                    m_captureArgs << "-device" << KdenliveSettings::rmd_alsadevicename();
+               m_captureArgs << "-freq" << KdenliveSettings::rmd_freq();
+               m_captureArgs << "-channels" << QString::number(KdenliveSettings::rmd_audio_channels());
+                if (KdenliveSettings::rmd_use_jack()) {
+                    m_captureArgs << "-use-jack" << KdenliveSettings::rmd_jackports();
+                    if (KdenliveSettings::rmd_jack_buffer() > 0.0)
+                        m_captureArgs << "-ring-buffer-size" << QString::number(KdenliveSettings::rmd_jack_buffer());
+                } else {
+                    if (!KdenliveSettings::rmd_alsadevicename().isEmpty())
+                        m_captureArgs << "-device" << KdenliveSettings::rmd_alsadevicename();
+                    if (KdenliveSettings::rmd_alsa_buffer() > 0)
+                        m_captureArgs << "-buffer-size" << QString::number(KdenliveSettings::rmd_alsa_buffer());
+                }
             } else m_captureArgs << "--no-sound";
 
             if (KdenliveSettings::rmd_fullshots()) m_captureArgs << "--full-shots";
+            m_captureArgs << "-workdir" << KdenliveSettings::currenttmpfolder();
             m_captureArgs << "-fps" << QString::number(KdenliveSettings::rmd_fps()) << "-o" << m_captureFile.path();
             captureProcess->start(KdenliveSettings::rmd_path(), m_captureArgs);
             kDebug() << "// RecordMyDesktop params: " << m_captureArgs;