]> git.sesse.net Git - kdenlive/blobdiff - src/clipproperties.cpp
Many improvements to title clips (recreate when missing, fix text selection visible...
[kdenlive] / src / clipproperties.cpp
index 4bb88abacfcae6d396b50e90b8add37246115a49..38338e0ebbb427ab519027ee049145aca0502fc0 100644 (file)
 #include "kthumb.h"
 #include "markerdialog.h"
 
-#define VIDEOTAB 0
-#define AUDIOTAB 1
-#define COLORTAB 2
-#define SLIDETAB 3
-#define IMAGETAB 4
-#define MARKERTAB 5
-#define ADVANCEDTAB 6
-
-#define TYPE_JPEG 0
-#define TYPE_PNG 1
-#define TYPE_BMP 2
-#define TYPE_GIF 3
+static const int VIDEOTAB = 0;
+static const int AUDIOTAB = 1;
+static const int COLORTAB = 2;
+static const int SLIDETAB = 3;
+static const int IMAGETAB = 4;
+static const int MARKERTAB = 5;
+static const int ADVANCEDTAB = 6;
+
+static const int TYPE_JPEG = 0;
+static const int TYPE_PNG = 1;
+static const int TYPE_BMP = 2;
+static const int TYPE_GIF = 3;
 
 ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent): QDialog(parent), m_tc(tc), m_clip(clip), m_fps(fps), m_clipNeedsRefresh(false), m_count(0) {
     setFont(KGlobalSettings::toolBarFont());
@@ -48,6 +48,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
     m_view.clip_path->setText(url.path());
     m_view.clip_description->setText(m_clip->description());
     QMap <QString, QString> props = m_clip->properties();
+    // disable advanced properties until implemented
+    m_view.tabWidget->widget(ADVANCEDTAB)->setEnabled(false);
 
     if (props.contains("audiocodec"))
         m_view.clip_acodec->setText(props.value("audiocodec"));
@@ -179,8 +181,7 @@ void ClipProperties::slotAddMarker() {
     CommentedTime marker(GenTime(), i18n("Marker"));
     MarkerDialog d(m_clip, marker, m_tc, this);
     if (d.exec() == QDialog::Accepted) {
-        int id = m_clip->getId();
-        emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
+        emit addMarker(m_clip->getId(), d.newMarker().time(), d.newMarker().comment());
     }
     QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
 }
@@ -191,8 +192,7 @@ void ClipProperties::slotEditMarker() {
     if (pos < 0 || pos > marks.count() - 1) return;
     MarkerDialog d(m_clip, marks.at(pos), m_tc, this);
     if (d.exec() == QDialog::Accepted) {
-        int id = m_clip->getId();
-        emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
+        emit addMarker(m_clip->getId(), d.newMarker().time(), d.newMarker().comment());
     }
     QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
 }
@@ -201,13 +201,12 @@ void ClipProperties::slotDeleteMarker() {
     QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
     int pos = m_view.markers_list->currentIndex().row();
     if (pos < 0 || pos > marks.count() - 1) return;
-    int id = m_clip->getId();
-    emit addMarker(id, marks.at(pos).time(), QString());
+    emit addMarker(m_clip->getId(), marks.at(pos).time(), QString());
 
     QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
 }
 
-int ClipProperties::clipId() const {
+const QString &ClipProperties::clipId() const {
     return m_clip->getId();
 }
 
@@ -315,7 +314,9 @@ void ClipProperties::parseFolder() {
         extension = "/.all.gif";
         break;
     default:
-        filters << "*.jpg" << "*.jpeg";
+        filters << "*.jpg";
+        // TODO: improve jpeg image detection with extension like jpeg, requires change in MLT image producers
+        // << "*.jpeg";
         extension = "/.all.jpg";
         break;
     }