X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fwizard.cpp;h=062f13dc143e8ca2f5eaecb5f57de54a1dbea7bd;hb=4274029010fe1c1f4f5a2d4d4b6981fbdb57f490;hp=0a28a9e04027a58049ce56603fbd7c22d79cc657;hpb=c41c091cab21c9e0948e6a088099708c63fa1c5b;p=kdenlive diff --git a/src/wizard.cpp b/src/wizard.cpp index 0a28a9e0..062f13dc 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -20,7 +20,14 @@ #include "wizard.h" #include "kdenlivesettings.h" #include "profilesdialog.h" -#include "kdenlive-config.h" +#include "renderer.h" +#ifdef USE_V4L +#include "v4l/v4lcapture.h" +#endif +#include "config-kdenlive.h" + +#include +#include #include #include @@ -35,11 +42,16 @@ #include #include -const double recommendedMltVersion = 45; -static const char version[] = VERSION; +// Recommended MLT version +const int mltVersionMajor = 0; +const int mltVersionMinor = 8; +const int mltVersionRevision = 0; + +static const char kdenlive_version[] = VERSION; Wizard::Wizard(bool upgrade, QWidget *parent) : - QWizard(parent) + QWizard(parent), + m_systemCheckIsOk(false) { setWindowTitle(i18n("Config Wizard")); setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png"))); @@ -48,7 +60,7 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : page1->setTitle(i18n("Welcome")); QLabel *label; if (upgrade) - label = new QLabel(i18n("Your Kdenlive version was upgraded to version %1. Please take some time to review the basic settings", QString(version).section(' ', 0, 0))); + label = new QLabel(i18n("Your Kdenlive version was upgraded to version %1. Please take some time to review the basic settings", QString(kdenlive_version).section(' ', 0, 0))); else label = new QLabel(i18n("This is the first time you run Kdenlive. This wizard will let you adjust some basic settings, you will be ready to edit your first movie in a few seconds...")); label->setWordWrap(true); @@ -122,6 +134,22 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : slotCheckThumbs(); addPage(page3); +#ifndef Q_WS_MAC + QWizardPage *page6 = new QWizardPage; + page6->setTitle(i18n("Capture device")); + m_capture.setupUi(page6); + bool found_decklink = Render::getBlackMagicDeviceList(m_capture.decklink_devices); + KdenliveSettings::setDecklink_device_found(found_decklink); + if (found_decklink) m_capture.decklink_status->setText(i18n("Default Blackmagic Decklink card:")); + else m_capture.decklink_status->setText(i18n("No Blackmagic Decklink device found")); + connect(m_capture.decklink_devices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDecklinkDevice(int))); + connect(m_capture.button_reload, SIGNAL(clicked()), this, SLOT(slotDetectWebcam())); + connect(m_capture.v4l_devices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateCaptureParameters())); + connect(m_capture.v4l_formats, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSaveCaptureFormat())); + m_capture.button_reload->setIcon(KIcon("view-refresh")); + + addPage(page6); +#endif QWizardPage *page5 = new QWizardPage; page5->setTitle(i18n("Checking system")); @@ -130,10 +158,100 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : listViewDelegate = new WizardDelegate(m_check.programList); m_check.programList->setItemDelegate(listViewDelegate); - + slotDetectWebcam(); QTimer::singleShot(500, this, SLOT(slotCheckMlt())); } +void Wizard::slotDetectWebcam() +{ +#ifdef USE_V4L + m_capture.v4l_devices->blockSignals(true); + m_capture.v4l_devices->clear(); + + // Video 4 Linux device detection + for (int i = 0; i < 10; i++) { + QString path = "/dev/video" + QString::number(i); + if (QFile::exists(path)) { + QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path.toUtf8().constData()); + if (!deviceInfo.isEmpty()) { + m_capture.v4l_devices->addItem(deviceInfo.at(0), path); + m_capture.v4l_devices->setItemData(m_capture.v4l_devices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1); + } + } + } + if (m_capture.v4l_devices->count() > 0) { + m_capture.v4l_status->setText(i18n("Default video4linux device:")); + // select default device + bool found = false; + for (int i = 0; i < m_capture.v4l_devices->count(); i++) { + QString device = m_capture.v4l_devices->itemData(i).toString(); + if (device == KdenliveSettings::video4vdevice()) { + m_capture.v4l_devices->setCurrentIndex(i); + found = true; + break; + } + } + slotUpdateCaptureParameters(); + if (!found) m_capture.v4l_devices->setCurrentIndex(0); + } else m_capture.v4l_status->setText(i18n("No device found, plug your webcam and refresh.")); + m_capture.v4l_devices->blockSignals(false); +#endif /* USE_V4L */ +} + +void Wizard::slotUpdateCaptureParameters() +{ + QString device = m_capture.v4l_devices->itemData(m_capture.v4l_devices->currentIndex()).toString(); + if (!device.isEmpty()) KdenliveSettings::setVideo4vdevice(device); + + QString formats = m_capture.v4l_devices->itemData(m_capture.v4l_devices->currentIndex(), Qt::UserRole + 1).toString(); + + m_capture.v4l_formats->blockSignals(true); + m_capture.v4l_formats->clear(); + + QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux"); + if (QFile::exists(vl4ProfilePath)) { + MltVideoProfile profileInfo = ProfilesDialog::getVideoProfile(vl4ProfilePath); + m_capture.v4l_formats->addItem(i18n("Current settings (%1x%2, %3/%4fps)", profileInfo.width, profileInfo.height, profileInfo.frame_rate_num, profileInfo.frame_rate_den), QStringList() << QString("unknown") <', QString::SkipEmptyParts); + QString itemSize; + QString pixelFormat; + QStringList itemRates; + for (int i = 0; i < pixelformats.count(); i++) { + QString format = pixelformats.at(i).section(':', 0, 0); + QStringList sizes = pixelformats.at(i).split(':', QString::SkipEmptyParts); + pixelFormat = sizes.takeFirst(); + for (int j = 0; j < sizes.count(); j++) { + itemSize = sizes.at(j).section('=', 0, 0); + itemRates = sizes.at(j).section('=', 1, 1).split(',', QString::SkipEmptyParts); + for (int k = 0; k < itemRates.count(); k++) { + QString formatDescription = '[' + format + "] " + itemSize + " (" + itemRates.at(k) + ')'; + if (m_capture.v4l_formats->findText(formatDescription) == -1) + m_capture.v4l_formats->addItem(formatDescription, QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1)); + } + } + } + if (!QFile::exists(vl4ProfilePath)) { + if (m_capture.v4l_formats->count() > 9) slotSaveCaptureFormat(); + else { + // No existing profile and no autodetected profiles + MltVideoProfile profileInfo; + profileInfo.width = 320; + profileInfo.height = 200; + profileInfo.frame_rate_num = 15; + profileInfo.frame_rate_den = 1; + profileInfo.display_aspect_num = 4; + profileInfo.display_aspect_den = 3; + profileInfo.sample_aspect_num = 1; + profileInfo.sample_aspect_den = 1; + profileInfo.progressive = 1; + profileInfo.colorspace = 601; + ProfilesDialog::saveProfile(profileInfo, vl4ProfilePath); + m_capture.v4l_formats->addItem(i18n("Default settings (%1x%2, %3/%4fps)", profileInfo.width, profileInfo.height, profileInfo.frame_rate_num, profileInfo.frame_rate_den), QStringList() << QString("unknown") <blockSignals(false); +} void Wizard::checkMltComponents() { @@ -149,156 +267,141 @@ void Wizard::checkMltComponents() meltitem->setSizeHint(0, itemSize); meltitem->setIcon(0, m_okIcon); - // Check MLT's installed producers - QProcess checkProcess; - checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer"); - if (!checkProcess.waitForStarted()) { - meltitem->setIcon(0, m_badIcon); - meltitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (melt)")); + + Mlt::Repository *repository = Mlt::Factory::init(); + if (!repository) { + mltitem->setData(1, Qt::UserRole, i18n("Cannot start the MLT video backend!")); + mltitem->setIcon(0, m_badIcon); + m_systemCheckIsOk = false; button(QWizard::NextButton)->setEnabled(false); - } else { - checkProcess.waitForFinished(); - QByteArray result = checkProcess.readAllStandardError(); + } + else { + int mltVersion = (mltVersionMajor << 16) + (mltVersionMinor << 8) + mltVersionRevision; + mltitem->setText(1, i18n("MLT version: %1", mlt_version_get_string())); + mltitem->setSizeHint(0, itemSize); + if (mlt_version_get_int() < 1792) { + mltitem->setData(1, Qt::UserRole, i18n("Your MLT version is unsupported!!!")); + mltitem->setIcon(0, m_badIcon); + m_systemCheckIsOk = false; + button(QWizard::NextButton)->setEnabled(false); + } + else if (mlt_version_get_int() < mltVersion) { + mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to MLT %1.%2.%3", mltVersionMajor, mltVersionMinor, mltVersionRevision)); + mltitem->setIcon(0, m_badIcon); + } + else { + mltitem->setData(1, Qt::UserRole, i18n("MLT video backend!")); + mltitem->setIcon(0, m_okIcon); + } + + // Retrieve the list of available transitions. + Mlt::Properties *producers = repository->producers(); + QStringList producersItemList; + for (int i = 0; i < producers->count(); ++i) + producersItemList << producers->get_name(i); + delete producers; + + Mlt::Properties *consumers = repository->consumers(); + QStringList consumersItemList; + for (int i = 0; i < consumers->count(); ++i) + consumersItemList << consumers->get_name(i); + delete consumers; + + // SDL module + QTreeWidgetItem *sdlItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("SDL module")); + sdlItem->setData(1, Qt::UserRole, i18n("Required for Kdenlive")); + sdlItem->setSizeHint(0, itemSize); + + if (!consumersItemList.contains("sdl")) { + sdlItem->setIcon(0, m_badIcon); + m_systemCheckIsOk = false; + button(QWizard::NextButton)->setEnabled(false); + } + else { + sdlItem->setIcon(0, m_okIcon); + } - // Check MLT avformat module + // AVformat module QTreeWidgetItem *avformatItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Avformat module (FFmpeg)")); avformatItem->setData(1, Qt::UserRole, i18n("Required to work with various video formats (hdv, mpeg, flash, ...)")); avformatItem->setSizeHint(0, itemSize); - if (!result.contains("- avformat")) { + Mlt::Consumer *consumer = NULL; + Mlt::Profile p; + if (consumersItemList.contains("avformat")) + consumer = new Mlt::Consumer(p, "avformat"); + if (consumer == NULL || !consumer->is_valid()) { avformatItem->setIcon(0, m_badIcon); m_mltCheck.tabWidget->setTabEnabled(1, false); - } else { + } + else { avformatItem->setIcon(0, m_okIcon); - // Make sure we have MLT > 0.3.4 - int version = 0; - QString mltVersion; - QString exepath = KStandardDirs::findExe("pkg-config"); - if (!exepath.isEmpty()) { - checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt++"); - if (!checkProcess.waitForStarted()) { - kDebug() << "// Error querying MLT's version"; - } else { - checkProcess.waitForFinished(); - mltVersion = checkProcess.readAllStandardOutput(); - version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); - kDebug() << "// FOUND MLT's pkgconfig version: " << version; - } - } - if (version == 0) { - checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "--version"); - if (!checkProcess.waitForStarted()) { - kDebug() << "// Error querying MLT's version"; - } else { - checkProcess.waitForFinished(); - mltVersion = checkProcess.readAllStandardError(); - mltVersion = mltVersion.section('\n', 0, 0).simplified(); - mltVersion = mltVersion.section(' ', -1).simplified(); - version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt(); - kDebug() << "// FOUND MLT version: " << version; - } - } - - mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified())); - mltitem->setSizeHint(0, itemSize); - if (version < 40) { - mltitem->setData(1, Qt::UserRole, i18n("Your MLT version is unsupported!!!")); - mltitem->setIcon(0, m_badIcon); - } else { - if (version < recommendedMltVersion) { - mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version")); - mltitem->setIcon(0, m_badIcon); - } else { - mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct")); - mltitem->setIcon(0, m_okIcon); - } - // Check installed audio codecs - QProcess checkProcess2; - checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list"); - if (!checkProcess2.waitForStarted()) { - m_mltCheck.tabWidget->setTabEnabled(1, false); - kDebug() << "// Error parsing MLT's avformat codecs"; - } else { - checkProcess2.waitForFinished(); - QByteArray codecList = checkProcess2.readAllStandardError(); - QString acodecList(codecList); - QStringList result; - QStringList alist = acodecList.split('\n', QString::SkipEmptyParts); - for (int i = 0; i < alist.count(); i++) { - if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower()); - } - m_mltCheck.acodecs_list->addItems(result); - KdenliveSettings::setAudiocodecs(result); - //kDebug()<<"// FOUND LIST:\n\n"<addItems(result); - KdenliveSettings::setVideocodecs(result); - //kDebug()<<"// FOUND LIST:\n\n"<addItems(result); - KdenliveSettings::setSupportedformats(result); - //kDebug()<<"// FOUND LIST:\n\n"<set("vcodec", "list"); + consumer->set("acodec", "list"); + consumer->set("f", "list"); + consumer->start(); + QStringList result; + Mlt::Properties vcodecs((mlt_properties) consumer->get_data("vcodec")); + for (int i = 0; i < vcodecs.count(); i++) + result << QString(vcodecs.get(i)); + m_mltCheck.vcodecs_list->addItems(result); + KdenliveSettings::setVideocodecs(result); + result.clear(); + Mlt::Properties acodecs((mlt_properties) consumer->get_data("acodec")); + for (int i = 0; i < acodecs.count(); i++) + result << QString(acodecs.get(i)); + m_mltCheck.acodecs_list->addItems(result); + KdenliveSettings::setAudiocodecs(result); + result.clear(); + Mlt::Properties formats((mlt_properties) consumer->get_data("f")); + for (int i = 0; i < formats.count(); i++) + result << QString(formats.get(i)); + m_mltCheck.formats_list->addItems(result); + KdenliveSettings::setSupportedformats(result); + delete consumer; } - // Check MLT dv module + // DV module QTreeWidgetItem *dvItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("DV module (libdv)")); dvItem->setData(1, Qt::UserRole, i18n("Required to work with dv files if avformat module is not installed")); dvItem->setSizeHint(0, itemSize); - if (!result.contains("- libdv")) { + if (!producersItemList.contains("libdv")) { dvItem->setIcon(0, m_badIcon); - } else { + } + else { dvItem->setIcon(0, m_okIcon); } - // Check MLT image format module + // Image module QTreeWidgetItem *imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("QImage module")); imageItem->setData(1, Qt::UserRole, i18n("Required to work with images")); imageItem->setSizeHint(0, itemSize); - if (!result.contains("- qimage")) { + if (!producersItemList.contains("qimage")) { imageItem->setIcon(0, m_badIcon); imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Pixbuf module")); imageItem->setData(1, Qt::UserRole, i18n("Required to work with images")); imageItem->setSizeHint(0, itemSize); - if (!result.contains("- pixbuf")) imageItem->setIcon(0, m_badIcon); - else imageItem->setIcon(0, m_okIcon); - } else { + if (producersItemList.contains("pixbuf")) { + imageItem->setIcon(0, m_badIcon); + } + else { + imageItem->setIcon(0, m_okIcon); + } + } + else { imageItem->setIcon(0, m_okIcon); } + + // Titler module + QTreeWidgetItem *titleItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Title module")); + titleItem->setData(1, Qt::UserRole, i18n("Required to work with titles")); + titleItem->setSizeHint(0, itemSize); + if (!producersItemList.contains("kdenlivetitle")) { + KdenliveSettings::setHastitleproducer(false); + titleItem->setIcon(0, m_badIcon); + } else { + titleItem->setIcon(0, m_okIcon); + KdenliveSettings::setHastitleproducer(true); + } } } @@ -312,34 +415,56 @@ void Wizard::slotCheckPrograms() item->setData(1, Qt::UserRole, i18n("Required for webcam capture")); item->setSizeHint(0, itemSize); QString exepath = KStandardDirs::findExe("ffmpeg"); - if (exepath.isEmpty()) item->setIcon(0, m_badIcon); - else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon); - else item->setIcon(0, m_okIcon); + QString playpath = KStandardDirs::findExe("ffplay"); + item->setIcon(0, m_okIcon); + if (exepath.isEmpty()) { + // Check for libav version + exepath = KStandardDirs::findExe("avconv"); + if (exepath.isEmpty()) item->setIcon(0, m_badIcon); + } + if (playpath.isEmpty()) { + // Check for libav version + playpath = KStandardDirs::findExe("avplay"); + if (playpath.isEmpty()) item->setIcon(0, m_badIcon); + } + if (!exepath.isEmpty()) KdenliveSettings::setFfmpegpath(exepath); + if (!playpath.isEmpty()) KdenliveSettings::setFfplaypath(playpath); #ifndef Q_WS_MAC - item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Recordmydesktop")); + item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("recordmydesktop")); item->setData(1, Qt::UserRole, i18n("Required for screen capture")); item->setSizeHint(0, itemSize); if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); - item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvgrab")); + item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("dvgrab")); item->setData(1, Qt::UserRole, i18n("Required for firewire capture")); item->setSizeHint(0, itemSize); if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); #endif - item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor")); + item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("dvdauthor")); item->setData(1, Qt::UserRole, i18n("Required for creation of DVD")); item->setSizeHint(0, itemSize); if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); - item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Mkisofs")); + + item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("genisoimage or mkisofs")); item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images")); item->setSizeHint(0, itemSize); - if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, m_badIcon); + if (KStandardDirs::findExe("genisoimage").isEmpty()) { + // no GenIso, check for mkisofs + if (!KStandardDirs::findExe("mkisofs").isEmpty()) { + item->setIcon(0, m_okIcon); + } else item->setIcon(0, m_badIcon); + } else item->setIcon(0, m_okIcon); + + item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("xine")); + item->setData(1, Qt::UserRole, i18n("Required to preview your DVD")); + item->setSizeHint(0, itemSize); + if (KStandardDirs::findExe("xine").isEmpty()) item->setIcon(0, m_badIcon); else item->setIcon(0, m_okIcon); // set up some default applications @@ -371,7 +496,7 @@ void Wizard::installExtraMimes(QString baseName, QStringList globs) } else { QStringList extensions = mime->patterns(); QString comment = mime->comment(); - foreach(const QString &glob, globs) { + foreach(const QString & glob, globs) { if (!extensions.contains(glob)) extensions << glob; } kDebug() << "EXTS: " << extensions; @@ -398,7 +523,7 @@ void Wizard::installExtraMimes(QString baseName, QStringList globs) writer.writeEndElement(); // comment } - foreach(const QString& pattern, extensions) { + foreach(const QString & pattern, extensions) { writer.writeStartElement(nsUri, "glob"); writer.writeAttribute("pattern", pattern); writer.writeEndElement(); // glob @@ -492,7 +617,7 @@ void Wizard::adjustSettings() { if (m_extra.installmimes->isChecked()) { QStringList globs; - globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts"; + globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts" << "*.m2v"; installExtraMimes("video/mpeg", globs); globs.clear(); globs << "*.dv"; @@ -520,28 +645,9 @@ void Wizard::slotCheckMlt() if (KdenliveSettings::rendererpath().isEmpty()) { errorMessage.append(i18n("Your MLT installation cannot be found. Install MLT and restart Kdenlive.\n")); } - /*QProcess checkProcess; - checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer"); - if (!checkProcess.waitForStarted()) - errorMessage.append(i18n("Error starting MLT's command line player (melt)") + ".\n"); - - checkProcess.waitForFinished(); - - QByteArray result = checkProcess.readAllStandardError(); - if (!result.contains("- avformat")) errorMessage.append(i18n("MLT's avformat (FFMPEG) module not found. Please check your FFMPEG and MLT install. Kdenlive will not work until this issue is fixed.") + "\n");*/ - - QProcess checkProcess2; - checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer"); - if (!checkProcess2.waitForStarted()) - errorMessage.append(i18n("Error starting MLT's command line player (melt).") + '\n'); - - checkProcess2.waitForFinished(); - - QByteArray result = checkProcess2.readAllStandardError(); - if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + '\n'); if (!errorMessage.isEmpty()) { - errorMessage.prepend(QString("%1
").arg(i18n("Fatal Error"))); + errorMessage.prepend(QString("%1
").arg(i18n("Fatal Error"))); QLabel *pix = new QLabel(); pix->setPixmap(KIcon("dialog-error").pixmap(30)); QLabel *label = new QLabel(errorMessage); @@ -564,7 +670,32 @@ bool Wizard::isOk() const void Wizard::slotShowWebInfos() { - KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(version).section(' ', 0, 0)), "text/html", this); + KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(kdenlive_version).section(' ', 0, 0)), "text/html", this); +} + +void Wizard::slotSaveCaptureFormat() +{ + QStringList format = m_capture.v4l_formats->itemData(m_capture.v4l_formats->currentIndex()).toStringList(); + if (format.isEmpty()) return; + MltVideoProfile profile; + profile.description = "Video4Linux capture"; + profile.colorspace = 601; + profile.width = format.at(1).toInt(); + profile.height = format.at(2).toInt(); + profile.sample_aspect_num = 1; + profile.sample_aspect_den = 1; + profile.display_aspect_num = format.at(1).toInt(); + profile.display_aspect_den = format.at(2).toInt(); + profile.frame_rate_num = format.at(3).toInt(); + profile.frame_rate_den = format.at(4).toInt(); + profile.progressive = 1; + QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux"); + ProfilesDialog::saveProfile(profile, vl4ProfilePath); +} + +void Wizard::slotUpdateDecklinkDevice(int captureCard) +{ + KdenliveSettings::setDecklink_capturedevice(captureCard); } #include "wizard.moc"