Commit 04527b70 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix warnings

parent b6326035
......@@ -616,8 +616,3 @@ void KeyframeEdit::slotRefresh()
// TODO
}
void KeyframeEdit::slotSetRange(QPair<int, int> range)
{
m_min = range.first;
m_max = range.second;
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "klocalizedstring.h"
#include "thumbjob.hpp"
#include <QScopedPointer>
ThumbJob::ThumbJob(const QString &binId)
: AbstractClipJob(THUMBJOB, binId)
{
}
const QString ThumbJob::getDescription() const
{
return i18n("Extracting thumb from clip %1", m_clipId);
}
bool ThumbJob::startJob()
{
// Special case, we just want the thumbnail for existing producer
std::shared_ptr<ProjectClip> binClip = pCore->projectItemModel()->getClipByBinID(info.clipId);
Mlt::Producer *prod = new Mlt::Producer(*binClip->originalProducer());
if ((prod == nullptr) || !prod->is_valid()) {
return false;
}
int frameNumber = ProjectClip::getXmlProperty(info.xml, QStringLiteral("kdenlive:thumbnailFrame"), QStringLiteral("-1")).toInt();
if (frameNumber > 0) {
prod->seek(frameNumber);
}
QScopedPointer<Mlt::Frame> frame = prod->get_frame();
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1);
if ((frame != nullptr) && frame->is_valid()) {
int fullWidth = info.imageHeight * pCore->getCurrentDar() + 0.5;
QImage img = KThumb::getFrame(frame, fullWidth, info.imageHeight, forceThumbScale);
emit replyGetImage(info.clipId, img);
}
delete frame;
delete prod;
if (info.xml.hasAttribute(QStringLiteral("refreshOnly"))) {
// inform timeline about change
emit refreshTimelineProducer(info.clipId);
}
return true;
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#pragma once
#include "abstractclipjob.h"
/** @brief This class represents the job that corresponds to loading a clip from disk
*/
class CreateClipJob : public AbstractClipJob
{
Q_OBJECT
public:
CreateClipJob(const QString &binId);
const QString getDescription() const override;
void startJob() override;
/** @brief This is to be called after the job finished.
By design, the job should store the result of the computation but not share it with the rest of the code. This happens when we call commitResult */
void commitResult(Fun &undo, Fun &redo) override;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment