+ capture_button->setEnabled(false);
+ if (isOn) {
+ m_frame_preview->setHidden(true);
+ m_videoBox->setHidden(false);
+ QString path = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+
+ kDebug()<<"SURFACE; "<<m_videoBox->width()<<"x"<<m_videoBox->height();
+ if (m_captureDevice == NULL) {
+ m_captureDevice = new MltDeviceCapture(path, m_videoBox, this);
+ m_captureDevice->sendFrameForAnalysis = KdenliveSettings::analyse_stopmotion();
+ m_monitor->setRender(m_captureDevice);
+ connect(m_captureDevice, SIGNAL(frameSaved(const QString)), this, SLOT(slotNewThumb(const QString)));
+ }
+
+ MltVideoProfile profile = ProfilesDialog::getVideoProfile(path);
+ m_manager->activateMonitor("stopmotion");
+ QString producer = QString("avformat-novalidate: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);
+ if (m_captureDevice->slotStartPreview(producer)) {
+ kDebug()<<"// STARt CAPTURE GO";
+ capture_button->setEnabled(true);
+ live_button->setChecked(true);
+ log_box->insertItem(-1, i18n("Playing %1x%2 (%3 fps)", profile.width, profile.height, QString::number((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_videoBox->setHidden(true);
+ log_box->insertItem(-1, i18n("Stopped"));
+ log_box->setCurrentIndex(0);
+ //delete m_captureDevice;
+ //m_captureDevice = NULL;
+ }
+ }
+
+ /*