+
+void RecMonitor::showWarningMessage(const QString &text, bool logAction)
+{
+#if KDE_IS_VERSION(4,7,0)
+ m_infoMessage->setText(text);
+ m_infoMessage->setMessageType(KMessageWidget::Warning);
+ if (logAction) {
+ QAction *manualAction = new QAction(i18n("Show log"), this);
+ connect(manualAction, SIGNAL(triggered()), this, SLOT(slotShowLog()));
+ m_infoMessage->addAction(manualAction);
+ }
+#if KDE_IS_VERSION(4,10,0)
+ if (isVisible())
+ m_infoMessage->animatedShow();
+#else
+ QTimer::singleShot(0, m_infoMessage, SLOT(animatedShow()));
+#endif
+#else
+ if (!logAction) {
+ video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), text));
+
+ }
+ else {
+ video_frame->setText(QString("<qt>" + text + "<br><a href=\"http://kde.org\">" + i18n("Show log") + "</a>"));
+ connect(video_frame, SIGNAL(linkActivated(QString)), this, SLOT(slotShowLog()));
+ }
+#endif
+}
+
+const QString RecMonitor::getV4lXmlPlaylist(const MltVideoProfile &profile, bool *isXml)
+{
+ QString playlist;
+ if (rec_video->isChecked() && rec_audio->isChecked()) {
+ // We want to capture audio and video, use xml playlist
+ *isXml = true;
+ playlist = QString("<mlt title=\"capture\" LC_NUMERIC=\"C\"><profile description=\"v4l\" width=\"%1\" height=\"%2\" progressive=\"%3\" sample_aspect_num=\"%4\" sample_aspect_den=\"%5\" display_aspect_num=\"%6\" display_aspect_den=\"%7\" frame_rate_num=\"%8\" frame_rate_den=\"%9\" colorspace=\"%10\"/>").arg(profile.width).arg(profile.height).arg(profile.progressive).arg(profile.sample_aspect_num).arg(profile.sample_aspect_den).arg(profile.display_aspect_num).arg(profile.display_aspect_den).arg(profile.frame_rate_num).arg(profile.frame_rate_den).arg(profile.colorspace);
+
+ playlist.append(QString("<producer id=\"producer0\" in=\"0\" out=\"999999\"><property name=\"mlt_type\">producer</property><property name=\"length\">1000000</property><property name=\"eof\">loop</property><property name=\"resource\">video4linux2:%1?width:%2&height:%3&frame_rate:%4</property><property name=\"mlt_service\">avformat-novalidate</property></producer><playlist id=\"playlist0\"><entry producer=\"producer0\" in=\"0\" out=\"999999\"/></playlist>").arg(KdenliveSettings::video4vdevice()).arg(profile.width).arg(profile.height).arg((double) profile.frame_rate_num / profile.frame_rate_den));
+
+ playlist.append(QString("<producer id=\"producer1\" in=\"0\" out=\"999999\"><property name=\"mlt_type\">producer</property><property name=\"length\">1000000</property><property name=\"resource\">alsa:%1?channels=%2</property><property name=\"audio_index\">0</property><property name=\"video_index\">-1</property><property name=\"mlt_service\">avformat-novalidate</property></producer><playlist id=\"playlist1\"><entry producer=\"producer1\" in=\"0\" out=\"999999\"/></playlist>").arg(KdenliveSettings::v4l_alsadevicename()).arg(KdenliveSettings::alsachannels()));
+
+ playlist.append("<tractor id=\"tractor0\" title=\"video0\" global_feed=\"1\" in=\"0\" out=\"999999\">");
+ playlist.append("<track producer=\"playlist0\"/><track producer=\"playlist1\"/>");
+ playlist.append("</tractor></mlt>");
+ }
+ else if (rec_audio->isChecked()) {
+ // Audio only recording
+ *isXml = false;
+ playlist =QString("alsa:%1?channels=%2").arg(KdenliveSettings::v4l_alsadevicename()).arg(KdenliveSettings::alsachannels());
+ }
+ else {
+ // Video only recording
+ *isXml = false;
+ playlist =QString("video4linux2:%1?width:%2&height:%3&frame_rate:%4").arg(KdenliveSettings::video4vdevice()).arg(profile.width).arg(profile.height).arg((double) profile.frame_rate_num / profile.frame_rate_den);
+
+ }
+
+ return playlist;
+}
+