]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.h
Continued work on proxy editing
[kdenlive] / src / projectlist.h
index 00ab5263f6f64d426d94d54115a6541dbd72f46d..42d56d6c8af36397fa9aa02e3013c3168a25f165 100644 (file)
@@ -107,7 +107,33 @@ public:
             int usage = index.data(UsageRole).toInt();
             if (usage != 0) subText.append(QString(" (%1)").arg(usage));
             if (option.state & (QStyle::State_Selected)) painter->setPen(option.palette.color(QPalette::Mid));
-            painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText);
+            QRectF bounding;
+            painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText, &bounding);
+            
+            int proxy = index.data(Qt::UserRole + 5).toInt();
+            if (proxy > 0) {
+                QRectF txtBounding;
+                QString proxyText;
+                QBrush brush;
+                QColor color;
+                if (proxy == 1) {
+                    proxyText = i18n("Generating proxy...");
+                    brush = option.palette.highlight();
+                    color = option.palette.color(QPalette::HighlightedText);
+                }
+                else {
+                    proxyText = i18n("Proxy");
+                    brush = option.palette.mid();
+                    color = option.palette.color(QPalette::WindowText);
+                }
+                txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " ");
+                painter->setPen(Qt::NoPen);
+                painter->setBrush(brush);
+                painter->drawRoundedRect(txtBounding, 2, 2);
+                painter->setPen(option.palette.highlightedText().color());
+                painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , proxyText);
+            }
+            
             painter->restore();
         } else if (index.column() == 2 && KdenliveSettings::activate_nepomuk()) {
             if (index.data().toString().isEmpty()) {
@@ -161,6 +187,10 @@ public:
 
     /** @brief Returns a string list of all supported mime extensions. */
     static QString getExtensions();
+    /** @brief Returns a list of urls containing original and proxy urls. */
+    QMap <QString, QString> getProxies();
+    /** @brief Enable / disable proxies. */
+    void updateProxyConfig();
 
 public slots:
     void setDocument(KdenliveDoc *doc);
@@ -264,7 +294,8 @@ private slots:
     bool adjustProjectProfileToItem(ProjectItem *item = NULL);
     /** @brief Add a sequence from the stopmotion widget. */
     void slotAddOrUpdateSequence(const QString frameName);
-    //void slotShowMenu(const QPoint &pos);
+    /** @brief A proxy clip was created, update display. */
+    void slotGotProxy(const QString id, bool success);
 
 signals:
     void clipSelected(DocClipBase *, QPoint zone = QPoint());
@@ -286,3 +317,4 @@ signals:
 };
 
 #endif
+