1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
21 #include "recmonitor.h"
23 #include "kdenlivesettings.h"
24 #include "managecapturesdialog.h"
29 #include <KStandardDirs>
31 #include <KIO/NetAccess>
34 #include <QMouseEvent>
36 #include <QToolButton>
41 RecMonitor::RecMonitor(QString name, QWidget *parent) :
51 m_ui.video_frame->setAttribute(Qt::WA_PaintOnScreen);
52 m_ui.device_selector->setCurrentIndex(KdenliveSettings::defaultcapture());
53 connect(m_ui.device_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(slotVideoDeviceChanged(int)));
57 QToolBar *toolbar = new QToolBar(name, this);
58 QHBoxLayout *layout = new QHBoxLayout;
59 layout->setContentsMargins(0, 0, 0, 0);
60 m_playIcon = KIcon("media-playback-start");
61 m_pauseIcon = KIcon("media-playback-pause");
63 m_discAction = toolbar->addAction(KIcon("network-connect"), i18n("Connect"));
64 connect(m_discAction, SIGNAL(triggered()), this, SLOT(slotDisconnect()));
66 m_rewAction = toolbar->addAction(KIcon("media-seek-backward"), i18n("Rewind"));
67 connect(m_rewAction, SIGNAL(triggered()), this, SLOT(slotRewind()));
69 m_playAction = toolbar->addAction(m_playIcon, i18n("Play"));
70 connect(m_playAction, SIGNAL(triggered()), this, SLOT(slotStartCapture()));
72 m_stopAction = toolbar->addAction(KIcon("media-playback-stop"), i18n("Stop"));
73 connect(m_stopAction, SIGNAL(triggered()), this, SLOT(slotStopCapture()));
74 m_stopAction->setEnabled(false);
75 m_fwdAction = toolbar->addAction(KIcon("media-seek-forward"), i18n("Forward"));
76 connect(m_fwdAction, SIGNAL(triggered()), this, SLOT(slotForward()));
78 m_recAction = toolbar->addAction(KIcon("media-record"), i18n("Record"));
79 connect(m_recAction, SIGNAL(triggered()), this, SLOT(slotRecord()));
80 m_recAction->setCheckable(true);
82 toolbar->addSeparator();
84 QAction *configAction = toolbar->addAction(KIcon("configure"), i18n("Configure"));
85 connect(configAction, SIGNAL(triggered()), this, SLOT(slotConfigure()));
86 configAction->setCheckable(false);
88 layout->addWidget(toolbar);
89 m_ui.control_frame_firewire->setLayout(layout);
91 slotVideoDeviceChanged(m_ui.device_selector->currentIndex());
92 m_displayProcess = new QProcess;
93 m_captureProcess = new QProcess;
95 connect(m_captureProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotProcessStatus(QProcess::ProcessState)));
97 QStringList env = QProcess::systemEnvironment();
98 env << "SDL_WINDOWID=" + QString::number(m_ui.video_frame->winId());
100 QString videoDriver = KdenliveSettings::videodrivername();
101 if (!videoDriver.isEmpty()) {
102 if (videoDriver == "x11_noaccel") {
103 env << "SDL_VIDEO_YUV_HWACCEL=0";
104 env << "SDL_VIDEODRIVER=x11";
105 } else env << "SDL_VIDEODRIVER=" + videoDriver;
107 setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 1);
109 m_displayProcess->setEnvironment(env);
111 if (KdenliveSettings::video4capture().isEmpty()) {
112 QString captureCommand;
113 if (!KdenliveSettings::video4adevice().isEmpty()) captureCommand = "-f " + KdenliveSettings::video4aformat() + " -i " + KdenliveSettings::video4adevice();
115 captureCommand += " -f " + KdenliveSettings::video4vformat() + " -s " + KdenliveSettings::video4size() + " -r " + QString::number(KdenliveSettings::video4rate()) + " -i " + KdenliveSettings::video4vdevice();
116 KdenliveSettings::setVideo4capture(captureCommand);
119 kDebug() << "/////// BUILDING MONITOR, ID: " << m_ui.video_frame->winId();
122 RecMonitor::~RecMonitor()
124 delete m_captureProcess;
125 delete m_displayProcess;
128 QString RecMonitor::name() const
133 void RecMonitor::slotConfigure()
135 emit showConfigDialog(4, m_ui.device_selector->currentIndex());
138 void RecMonitor::slotUpdateCaptureFolder()
140 if (m_captureProcess) m_captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
141 slotVideoDeviceChanged(m_ui.device_selector->currentIndex());
144 void RecMonitor::slotVideoDeviceChanged(int ix)
148 m_discAction->setEnabled(false);
149 m_rewAction->setEnabled(false);
150 m_fwdAction->setEnabled(false);
151 m_recAction->setEnabled(true);
152 m_stopAction->setEnabled(false);
153 m_playAction->setEnabled(false);
154 if (KdenliveSettings::rmd_path().isEmpty()) {
155 QString rmdpath = KStandardDirs::findExe("recordmydesktop");
156 if (rmdpath.isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found,\n please install it for screen grabs")));
157 else KdenliveSettings::setRmd_path(rmdpath);
159 if (!KdenliveSettings::rmd_path().isEmpty()) m_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())));
160 //m_ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
163 m_discAction->setEnabled(false);
164 m_rewAction->setEnabled(false);
165 m_fwdAction->setEnabled(false);
166 m_recAction->setEnabled(true);
167 m_stopAction->setEnabled(false);
168 m_playAction->setEnabled(true);
169 checkDeviceAvailability();
172 m_discAction->setEnabled(true);
173 m_recAction->setEnabled(false);
174 m_stopAction->setEnabled(false);
175 m_playAction->setEnabled(false);
176 m_rewAction->setEnabled(false);
177 m_fwdAction->setEnabled(false);
178 //m_ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
179 if (KdenliveSettings::dvgrab_path().isEmpty()) {
180 QString dvgrabpath = KStandardDirs::findExe("dvgrab");
181 if (dvgrabpath.isEmpty()) m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("dvgrab utility not found,\n please install it for firewire capture")));
182 else KdenliveSettings::setDvgrab_path(dvgrabpath);
185 if (!KdenliveSettings::dvgrab_path().isEmpty()) m_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())));
190 QPixmap RecMonitor::mergeSideBySide(const QPixmap& pix, const QString txt)
193 QRect r = p.fontMetrics().boundingRect(QRect(0, 0, m_ui.video_frame->width(), m_ui.video_frame->height()), Qt::AlignLeft, txt);
194 int strWidth = r.width();
195 int strHeight = r.height();
196 int pixWidth = pix.width();
197 int pixHeight = pix.height();
198 QPixmap res(strWidth + 8 + pixWidth, qMax(strHeight, pixHeight));
199 res.fill(Qt::transparent);
201 p.drawPixmap(0, 0, pix);
202 p.drawText(QRect(pixWidth + 8, 0, strWidth, strHeight), 0, txt);
208 void RecMonitor::checkDeviceAvailability()
210 if (!KIO::NetAccess::exists(KUrl(KdenliveSettings::video4vdevice()), KIO::NetAccess::SourceSide , this)) {
211 m_playAction->setEnabled(false);
212 m_recAction->setEnabled(false);
213 m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice())));
214 //m_ui.video_frame->setText(i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice()));
215 } else //m_ui.video_frame->setText(i18n("Press play or record button\nto start video capture"));
216 m_ui.video_frame->setPixmap(mergeSideBySide(KIcon("camera-web").pixmap(QSize(50, 50)), i18n("Press play or record button\nto start video capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
219 void RecMonitor::slotDisconnect()
221 if (m_captureProcess->state() == QProcess::NotRunning) {
222 m_captureTime = KDateTime::currentLocalDateTime();
223 kDebug() << "CURRENT TIME: " << m_captureTime.toString();
224 m_didCapture = false;
225 slotStartCapture(false);
226 m_discAction->setIcon(KIcon("network-disconnect"));
227 m_discAction->setText(i18n("Disonnect"));
228 m_recAction->setEnabled(true);
229 m_stopAction->setEnabled(true);
230 m_playAction->setEnabled(true);
231 m_rewAction->setEnabled(true);
232 m_fwdAction->setEnabled(true);
234 m_captureProcess->write("q", 1);
235 QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
236 if (m_didCapture) manageCapturedFiles();
237 m_didCapture = false;
241 void RecMonitor::slotRewind()
243 m_captureProcess->write("a", 1);
246 void RecMonitor::slotForward()
248 m_captureProcess->write("z", 1);
251 void RecMonitor::slotStopCapture()
254 switch (m_ui.device_selector->currentIndex()) {
256 m_captureProcess->write("\e", 2);
257 m_playAction->setIcon(m_playIcon);
261 m_captureProcess->write("q\n", 3);
262 QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
266 m_captureProcess->write("q\n", 3);
267 QTimer::singleShot(1000, m_captureProcess, SLOT(kill()));
274 void RecMonitor::slotStartCapture(bool play)
278 *captureProcess<<"dvgrab";
282 switch (m_recPanel->capture_format->currentItem()){
284 *captureProcess<<"--format"<<"dv1";
287 *captureProcess<<"--format"<<"dv2";
290 *captureProcess<<"--format"<<"hdv";
294 *captureProcess<<"--format"<<"raw";
298 if (KdenliveSettings::autosplit()) *captureProcess<<"--autosplit";
299 if (KdenliveSettings::timestamp()) *captureProcess<<"--timestamp";
300 *captureProcess<<"-i"<<"capture"<<"-";*/
303 QStringList captureArgs;
304 captureArgs<<"--format"<<"hdv"<<"-i"<<"capture"<<"-";
305 QStringList displayArgs;
307 displayArgs<<"-f"<<"mpegts"<<"-x"<<QString::number(m_ui.video_frame->width())<<"-y"<<QString::number(m_ui.video_frame->height())<<"-";
309 captureProcess->setStandardOutputProcess(displayProcess);
310 m_ui.video_frame->setScaledContents(false);
311 captureProcess->start("dvgrab",captureArgs);
312 displayProcess->start("ffplay", displayArgs);*/
315 if (m_captureProcess->state() != QProcess::NotRunning) {
316 if (m_ui.device_selector->currentIndex() == FIREWIRE) {
318 m_captureProcess->write("k", 1);
319 //captureProcess->write("\e", 2);
320 m_playAction->setIcon(m_playIcon);
323 m_captureProcess->write("p", 1);
324 m_playAction->setIcon(m_pauseIcon);
330 m_captureArgs.clear();
331 m_displayArgs.clear();
334 switch (m_ui.device_selector->currentIndex()) {
336 switch (KdenliveSettings::firewireformat()) {
339 m_captureArgs << "--format" << "raw";
340 m_displayArgs << "-f" << "dv";
344 m_captureArgs << "--format" << "dv1";
345 m_displayArgs << "-f" << "dv";
349 m_captureArgs << "--format" << "dv2";
350 m_displayArgs << "-f" << "dv";
354 m_captureArgs << "--format" << "hdv";
355 m_displayArgs << "-f" << "mpegts";
358 if (KdenliveSettings::firewireautosplit()) m_captureArgs << "--autosplit";
359 if (KdenliveSettings::firewiretimestamp()) m_captureArgs << "--timestamp";
360 m_captureArgs << "-i" << "capture" << "-";
361 m_displayArgs << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
363 m_captureProcess->setStandardOutputProcess(m_displayProcess);
364 m_captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
365 kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
366 m_captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
367 if (play) m_captureProcess->write(" ", 1);
368 m_discAction->setEnabled(true);
371 m_captureArgs << KdenliveSettings::video4capture().simplified().split(' ') << KdenliveSettings::video4encoding().simplified().split(' ') << "-f" << "mpegts" << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-";
372 m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
373 m_captureProcess->setStandardOutputProcess(m_displayProcess);
374 kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
375 m_captureProcess->start("ffmpeg", m_captureArgs);
381 if (m_ui.device_selector->currentIndex() != SCREENGRAB) {
382 kDebug() << "Capture: Running ffplay " << m_displayArgs.join(" ");
383 m_displayProcess->start("ffplay", m_displayArgs);
384 m_ui.video_frame->setText(i18n("Initialising..."));
386 // do something when starting screen grab
390 void RecMonitor::slotRecord()
392 if (m_captureProcess->state() == QProcess::NotRunning && m_ui.device_selector->currentIndex() == FIREWIRE) {
396 switch (m_ui.device_selector->currentIndex()) {
398 m_captureProcess->write("\e", 2);
399 m_playAction->setIcon(m_playIcon);
400 m_isCapturing = false;
402 m_recAction->setChecked(false);
405 m_captureProcess->terminate();
407 //m_isCapturing = false;
408 QTimer::singleShot(1000, this, SLOT(slotStartCapture()));
411 //captureProcess->write("q\n", 3);
412 m_captureProcess->terminate();
413 m_ui.video_frame->setText(i18n("Encoding captured video..."));
414 // in case ffmpeg doesn't exit with the 'q' command, kill it one second later
415 //QTimer::singleShot(1000, captureProcess, SLOT(kill()));
419 } else if (m_ui.device_selector->currentIndex() == FIREWIRE) {
420 m_isCapturing = true;
422 m_captureProcess->write("c\n", 3);
425 if (m_captureProcess->state() == QProcess::NotRunning) {
426 m_recAction->setChecked(true);
427 QString extension = "mp4";
428 if (m_ui.device_selector->currentIndex() == SCREENGRAB) extension = "ogv"; //KdenliveSettings::screengrabextension();
429 QString path = KdenliveSettings::capturefolder() + "/capture0000." + extension;
431 while (QFile::exists(path)) {
432 QString num = QString::number(i).rightJustified(4, '0', false);
433 path = KdenliveSettings::capturefolder() + "/capture" + num + '.' + extension;
437 m_captureFile = KUrl(path);
439 m_captureArgs.clear();
440 m_displayArgs.clear();
443 switch (m_ui.device_selector->currentIndex()) {
445 m_captureArgs << "--format" << "hdv" << "-i" << "capture" << "-";
446 m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
447 m_captureProcess->setStandardOutputProcess(m_displayProcess);
448 kDebug() << "Capture: Running dvgrab " << m_captureArgs.join(" ");
449 m_captureProcess->start(KdenliveSettings::dvgrab_path(), m_captureArgs);
452 m_captureArgs << KdenliveSettings::video4capture().simplified().split(' ') << KdenliveSettings::video4encoding().simplified().split(' ') << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-y" << m_captureFile.path() << "-f" << "mpegts" << "-vcodec" << "mpeg4" << "-acodec" << "mp2" << "-";
453 m_displayArgs << "-f" << "mpegts" << "-x" << QString::number(m_ui.video_frame->width()) << "-y" << QString::number(m_ui.video_frame->height()) << "-";
454 m_captureProcess->setStandardOutputProcess(m_displayProcess);
455 kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
456 m_captureProcess->start("ffmpeg", m_captureArgs);
459 switch (KdenliveSettings::rmd_capture_type()) {
461 // Full screen capture, nothing special to do
465 m_captureArgs << "-width" << QString::number(KdenliveSettings::rmd_width()) << "-height" << QString::number(KdenliveSettings::rmd_height());
466 if (!KdenliveSettings::rmd_follow_mouse()) {
467 m_captureArgs << "-x" << QString::number(KdenliveSettings::rmd_offsetx()) << "-y" << QString::number(KdenliveSettings::rmd_offsety());
469 m_captureArgs << "--follow-mouse";
470 if (KdenliveSettings::rmd_hide_frame()) m_captureArgs << "--no-frame";
474 m_isCapturing = true;
475 if (KdenliveSettings::rmd_capture_audio()) {
476 m_captureArgs << "-freq" << KdenliveSettings::rmd_freq();
477 m_captureArgs << "-channels" << QString::number(KdenliveSettings::rmd_audio_channels());
478 if (KdenliveSettings::rmd_use_jack()) {
479 m_captureArgs << "-use-jack" << KdenliveSettings::rmd_jackports();
480 if (KdenliveSettings::rmd_jack_buffer() > 0.0)
481 m_captureArgs << "-ring-buffer-size" << QString::number(KdenliveSettings::rmd_jack_buffer());
483 if (!KdenliveSettings::rmd_alsadevicename().isEmpty())
484 m_captureArgs << "-device" << KdenliveSettings::rmd_alsadevicename();
485 if (KdenliveSettings::rmd_alsa_buffer() > 0)
486 m_captureArgs << "-buffer-size" << QString::number(KdenliveSettings::rmd_alsa_buffer());
488 } else m_captureArgs << "--no-sound";
490 if (KdenliveSettings::rmd_fullshots()) m_captureArgs << "--full-shots";
491 m_captureArgs << "-workdir" << KdenliveSettings::currenttmpfolder();
492 m_captureArgs << "-fps" << QString::number(KdenliveSettings::rmd_fps()) << "-o" << m_captureFile.path();
493 m_captureProcess->start(KdenliveSettings::rmd_path(), m_captureArgs);
494 kDebug() << "// RecordMyDesktop params: " << m_captureArgs;
501 if (m_ui.device_selector->currentIndex() != SCREENGRAB) {
502 m_isCapturing = true;
503 kDebug() << "Capture: Running ffplay " << m_displayArgs.join(" ");
504 m_displayProcess->start("ffplay", m_displayArgs);
505 m_ui.video_frame->setText(i18n("Initialising..."));
509 m_displayProcess->kill();
510 //captureProcess->kill();
511 QTimer::singleShot(1000, this, SLOT(slotRecord()));
516 void RecMonitor::slotStartGrab(const QRect &rect) {
517 rgnGrab->deleteLater();
518 QApplication::restoreOverrideCursor();
520 if (rect.isNull()) return;
521 int width = rect.width();
522 int height = rect.height();
523 if (width % 2 != 0) width--;
524 if (height % 2 != 0) height--;
525 QString args = KdenliveSettings::screengrabcapture().replace("%size", QString::number(width) + "x" + QString::number(height)).replace("%offset", "+" + QString::number(rect.x()) + "," + QString::number(rect.y()));
526 if (KdenliveSettings::screengrabenableaudio()) {
527 // also capture audio
528 if (KdenliveSettings::useosscapture()) m_captureArgs << KdenliveSettings::screengrabosscapture().simplified().split(' ');
529 else m_captureArgs << KdenliveSettings::screengrabalsacapture2().simplified().split(' ');
531 m_captureArgs << args.simplified().split(' ') << KdenliveSettings::screengrabencoding().simplified().split(' ') << m_captureFile.path();
532 m_isCapturing = true;
533 m_ui.video_frame->setText(i18n("Capturing..."));
534 if (KdenliveSettings::screengrabenableaudio() && !KdenliveSettings::useosscapture()) {
535 QStringList alsaArgs = KdenliveSettings::screengrabalsacapture().simplified().split(' ');
536 alsaProcess->setStandardOutputProcess(captureProcess);
537 kDebug() << "Capture: Running arecord " << alsaArgs.join(" ");
538 alsaProcess->start("arecord", alsaArgs);
540 kDebug() << "Capture: Running ffmpeg " << m_captureArgs.join(" ");
541 captureProcess->start("ffmpeg", m_captureArgs);
544 void RecMonitor::slotProcessStatus(QProcess::ProcessState status)
546 if (status == QProcess::NotRunning) {
547 m_displayProcess->kill();
548 if (m_isCapturing && m_ui.device_selector->currentIndex() != FIREWIRE)
549 if (m_ui.autoaddbox->isChecked() && QFile::exists(m_captureFile.path())) emit addProjectClip(m_captureFile);
550 if (m_ui.device_selector->currentIndex() == FIREWIRE) {
551 m_discAction->setIcon(KIcon("network-connect"));
552 m_discAction->setText(i18n("Connect"));
553 m_playAction->setEnabled(false);
554 m_rewAction->setEnabled(false);
555 m_fwdAction->setEnabled(false);
556 m_recAction->setEnabled(false);
559 m_playAction->setIcon(m_playIcon);
560 m_recAction->setChecked(false);
561 m_stopAction->setEnabled(false);
562 m_ui.device_selector->setEnabled(true);
563 if (m_captureProcess && m_captureProcess->exitStatus() == QProcess::CrashExit) {
564 m_ui.video_frame->setText(i18n("Capture crashed, please check your parameters"));
566 if (m_ui.device_selector->currentIndex() != SCREENGRAB) m_ui.video_frame->setText(i18n("Not connected"));
567 else m_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())));
569 m_isCapturing = false;
571 if (m_ui.device_selector->currentIndex() != SCREENGRAB) m_stopAction->setEnabled(true);
572 m_ui.device_selector->setEnabled(false);
576 void RecMonitor::manageCapturedFiles()
579 switch (KdenliveSettings::firewireformat()) {
591 QDir dir(KdenliveSettings::capturefolder());
593 filters << "capture*" + extension;
594 const QStringList result = dir.entryList(filters, QDir::Files, QDir::Time);
595 KUrl::List capturedFiles;
596 foreach(const QString &name, result) {
597 KUrl url = KUrl(dir.filePath(name));
598 if (KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
599 KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
600 if (file.time(KFileItem::ModificationTime) > m_captureTime) capturedFiles.append(url);
603 kDebug() << "Found : " << capturedFiles.count() << " new capture files";
604 kDebug() << capturedFiles;
606 if (capturedFiles.count() > 0) {
607 ManageCapturesDialog *d = new ManageCapturesDialog(capturedFiles, this);
608 if (d->exec() == QDialog::Accepted) {
609 capturedFiles = d->importFiles();
610 foreach(const KUrl &url, capturedFiles) {
611 emit addProjectClip(url);
619 void RecMonitor::mousePressEvent(QMouseEvent * /*event*/)
624 void RecMonitor::activateRecMonitor()
626 //if (!m_isActive) m_monitorManager->activateRecMonitor(m_name);
629 void RecMonitor::stop()
635 void RecMonitor::start()
641 void RecMonitor::refreshRecMonitor(bool visible)
644 //if (!m_isActive) m_monitorManager->activateRecMonitor(m_name);
649 void RecMonitor::slotPlay()
652 //if (!m_isActive) m_monitorManager->activateRecMonitor(m_name);
657 #include "recmonitor.moc"