+void RecMonitor::createHDMIDevice()
+{
+ //video_capture->setVisible(true);
+ if (m_bmCapture == NULL) {
+ QVBoxLayout *lay = new QVBoxLayout;
+ m_bmCapture = new BmdCaptureHandler(lay);
+ connect(m_bmCapture, SIGNAL(gotTimeCode(ulong)), this, SLOT(slotGotHDMIFrameNumber(ulong)));
+ connect(m_bmCapture, SIGNAL(gotMessage(const QString &)), this, SLOT(slotGotHDMIMessage(const QString &)));
+ video_capture->setLayout(lay);
+ }
+}
+
+void RecMonitor::slotGotHDMIFrameNumber(ulong ix)
+{
+ m_dvinfo.setText(QString::number(ix));
+}
+
+void RecMonitor::slotGotHDMIMessage(const QString &message)
+{
+ m_logger.insertItem(0, message);
+}
+
+QPixmap RecMonitor::mergeSideBySide(const QPixmap& pix, const QString txt)
+{
+ QPainter p;
+ QRect r = QApplication::fontMetrics().boundingRect(QRect(0, 0, video_frame->width(), video_frame->height()), Qt::AlignLeft, txt);
+ int strWidth = r.width();
+ int strHeight = r.height();
+ int pixWidth = pix.width();
+ int pixHeight = pix.height();
+ QPixmap res(strWidth + 8 + pixWidth, qMax(strHeight, pixHeight));
+ res.fill(Qt::transparent);
+ p.begin(&res);
+ p.drawPixmap(0, 0, pix);
+ p.setPen(kapp->palette().text().color());
+ p.drawText(QRect(pixWidth + 8, 0, strWidth, strHeight), 0, txt);
+ p.end();
+ return res;
+}
+
+
+void RecMonitor::checkDeviceAvailability()
+{
+ if (!KIO::NetAccess::exists(KUrl(KdenliveSettings::video4vdevice()), KIO::NetAccess::SourceSide , this)) {
+ m_playAction->setEnabled(false);
+ m_recAction->setEnabled(false);
+ 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())));
+ //video_frame->setText(i18n("Cannot read from device %1\nPlease check drivers and access rights.", KdenliveSettings::video4vdevice()));
+ } else //video_frame->setText(i18n("Press play or record button\nto start video capture"));
+ 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", m_capturePath)));
+}
+
+void RecMonitor::slotDisconnect()
+{
+ if (m_captureProcess->state() == QProcess::NotRunning) {
+ m_captureTime = KDateTime::currentLocalDateTime();
+ kDebug() << "CURRENT TIME: " << m_captureTime.toString();
+ m_didCapture = false;