+ m_frame_preview->setHidden(true);
+ m_monitor->videoBox->setHidden(false);
+ QLocale locale;
+
+ MltVideoProfile profile;
+ QString resource;
+ QString service;
+ QString profilePath;
+ // Create MLT producer data
+ if (capture_device->itemData(capture_device->currentIndex()) == "v4l") {
+ // Capture using a video4linux device
+ profilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+ profile = ProfilesDialog::getVideoProfile(profilePath);
+ service = "avformat-novalidate";
+ QString devicePath = capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 1).toString();
+ resource = QString("video4linux2:%1?width:%2&height:%3&frame_rate:%4").arg(devicePath).arg(profile.width).arg(profile.height).arg((double) profile.frame_rate_num / profile.frame_rate_den);
+ }
+ else {
+ // Decklink capture
+ profilePath = KdenliveSettings::current_profile();
+ profile = ProfilesDialog::getVideoProfile(profilePath);
+ service = "decklink";
+ resource = capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 1).toString();
+ }
+
+ if (m_captureDevice == NULL) {
+ m_captureDevice = new MltDeviceCapture(profilePath, m_monitor->videoSurface, this);
+ m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
+ m_monitor->setRender(m_captureDevice);
+ connect(m_captureDevice, SIGNAL(frameSaved(QString)), this, SLOT(slotNewThumb(QString)));
+ }
+
+ m_manager->activateMonitor(Kdenlive::StopMotionMonitor);
+ QString producer = createProducer(profile, service, resource);
+ if (m_captureDevice->slotStartPreview(producer, true)) {
+ if (m_showOverlay->isChecked()) {
+ reloadOverlay();
+ slotUpdateOverlay();
+ }
+ capture_button->setEnabled(true);
+ live_button->setChecked(true);
+ log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, locale.toString((double)profile.frame_rate_num/profile.frame_rate_den).rightJustified(2, '0')));
+ log_box->setCurrentIndex(0);
+ }
+ else {
+ kDebug()<<"// problem starting stopmo";
+ log_box->insertItem(-1, i18n("Failed to start device"));
+ log_box->setCurrentIndex(0);
+ }
+ }
+ else {
+ m_frame_preview->setHidden(false);
+ live_button->setChecked(false);
+ if (m_captureDevice) {
+ m_captureDevice->stop();
+ m_monitor->videoBox->setHidden(true);
+ log_box->insertItem(-1, i18n("Stopped"));
+ log_box->setCurrentIndex(0);
+ //delete m_captureDevice;
+ //m_captureDevice = NULL;
+ }
+ }
+
+ /*
+ if (isOn && m_bmCapture) {