]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.h
Merge branch 'next' into audioAlign
[kdenlive] / src / projectlist.h
index 785cbff593ca294a53133873c99ddf29a2645f9f..bd04931dcb23227b251672ac937a85db1898d84e 100644 (file)
@@ -148,25 +148,22 @@ public:
             QRectF bounding;
             painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText, &bounding);
             
-            int proxy = index.data(Qt::UserRole + 5).toInt();
-            if (proxy != 0 && proxy != JOBDONE) {
-                QString proxyText;
-                QColor color;
-                if (proxy != JOBCRASHED) {
-                    // Draw proxy progress bar
-                    color = option.palette.alternateBase().color();
+            int jobProgress = index.data(Qt::UserRole + 5).toInt();
+            if (jobProgress != 0 && jobProgress != JOBDONE && jobProgress != JOBABORTED) {
+                if (jobProgress != JOBCRASHED) {
+                    // Draw job progress bar
+                    QColor color = option.palette.alternateBase().color();
                     painter->setPen(Qt::NoPen);
                     color.setAlpha(180);
                     painter->setBrush(QBrush(color));
-                    QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 5, pixmap.width() - 2, 4);
+                    QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 9, pixmap.width() - 2, 8);
                     painter->drawRect(progress);
                     painter->setBrush(option.palette.text());
-                    if (proxy > 0) {
+                    if (jobProgress > 0) {
                         progress.adjust(1, 1, 0, -1);
-                        progress.setWidth((pixmap.width() - 4) * proxy / 100);
+                        progress.setWidth((pixmap.width() - 4) * jobProgress / 100);
                         painter->drawRect(progress);
-                    }
-                    else if (proxy == JOBWAITING) {
+                    } else if (jobProgress == JOBWAITING) {
                         // Draw kind of a pause icon
                         progress.adjust(1, 1, 0, -1);
                         progress.setWidth(2);
@@ -174,16 +171,15 @@ public:
                         progress.moveLeft(progress.right() + 2);
                         painter->drawRect(progress);
                     }
-                }
-                else if (proxy == JOBCRASHED) {
-                    proxyText = index.data(Qt::UserRole + 7).toString();
-                    if (!proxyText.isEmpty()) {
-                        QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " ");
+                } else if (jobProgress == JOBCRASHED) {
+                    QString jobText = index.data(Qt::UserRole + 7).toString();
+                    if (!jobText.isEmpty()) {
+                        QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + jobText + " ");
                         painter->setPen(Qt::NoPen);
                         painter->setBrush(option.palette.highlight());
                         painter->drawRoundedRect(txtBounding, 2, 2);
                         painter->setPen(option.palette.highlightedText().color());
-                        painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , proxyText);
+                        painter->drawText(txtBounding, Qt::AlignCenter, jobText);
                     }
                 }
             }
@@ -261,9 +257,12 @@ public:
     void clearSelection();
     /** @brief Print required overlays over clip thumb (proxy, stabilized,...). */
     void processThumbOverlays(ProjectItem *item, QPixmap &pix);
+    /** @brief Start an MLT process job. */
+    void startClipFilterJob(const QString &filterName, const QString &condition);
+    /** @brief Set current document for the project tree. */
+    void setDocument(KdenliveDoc *doc);
 
 public slots:
-    void setDocument(KdenliveDoc *doc);
     void updateAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips);
     void slotReplyGetImage(const QString &clipId, const QImage &img);
     void slotReplyGetImage(const QString &clipId, const QString &name, int width, int height);
@@ -301,9 +300,11 @@ public slots:
     void slotDeleteProxy(const QString proxyPath);
     /** @brief Start a hard cut clip job. */
     void slotCutClipJob(const QString &id, QPoint zone);
-    void slotTranscodeClipJob(QStringList ids, QString params, QString desc);
+    /** @brief Start transcoding selected clips. */
+    void slotTranscodeClipJob(const QString &condition, QString params, QString desc);
     /** @brief Start an MLT process job. */
     void slotStartFilterJob(ItemInfo, const QString&,const QString&,const QString&,const QString&,const QString&,const QString&,const QString&);
+    
 
 private:
     ProjectListView *m_listView;
@@ -316,6 +317,7 @@ private:
     ProjectItem *getItemById(const QString &id);
     QTreeWidgetItem *getAnyItemById(const QString &id);
     FolderProjectItem *getFolderItemById(const QString &id);
+    FolderProjectItem *getFolderItemByName(const QString &name);
     QAction *m_openAction;
     QAction *m_reloadAction;
     QAction *m_discardCurrentClipJobs;
@@ -393,6 +395,8 @@ private:
     void discardJobs(const QString &id, JOBTYPE type = NOJOBTYPE);
     /** @brief Get the list of job names for current clip. */
     QStringList getPendingJobs(const QString &id);
+    /** @brief Start an MLT process job. */
+    void processClipJob(QStringList ids, const QString&destination, bool autoAdd, QStringList jobParams, const QString &description);
 
 private slots:
     void slotClipSelected();
@@ -406,7 +410,7 @@ private slots:
     void slotContextMenu(const QPoint &pos, QTreeWidgetItem *item);
 
     /** @brief Creates an AddFolderCommand. */
-    void slotAddFolder();
+    void slotAddFolder(const QString &name = QString());
 
     /** @brief This is triggered when a clip description has been modified. */
     void slotItemEdited(QTreeWidgetItem *item, int column);
@@ -440,7 +444,7 @@ private slots:
     /** @brief Update a clip's job status. */
     void slotProcessLog(const QString, int progress, int, const QString = QString());
     /** @brief A clip job crashed, inform user. */
-    void slotUpdateJobStatus(const QString &id, int type, int status, const QString &label, const QString &actionName, const QString details);
+    void slotUpdateJobStatus(const QString id, int type, int status, const QString label, const QString actionName, const QString details);
     void slotUpdateJobStatus(ProjectItem *item, int type, int status, const QString &label, const QString &actionName = QString(), const QString details = QString());
     /** @brief Display error log for last failed job. */
     void slotShowJobLog();
@@ -480,7 +484,7 @@ signals:
     void cancelRunningJob(const QString, stringMap);
     void processLog(const QString, int , int, const QString = QString());
     void addClip(const QString, const QString &, const QString &);
-    void updateJobStatus(const QString, int, int, const QString &label = QString(), const QString &actionName = QString(), const QString details = QString());
+    void updateJobStatus(const QString, int, int, const QString label = QString(), const QString actionName = QString(), const QString details = QString());
     void gotProxy(const QString);
     void checkJobProcess();
     /** @brief A Filter Job produced results, send them back to the clip. */