Commit 044e2de9 authored by Nicolas Carion's avatar Nicolas Carion

Merge branch 'master' into refactoring_effects

parents b1c3367e e7beb7e4
......@@ -5,6 +5,13 @@ Uncompress=archive
[KNewStuff3]
Name=Kdenlive Render Profiles
Name[ca]=Perfils de renderització del Kdenlive
Name[ca@valencia]=Perfils de renderització del Kdenlive
Name[nl]=Renderprofielen van Kdenlive
Name[pt]=Perfis de Visualização do Kdenlive
Name[sv]=Kdenlive-återgivningsprofiler
Name[uk]=Профілі обробки Kdenlive
Name[x-test]=xxKdenlive Render Profilesxx
ProvidersUrl=http://download.kde.org/ocs/providers.xml
Categories=Kdenlive Export Profiles
TargetDir=kdenlive/export
......
......@@ -5,6 +5,13 @@ Uncompress=archive
[KNewStuff3]
Name=Kdenlive Title Templates
Name[ca]=Plantilles de títol del Kdenlive
Name[ca@valencia]=Plantilles de títol del Kdenlive
Name[nl]=Titelsjablonen van Kdenlive
Name[pt]=Perfis de Títulos do Kdenlive
Name[sv]=Kdenlive-titelmallar
Name[uk]=Шаблони титрів Kdenlive
Name[x-test]=xxKdenlive Title Templatesxx
ProvidersUrl=http://download.kde.org/ocs/providers.xml
Categories=Kdenlive Title Templates
TargetDir=kdenlive/titles
......
......@@ -5,6 +5,13 @@ Uncompress=archive
[KNewStuff3]
Name=Kdenlive Transition Wipes
Name[ca]=Cortinetes de transició del Kdenlive
Name[ca@valencia]=Cortinetes de transició del Kdenlive
Name[nl]=Overgangsvegen van Kdenlive
Name[pt]=Varrimentos de Transição do Kdenlive
Name[sv]=Kdenlive-övergångar
Name[uk]=Перехідні витирання Kdenlive
Name[x-test]=xxKdenlive Transition Wipesxx
ProvidersUrl=http://download.kde.org/ocs/providers.xml
Categories=Kdenlive FX
TargetDir=kdenlive/lumas
......
......@@ -72,8 +72,13 @@ int main(int argc, char **argv)
QString profile = args.takeFirst();
QString rendermodule = args.takeFirst();
QString player = args.takeFirst();
QByteArray srcString = args.takeFirst().toUtf8();
QUrl srcurl = QUrl::fromEncoded(srcString);
QString srcString = args.takeFirst();
QUrl srcurl;
if (srcString.startsWith(QLatin1String("consumer:"))) {
srcurl = QUrl::fromEncoded(srcString.section(QStringLiteral(":"), 1).toUtf8().constData());
} else {
srcurl = QUrl::fromEncoded(srcString.toUtf8().constData());
}
QString src = srcurl.toLocalFile();
// The QUrl path() strips the consumer: protocol, so re-add it if necessary
if (srcString.startsWith("consumer:")) {
......
......@@ -267,7 +267,7 @@ void SmallJobLabel::slotSetJobCount(int jobCount)
setText(i18np("%1 job", "%1 jobs", jobCount));
setToolTip(i18np("%1 pending job", "%1 pending jobs", jobCount));
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
setFixedWidth(sizeHint().width());
m_action->setVisible(true);
return;
......@@ -288,7 +288,7 @@ void SmallJobLabel::slotSetJobCount(int jobCount)
m_timeLine->start();
}
} else {
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
setFixedWidth(0);
m_action->setVisible(false);
return;
......@@ -566,11 +566,11 @@ void Bin::abortOperations()
}
}
delete m_rootFolder;
m_rootFolder = NULL;
m_rootFolder = nullptr;
delete m_itemView;
m_itemView = NULL;
m_itemView = nullptr;
delete m_jobManager;
m_jobManager = NULL;
m_jobManager = nullptr;
blockSignals(false);
}
......@@ -1868,7 +1868,7 @@ void Bin::showClipProperties(ProjectClip *clip, bool forceRefresh)
}
m_propertiesPanel->setProperty("clipId", clip->clipId());
QVBoxLayout *lay = static_cast<QVBoxLayout *>(m_propertiesPanel->layout());
if (lay == 0) {
if (lay == nullptr) {
lay = new QVBoxLayout(m_propertiesPanel);
m_propertiesPanel->setLayout(lay);
}
......@@ -2341,7 +2341,7 @@ bool Bin::hasPendingJob(const QString &id, AbstractClipJob::JOBTYPE type)
void Bin::slotCreateProjectClip()
{
QAction *act = qobject_cast<QAction *>(sender());
if (act == 0) {
if (act == nullptr) {
// Cannot access triggering action, something is wrong
qCDebug(KDENLIVE_LOG) << "// Error in clip creation action";
return;
......@@ -2842,7 +2842,7 @@ void Bin::slotStartClipJob(bool enable)
Q_UNUSED(enable)
QAction *act = qobject_cast<QAction *>(sender());
if (act == 0) {
if (act == nullptr) {
// Cannot access triggering action, something is wrong
qCDebug(KDENLIVE_LOG) << "// Error in clip job action";
return;
......@@ -3413,9 +3413,9 @@ void Bin::showTitleWidget(ProjectClip *clip)
if (dia_ui.duration() != clip->duration().frames(m_doc->fps())) {
// duration changed, we need to update duration
newprops.insert(QStringLiteral("out"), QString::number(dia_ui.duration() - 1));
int currentLength = clip->getProducerIntProperty(QStringLiteral("length"));
if (currentLength <= dia_ui.duration()) {
newprops.insert(QStringLiteral("length"), QString::number(dia_ui.duration()));
int currentLength = clip->getProducerIntProperty(QStringLiteral("kdenlive:duration"));
if (currentLength != dia_ui.duration()) {
newprops.insert(QStringLiteral("kdenlive:duration"), QString::number(dia_ui.duration()));
}
}
// trigger producer reload
......@@ -3555,7 +3555,7 @@ void Bin::showSlideshowWidget(ProjectClip *clip)
// edit clip properties
QMap<QString, QString> properties;
properties.insert(QStringLiteral("out"), QString::number(m_doc->getFramePos(dia->clipDuration()) * dia->imageCount() - 1));
properties.insert(QStringLiteral("length"), QString::number(m_doc->getFramePos(dia->clipDuration()) * dia->imageCount()));
properties.insert(QStringLiteral("kdenlive:duration"), QString::number(m_doc->getFramePos(dia->clipDuration()) * dia->imageCount()));
properties.insert(QStringLiteral("kdenlive:clipname"), dia->clipName());
properties.insert(QStringLiteral("ttl"), QString::number(m_doc->getFramePos(dia->clipDuration())));
properties.insert(QStringLiteral("loop"), QString::number(dia->loop()));
......@@ -3568,7 +3568,7 @@ void Bin::showSlideshowWidget(ProjectClip *clip)
QMap<QString, QString> oldProperties;
oldProperties.insert(QStringLiteral("out"), clip->getProducerProperty(QStringLiteral("out")));
oldProperties.insert(QStringLiteral("length"), clip->getProducerProperty(QStringLiteral("length")));
oldProperties.insert(QStringLiteral("kdenlive:duration"), clip->getProducerProperty(QStringLiteral("kdenlive:duration")));
oldProperties.insert(QStringLiteral("kdenlive:clipname"), clip->name());
oldProperties.insert(QStringLiteral("ttl"), clip->getProducerProperty(QStringLiteral("ttl")));
oldProperties.insert(QStringLiteral("loop"), clip->getProducerProperty(QStringLiteral("loop")));
......
......@@ -376,7 +376,7 @@ bool ProjectClip::setProducer(ClipController *controller, bool replaceProducer)
}
bin()->emitItemUpdated(this);
// Make sure we have a hash for this clip
hash();
getFileHash();
createAudioThumbs();
return isNewProducer;
}
......
......@@ -46,7 +46,7 @@ Core::~Core()
delete m_projectManager;
delete m_binController;
delete m_monitorManager;
m_self = 0;
m_self = nullptr;
}
void Core::build(MainWindow *mainWindow)
......
......@@ -647,13 +647,13 @@ void ProfilesDialog::saveProfile(MltVideoProfile &profile, QString profilePath)
}
QFile file(profilePath);
if (!file.open(QIODevice::WriteOnly)) {
KMessageBox::sorry(0, i18n("Cannot open file %1", profilePath));
KMessageBox::sorry(nullptr, i18n("Cannot open file %1", profilePath));
return;
}
QTextStream out(&file);
out << "description=" << profile.description << '\n' << "frame_rate_num=" << profile.frame_rate_num << '\n' << "frame_rate_den=" << profile.frame_rate_den << '\n' << "width=" << profile.width << '\n' << "height=" << profile.height << '\n' << "progressive=" << profile.progressive << '\n' << "sample_aspect_num=" << profile.sample_aspect_num << '\n' << "sample_aspect_den=" << profile.sample_aspect_den << '\n' << "display_aspect_num=" << profile.display_aspect_num << '\n' << "display_aspect_den=" << profile.display_aspect_den << '\n' << "colorspace=" << profile.colorspace << '\n';
if (file.error() != QFile::NoError) {
KMessageBox::error(0, i18n("Cannot write to file %1", profilePath));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", profilePath));
}
file.close();
profile.path = profilePath;
......
......@@ -587,7 +587,7 @@ bool RenderWidget::saveProfile(QDomElement newprofile)
profiles.setAttribute(QStringLiteral("version"), 1);
doc.appendChild(profiles);
}
int version = profiles.attribute(QStringLiteral("version"), 0).toInt();
int version = profiles.attribute(QStringLiteral("version"), nullptr).toInt();
if (version < 1) {
doc.clear();
profiles = doc.createElement(QStringLiteral("profiles"));
......@@ -770,7 +770,7 @@ void RenderWidget::slotEditProfile()
doc.appendChild(profiles);
}
int version = profiles.attribute(QStringLiteral("version"), 0).toInt();
int version = profiles.attribute(QStringLiteral("version"), nullptr).toInt();
if (version < 1) {
doc.clear();
profiles = doc.createElement(QStringLiteral("profiles"));
......@@ -936,7 +936,7 @@ void RenderWidget::updateButtons()
void RenderWidget::focusFirstVisibleItem(const QString &profile)
{
QTreeWidgetItem *item = 0;
QTreeWidgetItem *item = nullptr;
if (!profile.isEmpty()) {
QList<QTreeWidgetItem *> items = m_view.formats->findItems(profile, Qt::MatchExactly | Qt::MatchRecursive);
if (!items.isEmpty()) {
......@@ -1902,7 +1902,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
if (editable || groups.isEmpty()) {
QDomElement profiles = doc.documentElement();
if (editable && profiles.attribute(QStringLiteral("version"), 0).toInt() < 1) {
if (editable && profiles.attribute(QStringLiteral("version"), nullptr).toInt() < 1) {
// this is an old profile version, update it
QDomDocument newdoc;
QDomElement newprofiles = newdoc.createElement(QStringLiteral("profiles"));
......@@ -1983,7 +1983,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
// Check if item with same name already exists and replace it,
// allowing to override default profiles
QTreeWidgetItem *item = 0;
QTreeWidgetItem *item = nullptr;
for (int j = 0; j < groupItem->childCount(); ++j) {
if (groupItem->child(j)->text(0) == profileName) {
item = groupItem->child(j);
......@@ -2478,7 +2478,7 @@ bool RenderWidget::startWaitingRenderJobs()
QFile file(autoscriptFile);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qCWarning(KDENLIVE_LOG) << "////// ERROR writing to file: " << autoscriptFile;
KMessageBox::error(0, i18n("Cannot write to file %1", autoscriptFile));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", autoscriptFile));
return false;
}
......@@ -2501,7 +2501,7 @@ bool RenderWidget::startWaitingRenderJobs()
// erase itself when rendering is finished
outStream << "rm " << autoscriptFile << '\n' << '\n';
if (file.error() != QFile::NoError) {
KMessageBox::error(0, i18n("Cannot write to file %1", autoscriptFile));
KMessageBox::error(nullptr, i18n("Cannot write to file %1", autoscriptFile));
file.close();
m_blockProcessing = false;
return false;
......
......@@ -193,6 +193,11 @@ bool DocumentChecker::hasErrorInClips()
if (QFileInfo(original).isRelative()) {
original.prepend(root);
}
// Check for slideshows
bool slideshow = original.contains(QStringLiteral("/.all.")) || original.contains(QStringLiteral("?")) || original.contains(QStringLiteral("%"));
if (slideshow && !EffectsList::property(e, QStringLiteral("ttl")).isEmpty()) {
original = QFileInfo(original).absolutePath();
}
if (!QFile::exists(original)) {
// clip has proxy but original clip is missing
missingSources.append(e);
......@@ -205,7 +210,6 @@ bool DocumentChecker::hasErrorInClips()
if ((service == QLatin1String("qimage") || service == QLatin1String("pixbuf")) && slideshow) {
resource = QFileInfo(resource).absolutePath();
}
qDebug()<<" * * *Checking resource: "<<resource;
if (!QFile::exists(resource)) {
// Missing clip found
m_missingClips.append(e);
......@@ -317,7 +321,7 @@ bool DocumentChecker::hasErrorInClips()
clipType = i18n("Image clip");
type = Image;
}
} else if (service == QLatin1String("mlt")) {
} else if (service == QLatin1String("mlt") || service == QLatin1String("xml")) {
clipType = i18n("Playlist clip");
type = Playlist;
} else if (e.tagName() == QLatin1String("missingtitle")) {
......
......@@ -447,7 +447,7 @@ void DvdWizardMenu::checkBackgroundType(int ix)
m_view.background_color->setVisible(true);
m_view.background_image->setVisible(false);
m_view.loop_movie->setVisible(false);
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
} else {
......@@ -456,12 +456,12 @@ void DvdWizardMenu::checkBackgroundType(int ix)
if (ix == 1) {
m_view.background_image->clear();
m_view.background_image->setFilter(QStringLiteral("*"));
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
m_view.loop_movie->setVisible(false);
} else {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
m_view.background_image->clear();
......@@ -491,7 +491,7 @@ void DvdWizardMenu::buildImage()
{
emit completeChanged();
if (m_view.background_image->url().isEmpty()) {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
return;
......@@ -501,7 +501,7 @@ void DvdWizardMenu::buildImage()
if (m_view.background_list->currentIndex() == 1) {
// image background
if (!pix.load(m_view.background_image->url().toLocalFile())) {
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
return;
......@@ -636,13 +636,13 @@ void DvdWizardMenu::createButtonImages(const QString &selected_image, const QStr
int letterboxHeight = m_height / factor;
target = QRectF(0, (m_finalSize.height() - letterboxHeight) / 2, m_finalSize.width(), letterboxHeight);
}
if (m_safeRect->scene() != 0) {
if (m_safeRect->scene() != nullptr) {
m_scene->removeItem(m_safeRect);
}
if (m_color->scene() != 0) {
if (m_color->scene() != nullptr) {
m_scene->removeItem(m_color);
}
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
prepareUnderLines();
......@@ -684,7 +684,7 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
Q_UNUSED(letterbox)
m_scene->clearSelection();
if (m_safeRect->scene() != 0) {
if (m_safeRect->scene() != nullptr) {
m_scene->removeItem(m_safeRect);
}
bool showBg = false;
......@@ -704,10 +704,10 @@ void DvdWizardMenu::createBackgroundImage(const QString &img1, bool letterbox)
if (menuMovie()) {
showBg = true;
if (m_background->scene() != 0) {
if (m_background->scene() != nullptr) {
m_scene->removeItem(m_background);
}
if (m_color->scene() != 0) {
if (m_color->scene() != nullptr) {
m_scene->removeItem(m_color);
}
img.fill(Qt::transparent);
......
......@@ -106,7 +106,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
if (item) {
item->setData(0, IdRole, groups.at(i).toElement().attribute(QStringLiteral("list")));
} else {
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList(folderNames.at(i)));
item = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(folderNames.at(i)));
item->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
item->setData(0, IdRole, groups.at(i).toElement().attribute(QStringLiteral("list")));
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
......@@ -118,7 +118,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
misc = findFolder(i18n("Misc"));
if (misc == nullptr) {
misc = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18n("Misc")));
misc = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18n("Misc")));
misc->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
misc->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, misc);
......@@ -126,7 +126,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
audio = findFolder(i18n("Audio"));
if (audio == nullptr) {
audio = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18n("Audio")));
audio = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18n("Audio")));
audio->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
audio->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, audio);
......@@ -134,7 +134,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
custom = findFolder(i18nc("Folder Name", "Custom"));
if (custom == nullptr) {
custom = new QTreeWidgetItem((QTreeWidget *)0, QStringList(i18nc("Folder Name", "Custom")));
custom = new QTreeWidgetItem((QTreeWidget *)nullptr, QStringList(i18nc("Folder Name", "Custom")));
custom->setData(0, TypeRole, QString::number((int) EffectsList::EFFECT_FOLDER));
custom->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, custom);
......@@ -147,7 +147,7 @@ void EffectsListWidget::initList(QMenu *effectsMenu, KActionCategory *effectActi
} else {
loadEffects(&MainWindow::videoEffects, misc, &folders, EffectsList::EFFECT_VIDEO, current, &found);
loadEffects(&MainWindow::audioEffects, audio, &folders, EffectsList::EFFECT_AUDIO, current, &found);
loadEffects(&MainWindow::customEffects, custom, static_cast<QList<QTreeWidgetItem *> *>(0), EffectsList::EFFECT_CUSTOM, current, &found);
loadEffects(&MainWindow::customEffects, custom, static_cast<QList<QTreeWidgetItem *> *>(nullptr), EffectsList::EFFECT_CUSTOM, current, &found);
if (!found && !currentFolder.isEmpty()) {
// previously selected effect was removed, focus on its parent folder
for (int i = 0; i < topLevelItemCount(); ++i) {
......
......@@ -675,7 +675,7 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository *repository,
}
}
delete metadata;
metadata = 0;
metadata = nullptr;
/*QString outstr;
QTextStream str(&outstr);
ret.save(str, 2);
......
......@@ -97,7 +97,7 @@ KeyframeEdit::~KeyframeEdit()
keyframe_list->blockSignals(true);
keyframe_list->clear();
QLayoutItem *child;
while ((child = m_slidersLayout->takeAt(0)) != 0) {
while ((child = m_slidersLayout->takeAt(0)) != nullptr) {
QWidget *wid = child->widget();
delete child;
delete wid;
......
......@@ -45,7 +45,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
if (show) {
if (dock->isFloating()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -55,7 +55,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
QList<QDockWidget *> docked = pCore->window()->tabifiedDockWidgets(dock);
if (docked.isEmpty()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -70,7 +70,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
}
if (!hasVisibleDockSibling) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......
......@@ -3900,7 +3900,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
QWidget *bar = dock->titleBarWidget();
if (dock->isFloating()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -3908,7 +3908,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
QList<QDockWidget *> docked = pCore->window()->tabifiedDockWidgets(dock);
if (docked.isEmpty()) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......@@ -3923,7 +3923,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
}
if (!hasVisibleDockSibling) {
if (bar) {
dock->setTitleBarWidget(0);
dock->setTitleBarWidget(nullptr);
delete bar;
}
continue;
......
......@@ -214,13 +214,13 @@ void ProducerQueue::processFileProperties()
}
if (type == Color) {
path.prepend("color:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == Text || type == TextTemplate) {
path.prepend("kdenlivetitle:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == QText) {
path.prepend("qtext:");
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == Playlist && !proxyProducer) {
//TODO: "xml" seems to corrupt project fps if different, and "consumer" crashed on audio transition
Mlt::Profile *xmlProfile = new Mlt::Profile();
......@@ -250,9 +250,9 @@ void ProducerQueue::processFileProperties()
continue;
}
m_binController->profile()->set_explicit(true);
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (type == SlideShow) {
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
} else if (!url.isValid()) {
//WARNING: when is this case used? Not sure it is working.. JBM/
QDomDocument doc;
......@@ -270,7 +270,7 @@ void ProducerQueue::processFileProperties()
mlt.appendChild(tractor);
producer = new Mlt::Producer(*m_binController->profile(), "xml-string", doc.toString().toUtf8().constData());
} else {
producer = new Mlt::Producer(*m_binController->profile(), 0, path.toUtf8().constData());
producer = new Mlt::Producer(*m_binController->profile(), nullptr, path.toUtf8().constData());
if (producer->is_valid() && info.xml.hasAttribute(QStringLiteral("checkProfile")) && producer->get_int("video_index") > -1) {
// Check if clip profile matches
QString service = producer->get("mlt_service");
......@@ -577,7 +577,7 @@ void ProducerQueue::processFileProperties()
path = "xml:" + path.section(QLatin1Char(':'), 1);
}
Mlt::Profile original_profile;
Mlt::Producer *tmpProd = new Mlt::Producer(original_profile, 0, path.toUtf8().constData());
Mlt::Producer *tmpProd = new Mlt::Producer(original_profile, nullptr, path.toUtf8().constData());
original_profile.set_explicit(true);
filePropertyMap[QStringLiteral("progressive")] = QString::number(original_profile.progressive());
filePropertyMap[QStringLiteral("colorspace")] = QString::number(original_profile.colorspace());
......@@ -588,7 +588,7 @@ void ProducerQueue::processFileProperties()
// Warning, MLT detects an incorrect length in producer consumer when producer's fps != project's fps
//TODO: report bug to MLT
delete tmpProd;
tmpProd = new Mlt::Producer(original_profile, 0, path.toUtf8().constData());
tmpProd = new Mlt::Producer(original_profile, nullptr, path.toUtf8().constData());
int originalLength = tmpProd->get_length();
int fixedLength = (int)(originalLength * m_binController->profile()->fps() / originalFps);
producer->set("length", fixedLength);
......
......@@ -52,7 +52,7 @@
#ifndef Q_OS_WIN
typedef GLenum(*ClientWaitSync_fp)(GLsync sync, GLbitfield flags, GLuint64 timeout);
static ClientWaitSync_fp ClientWaitSync = 0;
static ClientWaitSync_fp ClientWaitSync = nullptr;
#endif
using namespace Mlt;
......@@ -61,19 +61,19 @@ GLWidget::GLWidget(int id, QObject *parent)
: QQuickView((QWindow *) parent)
, sendFrameForAnalysis(false)
, m_id(id)
, m_shader(0)
, m_glslManager(0)
, m_consumer(0)
, m_producer(0)
, m_shader(nullptr)
, m_glslManager(nullptr)
, m_consumer(nullptr)
, m_producer(nullptr)
, m_initSem(0)
, m_analyseSem(1)
, m_isInitialized(false)
, m_threadStartEvent(0)
, m_threadStopEvent(0)
, m_threadCreateEvent(0)
, m_threadJoinEvent(0)
, m_displayEvent(0)
, m_frameRenderer(0)
, m_threadStartEvent(nullptr)
, m_threadStopEvent(nullptr)
, m_threadCreateEvent(nullptr)
, m_threadJoinEvent(nullptr)
, m_displayEvent(nullptr)
, m_frameRenderer(nullptr)
, m_projectionLocation(0)
, m_modelViewLocation(0)
, m_vertexLocation(0)
......@@ -82,7 +82,7 @@ GLWidget::GLWidget(int id, QObject *parent)
, m_zoom(1.0f)
, m_openGLSync(false)
, m_offset(QPoint(0, 0))
, m_shareContext(0)
, m_shareContext(nullptr)
, m_audioWaveDisplayed(false)
, m_fbo(nullptr)
{
......@@ -103,7 +103,7 @@ GLWidget::GLWidget(int id, QObject *parent)
}
if ((m_glslManager && !m_glslManager->is_valid())) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
KdenliveSettings::setGpu_accel(false);
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
......@@ -166,7 +166,7 @@ void GLWidget::initializeGL()
if (m_glslManager && openglContext()->isOpenGLES()) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
KdenliveSettings::setGpu_accel(false);
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
......@@ -186,7 +186,7 @@ void GLWidget::initializeGL()
qCDebug(KDENLIVE_LOG) << " / / // NO GL SYNC, ERROR";
emit gpuNotSupported();
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
}
}
}
......@@ -677,7 +677,7 @@ void GLWidget::startGlsl()
m_glslManager->fire_event("init glsl");
if (!m_glslManager->get_int("glsl_supported")) {
delete m_glslManager;
m_glslManager = 0;
m_glslManager = nullptr;
// Need to destroy MLT global reference to prevent filters from trying to use GPU.
mlt_properties_set_data(mlt_global_properties(), "glslManager", nullptr, 0, nullptr, nullptr);
emit gpuNotSupported();
......@@ -880,9 +880,9 @@ int GLWidget::reconfigureMulti(const QString &params, const QString &path, Mlt::
}
m_consumer = new Mlt::FilteredConsumer(*profile, "multi");
delete m_threadStartEvent;
m_threadStartEvent = 0;
m_threadStartEvent = nullptr;
delete m_threadStopEvent;
m_threadStopEvent = 0;
m_threadStopEvent = nullptr;
delete m_threadCreateEvent;
delete m_threadJoinEvent;
......@@ -986,9 +986,9 @@ int GLWidget::reconfigure(Mlt::Profile *profile)
}
m_consumer = new Mlt::FilteredConsumer(*m_monitorProfile, serviceName.toLatin1().constData());
delete m_threadStartEvent;
m_threadStartEvent = 0;
m_threadStartEvent = nullptr;
delete m_threadStopEvent;
m_threadStopEvent = 0;
m_threadStopEvent = nullptr;
delete m_threadCreateEvent;
delete m_threadJoinEvent;
......@@ -1267,10 +1267,10 @@ void GLWidget::on_gl_frame_show(mlt_consumer, void *self, mlt_frame frame_ptr)
}
RenderThread::RenderThread(thread_function_t function, void *data, QOpenGLContext *context, QSurface *surface)
: QThread(0)
: QThread(nullptr)
, m_function(function)
, m_data(data)
, m_context(0)
, m_context(nullptr)
, m_surface(surface)
{
if (context) {
......@@ -1300,11 +1300,11 @@ void RenderThread::run()
}
FrameRenderer::FrameRenderer(QOpenGLContext *shareContext, QSurface *surface)
: QThread(0)
: QThread(nullptr)
, m_semaphore(3)
, m_context(0)
, m_context(nullptr)
, m_surface(surface)
, m_gl32(0)
, m_gl32(nullptr)
, sendAudioForAnalysis(false)
{
Q_ASSERT(shareContext);
......
......@@ -334,7 +334,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
m_toolbar->addSeparator();
int tm = 0;
int bm = 0;
m_toolbar->getContentsMargins(0, &tm, 0, &bm);
m_toolbar->getContentsMargins(nullptr, &tm, nullptr, &bm);
m_audioMeterWidget = new MonitorAudioLevel(m_glMonitor->profile(), m_toolbar->height() - tm - bm, this);
m_toolbar->addWidget(m_audioMeterWidget);
if (!m_audioMeterWidget->isValid) {
......
......@@ -20,7 +20,7 @@
class FrameData : public QSharedData
{
public:
FrameData() : f((mlt_frame)0) {};
FrameData() : f((mlt_frame)nullptr) {};
explicit FrameData(Mlt::Frame &frame) : f(frame) {};
~FrameData() {};
......@@ -30,7 +30,7 @@ private:
};
SharedFrame::SharedFrame()
: d(0)
: d(nullptr)
{
}
......@@ -65,8 +65,8 @@ Mlt::Frame SharedFrame::clone(bool audio, bool image, bool alpha) const
// It could be added to mlt_frame as an alternative to:
// mlt_frame mlt_frame_clone( mlt_frame self, int is_deep );
// It could also be added to Mlt::Frame as a const function.
void *data = 0;
void *copy = 0;
void *data = nullptr;
void *copy = nullptr;
int size = 0;
Mlt::Frame cloneFrame(mlt_frame_init(nullptr));
cloneFrame.inherit(d->f);
......@@ -99,7 +99,7 @@ Mlt::Frame SharedFrame::clone(bool audio, bool image, bool alpha) const
size = mlt_image_format_size(get_image_format(),
get_image_width(),