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

Fix working on project with proxy only

parent eba9129f
Pipeline #23517 passed with stage
in 28 minutes and 54 seconds
...@@ -261,7 +261,7 @@ void AbstractProjectItem::setClipStatus(CLIPSTATUS status) ...@@ -261,7 +261,7 @@ void AbstractProjectItem::setClipStatus(CLIPSTATUS status)
bool AbstractProjectItem::statusReady() const bool AbstractProjectItem::statusReady() const
{ {
return m_clipStatus == StatusReady; return m_clipStatus == StatusReady || m_clipStatus == StatusProxyOnly;
} }
AbstractProjectItem::CLIPSTATUS AbstractProjectItem::clipStatus() const AbstractProjectItem::CLIPSTATUS AbstractProjectItem::clipStatus() const
......
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
ClipHasAudioAndVideo ClipHasAudioAndVideo
}; };
enum CLIPSTATUS { StatusReady = 0, StatusMissing, StatusWaiting, StatusDeleting }; enum CLIPSTATUS { StatusReady = 0, StatusMissing, StatusWaiting, StatusDeleting, StatusProxyOnly };
virtual void setClipStatus(AbstractProjectItem::CLIPSTATUS status); virtual void setClipStatus(AbstractProjectItem::CLIPSTATUS status);
AbstractProjectItem::CLIPSTATUS clipStatus() const; AbstractProjectItem::CLIPSTATUS clipStatus() const;
......
...@@ -228,9 +228,9 @@ public: ...@@ -228,9 +228,9 @@ public:
} }
// Add audio/video icons for selective drag // Add audio/video icons for selective drag
int cType = index.data(AbstractProjectItem::ClipType).toInt(); int cType = index.data(AbstractProjectItem::ClipType).toInt();
if (clipStatus == AbstractProjectItem::StatusMissing) { if (clipStatus == AbstractProjectItem::StatusMissing || clipStatus == AbstractProjectItem::StatusProxyOnly) {
painter->save(); painter->save();
painter->setPen(QPen(Qt::red, 3)); painter->setPen(QPen(clipStatus == AbstractProjectItem::StatusProxyOnly ? Qt::yellow : Qt::red, 3));
painter->drawRect(m_thumbRect); painter->drawRect(m_thumbRect);
painter->restore(); painter->restore();
} else if (cType == ClipType::Image || cType == ClipType::SlideShow) { } else if (cType == ClipType::Image || cType == ClipType::SlideShow) {
...@@ -1415,7 +1415,7 @@ void Bin::slotReloadClip() ...@@ -1415,7 +1415,7 @@ void Bin::slotReloadClip()
} }
if (currentItem) { if (currentItem) {
emit openClip(std::shared_ptr<ProjectClip>()); emit openClip(std::shared_ptr<ProjectClip>());
if (currentItem->clipStatus() == AbstractProjectItem::StatusMissing) { if (currentItem->clipStatus() == AbstractProjectItem::StatusMissing || currentItem->clipStatus() == AbstractProjectItem::StatusProxyOnly) {
// Don't attempt to reload missing clip // Don't attempt to reload missing clip
emit displayBinMessage(i18n("Missing source clip"), KMessageWidget::Warning); emit displayBinMessage(i18n("Missing source clip"), KMessageWidget::Warning);
return; return;
......
...@@ -83,8 +83,10 @@ ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, const std::share ...@@ -83,8 +83,10 @@ ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, const std::share
, ClipController(id, std::move(producer)) , ClipController(id, std::move(producer))
{ {
m_markerModel = std::make_shared<MarkerListModel>(id, pCore->projectManager()->undoStack()); m_markerModel = std::make_shared<MarkerListModel>(id, pCore->projectManager()->undoStack());
if (producer->get_int("_placeholder") == 1 || producer->get_int("_missingsource") == 1) { if (producer->get_int("_placeholder") == 1) {
m_clipStatus = StatusMissing; m_clipStatus = StatusMissing;
} else if (producer->get_int("_missingsource") == 1) {
m_clipStatus = StatusProxyOnly;
} else { } else {
m_clipStatus = StatusReady; m_clipStatus = StatusReady;
} }
...@@ -879,7 +881,7 @@ std::unique_ptr<Mlt::Producer> ProjectClip::getClone() ...@@ -879,7 +881,7 @@ std::unique_ptr<Mlt::Producer> ProjectClip::getClone()
bool ProjectClip::isReady() const bool ProjectClip::isReady() const
{ {
return m_clipStatus == StatusReady; return m_clipStatus == StatusReady || m_clipStatus == StatusProxyOnly;
} }
QPoint ProjectClip::zone() const QPoint ProjectClip::zone() const
......
...@@ -729,7 +729,7 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const std::shared_ptr<Mlt: ...@@ -729,7 +729,7 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const std::shared_ptr<Mlt:
bool res = addItem(new_clip, parentId, undo, redo); bool res = addItem(new_clip, parentId, undo, redo);
if (res) { if (res) {
new_clip->importEffects(producer); new_clip->importEffects(producer);
if (new_clip->sourceExists()) { if (new_clip->isReady() || new_clip->sourceExists()) {
int blocking = pCore->jobManager()->getBlockingJobId(id, AbstractClipJob::LOADJOB); int blocking = pCore->jobManager()->getBlockingJobId(id, AbstractClipJob::LOADJOB);
pCore->jobManager()->startJob<ThumbJob>({id}, blocking, QString(), -1, true); pCore->jobManager()->startJob<ThumbJob>({id}, blocking, QString(), -1, true);
pCore->jobManager()->startJob<AudioThumbJob>({id}, blocking, QString()); pCore->jobManager()->startJob<AudioThumbJob>({id}, blocking, QString());
......
...@@ -114,7 +114,7 @@ bool AudioThumbJob::computeWithMlt() ...@@ -114,7 +114,7 @@ bool AudioThumbJob::computeWithMlt()
bool AudioThumbJob::computeWithFFMPEG() bool AudioThumbJob::computeWithFFMPEG()
{ {
QString filePath = m_prod->get("kdenlive:originalurl"); QString filePath = m_prod->get("kdenlive:originalurl");
if (filePath.isEmpty()) { if (filePath.isEmpty() || !QFile::exists(filePath)) {
filePath = m_prod->get("resource"); filePath = m_prod->get("resource");
} }
m_ffmpegProcess.reset(new QProcess); m_ffmpegProcess.reset(new QProcess);
......
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