]> git.sesse.net Git - kdenlive/commitdiff
Merge branch 'stabilize' of git.kde.org:kdenlive into stabilize
authorMarco Gittler <marco@gitma.de>
Tue, 22 Nov 2011 21:25:34 +0000 (22:25 +0100)
committerMarco Gittler <marco@gitma.de>
Tue, 22 Nov 2011 21:25:34 +0000 (22:25 +0100)
18 files changed:
src/clipitem.cpp
src/clipmanager.cpp
src/clipmanager.h
src/colorpickerwidget.cpp
src/customtrackview.cpp
src/customtrackview.h
src/definitions.h
src/documentvalidator.cpp
src/dvdwizard.cpp
src/dvdwizard.h
src/kdenlive.notifyrc
src/kdenlivedoc.cpp
src/kdenliveui.rc
src/mainwindow.cpp
src/projectlist.cpp
src/projectlist.h
src/renderwidget.cpp
src/renderwidget.h

index cac5eda2b4690f0c6f683d3588161c1a903ece7a..086aa7c6108a32d9a310d974bd30ea54808ce195 100644 (file)
@@ -573,7 +573,7 @@ void ClipItem::slotFetchThumbs()
         frames.append((int)(m_speedIndependantInfo.cropStart + m_speedIndependantInfo.cropDuration).frames(m_fps) - 1);
     }
 
-    m_clip->slotExtractImage(frames);
+    if (!frames.isEmpty()) m_clip->slotExtractImage(frames);
 }
 
 void ClipItem::slotGetStartThumb()
index a06874543bb3d5dbded0a5ea7c970fd28497b7b6..2f223465292d9271d860cea852222987b786adff 100644 (file)
@@ -140,19 +140,26 @@ void ClipManager::stopThumbs(const QString &id)
 void ClipManager::slotGetThumbs()
 {
     QMap<QString, int>::iterator i = m_requestedThumbs.begin();
+    int max;
+    int done = 0;
     while (i != m_requestedThumbs.end() && !m_abortThumb) {
         QString producerId = i.key();
         m_thumbsMutex.lock();
         QList<int> values = m_requestedThumbs.values(producerId);
-        i = m_requestedThumbs.erase(i);
+        m_requestedThumbs.remove(producerId);
+        i = m_requestedThumbs.begin();
         m_thumbsMutex.unlock();
         qSort(values);
         DocClipBase *clip = getClipById(producerId);
         if (!clip) continue;
+        max = m_requestedThumbs.size() + values.count();
         while (!values.isEmpty() && clip->thumbProducer() && !m_abortThumb) {
             clip->thumbProducer()->getThumb(values.takeFirst());
+            done++;
+            if (max > 3) emit displayMessage(i18n("Loading thumbnails"), 100 * done / max);
         }
     }
+    emit displayMessage(QString(), -1);
 }
 
 void ClipManager::checkAudioThumbs()
index 9ac2cfd2dbcc1bf9e25d8bea670b5df2b7f48a83..7f1622e33c48f3fba9e3aa948a285a3130fce51a 100644 (file)
@@ -162,6 +162,7 @@ signals:
     void missingClip(const QString &);
     void availableClip(const QString &);
     void checkAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips);
+    void displayMessage(const QString &, int);
 };
 
 #endif
index 2a2d8468b86cb5d072207cda11c0bf481c4896db..3c91f0fd5e8e68198dafe2403167c7558c6ae9b4 100644 (file)
@@ -52,8 +52,7 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) :
 
     QToolButton *button = new QToolButton(this);
     button->setIcon(KIcon("color-picker"));
-    // TODO: make translatable after 0.8.2 release
-    button->setToolTip(i18n("Pick a color on the screen") + QString("\nBy pressing the mouse button and then moving your mouse you can select a section of the screen from which to get an average color."));
+    button->setToolTip("<p>" + i18n("Pick a color on the screen. By pressing the mouse button and then moving your mouse you can select a section of the screen from which to get an average color.") + "</p>");
     button->setAutoRaise(true);
     connect(button, SIGNAL(clicked()), this, SLOT(slotSetupEventFilter()));
 
index f5e7d91acae8ea22e4b6f0a266b5950375a58ba6..32e787908c36aa1fac9dce78094bba1e0addab94 100644 (file)
@@ -1641,8 +1641,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect)
     if (pos < GenTime()) {
         // Add track effect
         if (effect.attribute("id") == "speed") {
-            // TODO: uncomment after 0.8.2 release
-            // emit displayMessage(i18n("Cannot add speed effect to track"));
+            emit displayMessage(i18n("Cannot add speed effect to track"), ErrorMessage);
             return;
         }
         clearSelection();
@@ -3884,34 +3883,6 @@ void CustomTrackView::deleteSelectedClips()
     m_commandStack->push(deleteSelected);
 }
 
-void CustomTrackView::changeClipSpeed()
-{
-  // TODO: remove after string freeze
-    QList<QGraphicsItem *> itemList = scene()->selectedItems();
-    if (itemList.count() == 0) {
-        emit displayMessage(i18n("Select clip to change speed"), ErrorMessage);
-        return;
-    }
-    QUndoCommand *changeSelected = new QUndoCommand();
-    changeSelected->setText("Edit clip speed");
-    int count = 0;
-    int percent = -1;
-    bool ok;
-    for (int i = 0; i < itemList.count(); i++) {
-        if (itemList.at(i)->type() == AVWIDGET) {
-            ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
-            if (percent == -1) percent = QInputDialog::getInteger(this, i18n("Edit Clip Speed"), i18n("New speed (percents)"), item->speed() * 100, 1, 10000, 1, &ok);
-            if (!ok) break;
-            double speed = (double) percent / 100.0;
-            if (item->speed() != speed && (item->clipType() == VIDEO || item->clipType() == AV)) {
-                count++;
-                //new ChangeSpeedCommand(this, info, item->speed(), speed, item->clipProducer(), changeSelected);
-            }
-        }
-    }
-    if (count > 0) m_commandStack->push(changeSelected);
-    else delete changeSelected;
-}
 
 void CustomTrackView::doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id)
 {
index 2bfad8fe68b9602bd29254bdc02bc3ac7b08a541..64c0ddbb8968a33ee0dbfdfd71497600787aed67 100644 (file)
@@ -105,7 +105,6 @@ public:
     QList<ItemInfo> findId(const QString &clipId);
     void clipStart();
     void clipEnd();
-    void changeClipSpeed();
     void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id);
     /** @brief Sets the document as modified. */
     void setDocumentModified();
index 1a3a255769ca9f47a027050d24c3c213173eb6f7..f37a36335e2de6e6f35c919ed3ac65ee24c64589 100644 (file)
@@ -97,6 +97,22 @@ struct MltVideoProfile {
     int display_aspect_num;
     int display_aspect_den;
     int colorspace;
+    bool operator==(const MltVideoProfile& point) const
+    {
+        if (!description.isEmpty() && point.description  == description) return true;
+        return      point.frame_rate_num == frame_rate_num &&
+                    point.frame_rate_den  == frame_rate_den  &&
+                    point.width == width &&
+                    point.height == height &&
+                    point.progressive == progressive &&
+                    point.sample_aspect_num == sample_aspect_num &&
+                    point.sample_aspect_den == sample_aspect_den &&
+                    point.display_aspect_den == display_aspect_den &&
+                    point.colorspace == colorspace;
+    }
+    bool operator!=(const MltVideoProfile &other) const {
+        return !(*this == other);
+    }
 };
 
 
index 1226a85c96b6adc13f97aa964e2fde1575891789..a31c18a841cf29688b6d1b06a38267fdf5c709fb 100644 (file)
@@ -78,10 +78,6 @@ bool DocumentValidator::validate(const double currentVersion)
         initEffects::parseEffectFiles();
     }
 
-    // TODO: remove after string freeze
-    if (0)
-        KMessageBox::sorry(kapp->activeWindow(), i18n("The document you are opening uses a different locale (%1) than your system. You can only open and render it, no editing is supported unless you change your system's locale.", mlt.attribute("LC_NUMERIC")), i18n("Read only project"));
-
     // Upgrade the document to the latest version
     if (!upgrade(documentLocale.toDouble(kdenliveDoc.attribute("version")), currentVersion))
         return false;
index 99b295d54f7a93625bd9acdfb58eb61d9f7daa74..68a3580a5b19ce33084a7201aa463a72cc3801c2 100644 (file)
@@ -254,8 +254,8 @@ void DvdWizard::generateDvd()
             renderbg.start(KdenliveSettings::rendererpath(), args);
             if (renderbg.waitForFinished()) {
                 if (renderbg.exitStatus() == QProcess::CrashExit) {
-                    //TODO: inform user via the m_isoMessage widget after string freeze
                     kDebug() << "/// RENDERING MENU vob crashed";
+                    errorMessage(i18n("Rendering menu crashed"));
                     QByteArray result = renderbg.readAllStandardError();
                     vobitem->setIcon(KIcon("dialog-close"));
                     m_status.error_log->append(result);
@@ -266,11 +266,7 @@ void DvdWizard::generateDvd()
                 }
             } else {
                 kDebug() << "/// RENDERING MENU vob timed out";
-#if KDE_IS_VERSION(4,7,0)
-                m_isoMessage->setText(i18n("Rendering job timed out"));
-                m_isoMessage->setMessageType(KMessageWidget::Error);
-                m_isoMessage->animatedShow();
-#endif
+                errorMessage(i18n("Rendering job timed out"));
                 vobitem->setIcon(KIcon("dialog-close"));
                 m_status.error_log->append("<a name=\"result\" /><br /><strong>" + i18n("Rendering job timed out"));
                 m_status.error_log->scrollToAnchor("result");
@@ -375,11 +371,7 @@ void DvdWizard::generateDvd()
             }
         } else {
             kDebug() << "/// RENDERING SPUMUX MENU timed out";
-#if KDE_IS_VERSION(4,7,0)
-            m_isoMessage->setText(i18n("Rendering job timed out"));
-            m_isoMessage->setMessageType(KMessageWidget::Error);
-            m_isoMessage->animatedShow();
-#endif
+            errorMessage(i18n("Rendering job timed out"));
             spuitem->setIcon(KIcon("dialog-close"));
             m_status.error_log->append("<a name=\"result\" /><br /><strong>" + i18n("Menu job timed out"));
             m_status.error_log->scrollToAnchor("result");
@@ -546,18 +538,27 @@ void DvdWizard::slotShowRenderInfo()
     m_status.error_box->setHidden(false);
 }
 
+void DvdWizard::errorMessage(const QString &text) {
+#if KDE_IS_VERSION(4,7,0)
+    m_isoMessage->setText(text);
+    m_isoMessage->setMessageType(KMessageWidget::Error);
+    m_isoMessage->animatedShow();
+#endif
+}
+
+void DvdWizard::infoMessage(const QString &text) {
+#if KDE_IS_VERSION(4,7,0)
+    m_isoMessage->setText(text);
+    m_isoMessage->setMessageType(KMessageWidget::Positive);
+    m_isoMessage->animatedShow();
+#endif
+}
+
 void DvdWizard::slotRenderFinished(int exitCode, QProcess::ExitStatus status)
 {
     QListWidgetItem *authitem =  m_status.job_progress->item(3);
     if (status == QProcess::CrashExit || exitCode != 0) {
-#if KDE_IS_VERSION(4,7,0)
-        //TODO: Clean up message string after string freeze
-        QString message = i18n("DVDAuthor process crashed.</strong><br />");
-        message.remove(QRegExp("<[^>]*>"));
-        m_isoMessage->setText(message);
-        m_isoMessage->setMessageType(KMessageWidget::Error);
-        m_isoMessage->animatedShow();
-#endif
+        errorMessage(i18n("DVDAuthor process crashed"));
         QString result(m_dvdauthor->readAllStandardError());
         result.append("<a name=\"result\" /><br /><strong>");
         result.append(i18n("DVDAuthor process crashed.</strong><br />"));
@@ -585,11 +586,7 @@ void DvdWizard::slotRenderFinished(int exitCode, QProcess::ExitStatus status)
 
     // Check if DVD structure has the necessary infos
     if (!QFile::exists(m_status.tmp_folder->url().path() + "/DVD/VIDEO_TS/VIDEO_TS.IFO")) {
-#if KDE_IS_VERSION(4,7,0)
-        m_isoMessage->setText(i18n("DVD structure broken"));
-        m_isoMessage->setMessageType(KMessageWidget::Error);
-        m_isoMessage->animatedShow();
-#endif
+        errorMessage(i18n("DVD structure broken"));
         m_status.error_log->append(m_creationLog + "<a name=\"result\" /><br /><strong>" + i18n("DVD structure broken"));
         m_status.error_log->scrollToAnchor("result");
         m_status.error_box->setHidden(false);
@@ -639,11 +636,7 @@ void DvdWizard::slotIsoFinished(int exitCode, QProcess::ExitStatus status)
     button(QWizard::FinishButton)->setEnabled(true);
     QListWidgetItem *isoitem =  m_status.job_progress->item(4);
     if (status == QProcess::CrashExit || exitCode != 0) {
-#if KDE_IS_VERSION(4,7,0)
-        m_isoMessage->setText(i18n("ISO creation process crashed."));
-        m_isoMessage->setMessageType(KMessageWidget::Error);
-        m_isoMessage->animatedShow();
-#endif
+        errorMessage(i18n("ISO creation process crashed."));
         QString result(m_mkiso->readAllStandardError());
         result.append("<a name=\"result\" /><br /><strong>");
         result.append(i18n("ISO creation process crashed."));
@@ -676,11 +669,7 @@ void DvdWizard::slotIsoFinished(int exitCode, QProcess::ExitStatus status)
         if (iso.exists()) {
             KIO::NetAccess::del(m_status.iso_image->url(), this);
         }
-#if KDE_IS_VERSION(4,7,0)
-        m_isoMessage->setText(i18n("DVD ISO is broken"));
-        m_isoMessage->setMessageType(KMessageWidget::Error);
-        m_isoMessage->animatedShow();
-#endif
+        errorMessage(i18n("DVD ISO is broken"));
         m_status.error_log->append(m_creationLog + "<br /><a name=\"result\" /><strong>" + i18n("DVD ISO is broken") + "</strong>");
         m_status.error_log->scrollToAnchor("result");
         m_status.error_box->setHidden(false);
@@ -696,11 +685,7 @@ void DvdWizard::slotIsoFinished(int exitCode, QProcess::ExitStatus status)
     kDebug() << "ISO IMAGE " << m_status.iso_image->url().path() << " Successfully created";
     cleanup();
     kDebug() << m_creationLog;
-#if KDE_IS_VERSION(4,7,0)
-        m_isoMessage->setText(i18n("DVD ISO image %1 successfully created.", m_status.iso_image->url().path()));
-        m_isoMessage->setMessageType(KMessageWidget::Positive);
-        m_isoMessage->animatedShow();
-#endif    
+    infoMessage(i18n("DVD ISO image %1 successfully created.", m_status.iso_image->url().path()));
 
     m_status.error_log->append("<a name=\"result\" /><strong>" + i18n("DVD ISO image %1 successfully created.", m_status.iso_image->url().path()) + "</strong>");
     m_status.error_log->scrollToAnchor("result");
index b9578d9d213cf4ede96d4d9ccad275caa0bb39fc..a763940773232f3111b59d0699993def6910ab8f 100644 (file)
@@ -61,6 +61,8 @@ private:
     QString m_creationLog;
     void cleanup();
     QMenu *m_burnMenu;
+    void errorMessage(const QString &text);
+    void infoMessage(const QString &text);
 
 private slots:
     void slotPageChanged(int page);
index 188ddcd56cbdf0a54c3a95fd3981d0bf065e8f1c..cb9ce1fc7ceb6ebe0c0c8b75edff987a56c43204 100644 (file)
@@ -21,7 +21,7 @@ Name[da]=Rendering gennemført
 Name[nl]=Weergave uitwerken beëindigd
 Name[pt]=A geração terminou
 Name[pt_BR]=A renderização terminou
-Name[sv]=Framställning klar
+Name[sv]=Återgivning klar
 Name[uk]=Обробку завершено
 Name[x-test]=xxRendering finishedxx
 Name[zh_CN]=渲染结束
@@ -32,7 +32,7 @@ Comment[da]=Renderingen er slut
 Comment[nl]=Weergave uitwerken is gereed
 Comment[pt]=A geração terminou
 Comment[pt_BR]=A renderização foi terminada
-Comment[sv]=Framställning är gjord
+Comment[sv]=Återgivningen är gjord
 Comment[uk]=Виконання обробки завершено
 Comment[x-test]=xxRendering is overxx
 Comment[zh_CN]=渲染结束
@@ -46,7 +46,7 @@ Name[da]=Rendering påbegyndt
 Name[nl]=Weergave uitwerken begonnen
 Name[pt]=A geração foi iniciada
 Name[pt_BR]=A renderização iniciou
-Name[sv]=Framställning startad
+Name[sv]=Återgivning startad
 Name[uk]=Обробку розпочато
 Name[x-test]=xxRendering startedxx
 Name[zh_CN]=渲染开始
@@ -57,7 +57,7 @@ Comment[da]=Renderingen blev startet
 Comment[nl]=Weergave uitwerken is begonnen
 Comment[pt]=A geração foi iniciada
 Comment[pt_BR]=A renderização foi iniciada
-Comment[sv]=Framställning har startats
+Comment[sv]=Återgivningen har startats
 Comment[uk]=Було розпочато обробку
 Comment[x-test]=xxRendering was startedxx
 Comment[zh_CN]=渲染开始
index c3aefa9195142ecee9329d62527db447f3f3a9e8..8102ca681918534ca9bd7758d54239d9ad056af1 100644 (file)
@@ -83,6 +83,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
     m_clipManager = new ClipManager(this);
     m_autoSaveTimer = new QTimer(this);
     m_autoSaveTimer->setSingleShot(true);
+    connect(m_clipManager, SIGNAL(displayMessage(QString, int)), parent, SLOT(slotGotProgressInfo(QString,int)));
     bool success = false;
 
     // init default document properties
index ba3cede3d27a9134b3549407c8198ac0e77f5a40..0a350be99db311c9aaa1e5c16fa9f080d3efe7d4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="64">
+<gui name="kdenlive" version="65">
   <ToolBar name="extraToolBar" >
     <text>Extra Toolbar</text>
        <Action name="project_render" />
index b04037da56d9a53b216c7e1cdbb9dd3bc8c22479..db917bcf34f088f954663fa3dc3049cc0add00bd 100644 (file)
@@ -2356,7 +2356,9 @@ void MainWindow::slotRenderProject()
 {
     if (!m_renderWidget) {
         QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
-        m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), this);
+        MltVideoProfile profile;
+        if (m_activeDocument) profile = m_activeDocument->mltProfile();
+        m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), profile, this);
         connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
         connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap <QString, QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap <QString, QString>)));
         connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
index d28a11892ea6b104212ebf2176ea0589c3594131..04abe1c88bcefaa3a384ed85bd49860ee46bcb34 100644 (file)
@@ -1188,7 +1188,7 @@ void ProjectList::slotGotProxy(const QString &proxyPath)
 
 void ProjectList::slotGotProxy(ProjectItem *item)
 {
-    if (item == NULL || !m_refreshed) return;
+    if (item == NULL) return;
     DocClipBase *clip = item->referencedClip();
     if (!clip || !clip->isClean() || m_render->isProcessing(item->clipId())) {
         // Clip is being reprocessed, abort
@@ -2348,18 +2348,18 @@ void ProjectList::slotCreateProxy(const QString id)
     if (!item || item->isProxyRunning() || item->referencedClip()->isPlaceHolder()) return;
     QString path = item->referencedClip()->getProperty("proxy");
     if (path.isEmpty()) {
-        setProxyStatus(path, PROXYCRASHED);
+        setProxyStatus(item, PROXYCRASHED);
         return;
     }
-    setProxyStatus(path, PROXYWAITING);
+    setProxyStatus(item, PROXYWAITING);
     if (m_abortProxy.contains(path)) m_abortProxy.removeAll(path);
     if (m_processingProxy.contains(path)) {
         // Proxy is already being generated
         return;
     }
-    if (QFile::exists(path)) {
+    if (QFileInfo(path).size() > 0) {
         // Proxy already created
-        setProxyStatus(path, PROXYDONE);
+        setProxyStatus(item, PROXYDONE);
         slotGotProxy(path);
         return;
     }
@@ -2371,6 +2371,15 @@ void ProjectList::slotCreateProxy(const QString id)
     info.type = item->clipType();
     info.exif = QString(item->referencedClip()->producerProperty("_exif_orientation")).toInt();
     m_proxyList.append(info);
+    if (!m_proxyThreads.futures().isEmpty()) {
+        // Remove inactive threads
+        QList <QFuture<void> > futures = m_proxyThreads.futures();
+        m_proxyThreads.clearFutures();
+        for (int i = 0; i < futures.count(); i++)
+            if (!futures.at(i).isFinished()) {
+                m_proxyThreads.addFuture(futures.at(i));
+            }
+    }
     if (m_proxyThreads.futures().isEmpty() || m_proxyThreads.futures().count() < KdenliveSettings::proxythreads()) m_proxyThreads.addFuture(QtConcurrent::run(this, &ProjectList::slotGenerateProxy));
 }
 
@@ -2382,7 +2391,7 @@ void ProjectList::slotAbortProxy(const QString id, const QString path)
     slotGotProxy(item);
     if (!path.isEmpty() && m_processingProxy.contains(path)) {
         m_abortProxy << path;
-        setProxyStatus(path, NOPROXY);
+        setProxyStatus(item, NOPROXY);
     }
 }
 
@@ -2393,21 +2402,8 @@ void ProjectList::slotGenerateProxy()
         PROXYINFO info = m_proxyList.takeFirst();
         if (m_abortProxy.contains(info.dest)) {
             m_abortProxy.removeAll(info.dest);
-            return;
-        }
-
-        // Make sure proxy path is writable
-        QFile file(info.dest);
-        if (!file.open(QIODevice::WriteOnly)) {
-            setProxyStatus(info.dest, PROXYCRASHED);
-            m_processingProxy.removeAll(info.dest);
-            return;
-        }
-        file.close();
-        QFile::remove(info.dest);
-    
-        setProxyStatus(info.dest, CREATINGPROXY);
-    
+            continue;
+        }        
         // Get the list of clips that will need to get progress info
         QTreeWidgetItemIterator it(m_listView);
         QList <ProjectItem *> processingItems;
@@ -2421,6 +2417,20 @@ void ProjectList::slotGenerateProxy()
             ++it;
         }
 
+        // Make sure proxy path is writable
+        QFile file(info.dest);
+        if (!file.open(QIODevice::WriteOnly)) {
+            for (int i = 0; i < processingItems.count(); i++)
+                setProxyStatus(processingItems.at(i), PROXYCRASHED);
+            m_processingProxy.removeAll(info.dest);
+            continue;
+        }
+        file.close();
+        QFile::remove(info.dest);
+    
+        for (int i = 0; i < processingItems.count(); i++)
+            setProxyStatus(processingItems.at(i), CREATINGPROXY);
+
         // Special case: playlist clips (.mlt or .kdenlive project files)
         if (info.type == PLAYLIST) {
             // change FFmpeg params to MLT format
@@ -2459,7 +2469,8 @@ void ProjectList::slotGenerateProxy()
                     QFile::remove(info.dest);
                     m_abortProxy.removeAll(info.dest);
                     m_processingProxy.removeAll(info.dest);
-                    setProxyStatus(info.dest, NOPROXY);
+                    for (int i = 0; i < processingItems.count(); i++)
+                        setProxyStatus(processingItems.at(i), NOPROXY);
                     result = -2;
                 }
                 else {
@@ -2473,13 +2484,15 @@ void ProjectList::slotGenerateProxy()
             if (result == -1) result = myProcess.exitStatus();
             if (result == 0) {
                 // proxy successfully created
-                setProxyStatus(info.dest, PROXYDONE);
+                for (int i = 0; i < processingItems.count(); i++)
+                    setProxyStatus(processingItems.at(i), PROXYDONE);
                 slotGotProxy(info.dest);
             }
             else if (result == 1) {
                 // Proxy process crashed
                 QFile::remove(info.dest);
-                setProxyStatus(info.dest, PROXYCRASHED);
+                for (int i = 0; i < processingItems.count(); i++)
+                    setProxyStatus(processingItems.at(i), PROXYCRASHED);
             }
             continue;
         }
@@ -2489,7 +2502,8 @@ void ProjectList::slotGenerateProxy()
             QImage i(info.src);
             if (i.isNull()) {
                 // Cannot load image
-                setProxyStatus(info.dest, PROXYCRASHED);
+                for (int i = 0; i < processingItems.count(); i++)
+                    setProxyStatus(processingItems.at(i), PROXYCRASHED);
                 continue;
             }
             QImage proxy;
@@ -2531,7 +2545,8 @@ void ProjectList::slotGenerateProxy()
                 processed.save(info.dest);
             }
             else proxy.save(info.dest);
-            setProxyStatus(info.dest, PROXYDONE);
+            for (int i = 0; i < processingItems.count(); i++)
+                setProxyStatus(processingItems.at(i), PROXYDONE);
             slotGotProxy(info.dest);
             m_abortProxy.removeAll(info.dest);
             m_processingProxy.removeAll(info.dest);
@@ -2562,7 +2577,11 @@ void ProjectList::slotGenerateProxy()
                 m_abortProxy.removeAll(info.dest);
                 m_processingProxy.removeAll(info.dest);
                 QFile::remove(info.dest);
-                if (!m_abortAllProxies) setProxyStatus(info.dest, NOPROXY);
+                if (!m_abortAllProxies) {
+                    for (int i = 0; i < processingItems.count(); i++)
+                        setProxyStatus(processingItems.at(i), NOPROXY);
+                }
+                else continue;
                 result = -2;
             
             }
@@ -2575,16 +2594,26 @@ void ProjectList::slotGenerateProxy()
         myProcess.waitForFinished();
         m_abortProxy.removeAll(info.dest);
         m_processingProxy.removeAll(info.dest);
-        if (result == -1) result = myProcess.exitStatus();
-        if (result == 0) {
+        if (result == -1) {
+            result = myProcess.exitStatus();
+        }
+        
+        // FFmpeg process terminated normally, but make sure proxy clip exists
+        if (QFileInfo(info.dest).size() == 0) {
+            result = QProcess::CrashExit;
+        }
+
+        if (result == QProcess::NormalExit) {
             // proxy successfully created
-            setProxyStatus(info.dest, PROXYDONE);
+            for (int i = 0; i < processingItems.count(); i++)
+                setProxyStatus(processingItems.at(i), PROXYDONE);
             slotGotProxy(info.dest);
         }
-        else if (result == 1) {
+        else if (result == QProcess::CrashExit) {
             // Proxy process crashed
             QFile::remove(info.dest);
-            setProxyStatus(info.dest, PROXYCRASHED);
+            for (int i = 0; i < processingItems.count(); i++)
+                setProxyStatus(processingItems.at(i), PROXYCRASHED);
         }
     }
 }
@@ -2775,27 +2804,23 @@ void ProjectList::slotDeleteProxy(const QString proxyPath)
     QFile::remove(proxyPath);
 }
 
-void ProjectList::setProxyStatus(const QString proxyPath, PROXYSTATUS status, int progress)
-{
-    if (proxyPath.isEmpty() || m_abortAllProxies) return;
-    QTreeWidgetItemIterator it(m_listView);
-    ProjectItem *item;
-    while (*it && !m_abortAllProxies) {
-        if ((*it)->type() == PROJECTCLIPTYPE) {
-            item = static_cast <ProjectItem *>(*it);
-            if (item->referencedClip()->getProperty("proxy") == proxyPath) {
-                setProxyStatus(item, status, progress);
-            }
-        }
-        ++it;
-    }
-}
-
 void ProjectList::setProxyStatus(ProjectItem *item, PROXYSTATUS status, int progress)
 {
-    if (item == NULL) return;
+    if (item == NULL || m_abortAllProxies) return;
     monitorItemEditing(false);
     item->setProxyStatus(status, progress);
+    if (status == PROXYCRASHED) {
+        DocClipBase *clip = item->referencedClip();
+        if (!clip) {
+            kDebug()<<"// PROXY CRASHED";
+        }
+        else if (clip->getProducer() == NULL && !clip->isPlaceHolder()) {
+            // disable proxy and fetch real clip
+            clip->setProperty("proxy", "-");
+            QDomElement xml = clip->toXML();
+            m_render->getFileProperties(xml, clip->getId(), m_listView->iconSize().height(), true);
+        }
+    }
     monitorItemEditing(true);
 }
 
index 24d1ba0cbfff2103d1a57fab19dda27b741ad0e3..423b3df9f96c00b230ad879e3e3b692f0c59f2ed 100644 (file)
@@ -339,7 +339,6 @@ private:
     /** @brief Set the Proxy status on a clip. 
      * @param item The clip item to set status
      * @param status The proxy status (see definitions.h) */
-    void setProxyStatus(const QString proxyPath, PROXYSTATUS status, int progress = 0);
     void setProxyStatus(ProjectItem *item, PROXYSTATUS status, int progress = 0);
     /** @brief Process ffmpeg output to find out process progress. */
     void processLogInfo(QList <ProjectItem *>items, int *duration, const QString &log);
index 121a1d8bcd038212debc99a367e532b41dd57ce2..24132878933ba613eae9e7e05b3e4bbedc613049 100644 (file)
@@ -66,9 +66,10 @@ const int RUNNINGJOB = 1;
 const int FINISHEDJOB = 2;
 
 
-RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent) :
+RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, MltVideoProfile profile, QWidget * parent) :
         QDialog(parent),
         m_projectFolder(projectfolder),
+        m_profile(profile),
         m_blockProcessing(false)
 {
     m_view.setupUi(this);
@@ -1057,7 +1058,6 @@ int RenderWidget::waitingJobsCount() const
 
 void RenderWidget::setProfile(MltVideoProfile profile)
 {
-    m_profile = profile;
     m_view.scanning_list->setCurrentIndex(0);
     m_view.rescale_width->setValue(KdenliveSettings::defaultrescalewidth());
     if (!m_view.rescale_keep->isChecked()) {
@@ -1065,7 +1065,10 @@ void RenderWidget::setProfile(MltVideoProfile profile)
         m_view.rescale_height->setValue(KdenliveSettings::defaultrescaleheight());
         m_view.rescale_height->blockSignals(false);
     }
-    refreshView();
+    if (m_profile != profile) {
+        m_profile = profile;
+        refreshView();
+    }
 }
 
 void RenderWidget::refreshCategory()
@@ -1244,10 +1247,14 @@ void RenderWidget::refreshView()
     m_view.size_list->setVisible(m_view.size_list->count() > 1 || m_view.format_list->count() <= 1);
     m_view.size_list->blockSignals(false);
     m_view.format_list->blockSignals(false);
-    if (m_view.size_list->count() > 0)
+    if (m_view.size_list->count() > 0) {
         refreshParams();
-    else
+    }
+    else {
+        // No matching profile
+        errorMessage(i18n("No matching profile"));
         m_view.advanced_params->clear();
+    }
 }
 
 KUrl RenderWidget::filenameWithExtension(KUrl url, QString extension)
@@ -1278,6 +1285,7 @@ void RenderWidget::refreshParams()
     // Format not available (e.g. codec not installed); Disable start button
     QListWidgetItem *item = m_view.size_list->currentItem();
     if (!item || item->isHidden()) {
+        if (!item) errorMessage(i18n("No matching profile"));
         m_view.advanced_params->clear();
         m_view.buttonRender->setEnabled(false);
         m_view.buttonGenerateScript->setEnabled(false);
index b6137b181d88f17c53db5786249b9e591134b372..ea9b122a10bb32217077c48c880b4c8669dce238 100644 (file)
@@ -114,7 +114,7 @@ class RenderWidget : public QDialog
     Q_OBJECT
 
 public:
-    explicit RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent = 0);
+    explicit RenderWidget(const QString &projectfolder, bool enableProxy, MltVideoProfile profile, QWidget * parent = 0);
     virtual ~RenderWidget();
     void setGuides(QDomElement guidesxml, double duration);
     void focusFirstVisibleItem();
@@ -181,8 +181,8 @@ private slots:
 
 private:
     Ui::RenderWidget_UI m_view;
-    MltVideoProfile m_profile;
     QString m_projectFolder;
+    MltVideoProfile m_profile;
     RenderViewDelegate *m_scriptsDelegate;
     RenderViewDelegate *m_jobsDelegate;
     bool m_blockProcessing;