]> git.sesse.net Git - kdenlive/commitdiff
*Re-introduce slideshow clips
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 2 May 2008 13:31:01 +0000 (13:31 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 2 May 2008 13:31:01 +0000 (13:31 +0000)
*color of color clips can now be edited
*cleanup

svn path=/branches/KDE4/; revision=2169

26 files changed:
src/CMakeLists.txt
src/clipitem.cpp
src/clipitem.h
src/clipmanager.cpp
src/clipmanager.h
src/clipproperties.cpp
src/customtrackview.cpp
src/customtrackview.h
src/docclipbase.cpp
src/docclipbase.h
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/kdenlivesettings.kcfg
src/kthumb.cpp
src/kthumb.h
src/mainwindow.cpp
src/projectitem.cpp
src/projectitem.h
src/projectlist.cpp
src/projectlist.h
src/renderer.cpp
src/renderer.h
src/slideshowclip.cpp [new file with mode: 0644]
src/slideshowclip.h [new file with mode: 0644]
src/widgets/clipproperties_ui.ui
src/widgets/slideshowclip_ui.ui [new file with mode: 0644]

index d75bebed3e665cf5ea110a219a701b9ea51edcd3..c08a1d864bdf4784146a785aac8885f93dc9d1fc 100644 (file)
@@ -25,6 +25,7 @@ kde4_add_ui_files(kdenlive_UI
   widgets/monitor_ui.ui
   widgets/recmonitor_ui.ui
   widgets/colorclip_ui.ui
+  widgets/slideshowclip_ui.ui
   widgets/configmisc_ui.ui
   widgets/configenv_ui.ui
   widgets/configdisplay_ui.ui
@@ -104,6 +105,7 @@ set(kdenlive_SRCS
   editfoldercommand.cpp
   clipproperties.cpp
   movetransitioncommand.cpp
+  slideshowclip.cpp
 )
 
 kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
index 21d24e3d80922a87c59105301d094949796380f6..d3ce230dc2e009d9be6c4e2424585d1584f82156 100644 (file)
@@ -45,13 +45,12 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double scale, double fps)
     setRect(rect);
     kDebug() << "/////  NEW CLIP RECT: " << rect;
     m_fps = fps;
-    m_xml = clip->toXML();
     m_clipName = clip->name();
     m_producer = clip->getId();
     m_clipType = clip->clipType();
     m_cropStart = GenTime();
 
-    m_maxDuration = m_cropDuration;
+    m_maxDuration = clip->maxDuration();
     setAcceptDrops(true);
     audioThumbReady = clip->audioThumbCreated();
     /*
@@ -68,7 +67,7 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double scale, double fps)
     connect(this , SIGNAL(prepareAudioThumb(double, QPainterPath, int, int)) , this, SLOT(slotPrepareAudioThumb(double, QPainterPath, int, int)));
 
     setBrush(QColor(141, 166, 215));
-    if (m_clipType == VIDEO || m_clipType == AV) {
+    if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) {
         m_hasThumbs = true;
         connect(this, SIGNAL(getThumb(int, int)), clip->thumbProducer(), SLOT(extractImage(int, int)));
         connect(clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
@@ -81,15 +80,12 @@ ClipItem::ClipItem(DocClipBase *clip, ItemInfo info, double scale, double fps)
         endThumbTimer = new QTimer(this);
         endThumbTimer->setSingleShot(true);
         connect(endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
-
     } else if (m_clipType == COLOR) {
-        m_maxDuration = GenTime(10000, m_fps);
-        QString colour = m_xml.attribute("colour");
+        QString colour = clip->getProperty("colour");
         colour = colour.replace(0, 2, "#");
         setBrush(QColor(colour.left(7)));
     } else if (m_clipType == IMAGE || m_clipType == TEXT) {
-        m_maxDuration = GenTime(10000, m_fps);
-        m_startPix = KThumb::getImage(KUrl(m_xml.attribute("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
+        m_startPix = KThumb::getImage(KUrl(clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
         m_endPix = m_startPix;
     } else if (m_clipType == AUDIO) {
         connect(clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
@@ -107,6 +103,20 @@ void ClipItem::resetThumbs() {
     audioThumbCachePic.clear();
 }
 
+
+void ClipItem::refreshClip() {
+    m_maxDuration = m_clip->maxDuration();
+    if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) slotFetchThumbs();
+    else if (m_clipType == COLOR) {
+        QString colour = m_clip->getProperty("colour");
+        colour = colour.replace(0, 2, "#");
+        setBrush(QColor(colour.left(7)));
+    } else if (m_clipType == IMAGE || m_clipType == TEXT) {
+        m_startPix = KThumb::getImage(KUrl(m_clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
+        m_endPix = m_startPix;
+    }
+}
+
 void ClipItem::slotFetchThumbs() {
     m_thumbsRequested += 2;
     emit getThumb((int)m_cropStart.frames(m_fps), (int)(m_cropStart + m_cropDuration).frames(m_fps));
@@ -144,7 +154,7 @@ DocClipBase *ClipItem::baseClip() {
 }
 
 QDomElement ClipItem::xml() const {
-    return m_xml;
+    return m_clip->toXML();
 }
 
 int ClipItem::clipType() {
index f9de3c1a218541cfe2b9be1c0074f2badf29dda4..992a8f8158ccab414dd5df5c69c9441c06f59e85 100644 (file)
@@ -75,6 +75,8 @@ public:
     void addTransition(Transition*);
     /** regenerate audio and video thumbnails */
     void resetThumbs();
+    /** update clip properties from base clip */
+    void refreshClip();
 
 protected:
     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
@@ -87,7 +89,6 @@ protected:
     virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *);
 
 private:
-    QDomElement m_xml;
     DocClipBase *m_clip;
     OPERATIONTYPE m_resizeMode;
     int m_grabPoint;
index 9b43fed2b237ff56b6f88fba188e05f954314417..6feccc285d29df1c26481898468c3dd18b90135c 100644 (file)
@@ -128,6 +128,26 @@ void ClipManager::slotAddColorClipFile(const QString name, const QString color,
     m_doc->commandStack()->push(command);
 }
 
+void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, QString group, const int groupId) {
+    QDomDocument doc;
+    QDomElement prod = doc.createElement("producer");
+    prod.setAttribute("resource", path);
+    prod.setAttribute("type", (int) SLIDESHOW);
+    uint id = m_clipIdCounter++;
+    prod.setAttribute("id", QString::number(id));
+    prod.setAttribute("in", "0");
+    prod.setAttribute("out", m_doc->getFramePos(duration) * count);
+    prod.setAttribute("ttl", m_doc->getFramePos(duration));
+    prod.setAttribute("name", name);
+    prod.setAttribute("loop", loop);
+    if (!group.isEmpty()) {
+        prod.setAttribute("groupname", group);
+        prod.setAttribute("groupid", groupId);
+    }
+    AddClipCommand *command = new AddClipCommand(m_doc, prod, id, true);
+    m_doc->commandStack()->push(command);
+}
+
 
 
 void ClipManager::slotAddTextClipFile(const QString path, const QString group, const int groupId) {
index d4062aefe901f1ecd44142f7aacc44318b4b7d52..2fac528a2e6b6403023b96e956dc5fdbb6981d1b 100644 (file)
@@ -51,6 +51,7 @@ Q_OBJECT public:
     void slotAddClipFile(const KUrl url, const QString group, const int groupId);
     void slotAddTextClipFile(const QString path, const QString group, const int groupId);
     void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId);
+    void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId);
     DocClipBase *getClipById(int clipId);
     void slotDeleteClip(uint clipId);
     void setThumbsProgress(KUrl url, int progress);
index 81e4c88a817b7e13b869475fd4ad179ca95840f4..6268a478aec22e0890aba5c8116da5289238762a 100644 (file)
 #include "clipproperties.h"
 #include "kthumb.h"
 
+#define VIDEOTAB 0
+#define AUDIOTAB 1
+#define COLORTAB 2
+#define SLIDETAB 3
+#define ADVANCEDTAB 4
+
+#define TYPE_JPEG 0
+#define TYPE_PNG 1
+#define TYPE_BMP 2
+#define TYPE_GIF 3
+
 ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent): QDialog(parent), m_tc(tc), m_clip(clip), m_fps(fps) {
     setFont(KGlobalSettings::toolBarFont());
     m_view.setupUi(this);
@@ -36,28 +47,54 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
     QMap <QString, QString> props = m_clip->properties();
 
     if (props.contains("audiocodec"))
-        m_view.clip_acodec->setText(props["audiocodec"]);
+        m_view.clip_acodec->setText(props.value("audiocodec"));
     if (props.contains("frequency"))
-        m_view.clip_frequency->setText(props["frequency"]);
+        m_view.clip_frequency->setText(props.value("frequency"));
     if (props.contains("channels"))
-        m_view.clip_channels->setText(props["channels"]);
+        m_view.clip_channels->setText(props.value("channels"));
 
     CLIPTYPE t = m_clip->clipType();
-    if (t != AUDIO) {
+    if (t == COLOR) {
+       m_view.clip_path->setEnabled(false);
+       m_view.tabWidget->removeTab(SLIDETAB);
+       m_view.tabWidget->removeTab(AUDIOTAB);
+       m_view.tabWidget->removeTab(VIDEOTAB);
+        m_view.clip_thumb->setHidden(true);
+       m_view.clip_color->setColor(QColor("#" + props.value("colour").right(8).left(6)));
+    }
+    else if (t == SLIDESHOW) {
+       m_view.tabWidget->removeTab(COLORTAB);
+       m_view.tabWidget->removeTab(AUDIOTAB);
+       m_view.tabWidget->removeTab(VIDEOTAB);
+       QStringList types;
+       types << "JPG" << "PNG" << "BMP" << "GIF";
+       m_view.image_type->addItems(types);
+       m_view.slide_loop->setChecked(props.value("loop").toInt());
+       QString path = props.value("resource");
+       if (path.endsWith("png")) m_view.image_type->setCurrentIndex(TYPE_PNG);
+       else if (path.endsWith("bmp")) m_view.image_type->setCurrentIndex(TYPE_BMP);
+       else if (path.endsWith("gif")) m_view.image_type->setCurrentIndex(TYPE_GIF);
+       m_view.slide_duration->setText(tc.getTimecodeFromFrames(props.value("ttl").toInt()));
+    }
+    else if (t != AUDIO) {
+       m_view.tabWidget->removeTab(SLIDETAB);
+       m_view.tabWidget->removeTab(COLORTAB);
         if (props.contains("frame_size"))
-            m_view.clip_size->setText(props["frame_size"]);
+            m_view.clip_size->setText(props.value("frame_size"));
         if (props.contains("videocodec"))
-            m_view.clip_vcodec->setText(props["videocodec"]);
+            m_view.clip_vcodec->setText(props.value("videocodec"));
         if (props.contains("fps"))
-            m_view.clip_fps->setText(props["fps"]);
+            m_view.clip_fps->setText(props.value("fps"));
         if (props.contains("aspect_ratio"))
-            m_view.clip_ratio->setText(props["aspect_ratio"]);
+            m_view.clip_ratio->setText(props.value("aspect_ratio"));
 
         QPixmap pix = m_clip->thumbProducer()->getImage(url, 240, 180);
         m_view.clip_thumb->setPixmap(pix);
-        if (t == IMAGE || t == VIDEO || t == COLOR) m_view.tabWidget->removeTab(1);
+        if (t == IMAGE || t == VIDEO) m_view.tabWidget->removeTab(AUDIOTAB);
     } else {
-        m_view.tabWidget->removeTab(0);
+       m_view.tabWidget->removeTab(SLIDETAB);
+       m_view.tabWidget->removeTab(COLORTAB);
+        m_view.tabWidget->removeTab(VIDEOTAB);
         m_view.clip_thumb->setHidden(true);
     }
     if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
@@ -72,9 +109,20 @@ int ClipProperties::clipId() {
     return m_clip->getId();
 }
 
+
 QMap <QString, QString> ClipProperties::properties() {
     QMap <QString, QString> props;
     props["description"] = m_view.clip_description->text();
+    CLIPTYPE t = m_clip->clipType();
+    if (t == SLIDESHOW) {
+       props["loop"] = QString::number((int) m_view.slide_loop->isChecked());
+    }
+    else if (t == COLOR) {
+       QMap <QString, QString> old_props = m_clip->properties();
+       QString new_color = m_view.clip_color->color().name();
+       if (new_color != QString("#" + old_props.value("colour").right(8).left(6)))
+           props["colour"] = "0x" + new_color.right(6) + "ff";
+    }
     return props;
 }
 
index b25d863dd73d5300ea2ededabf22dd811a107e84..e60181964c2506046d7a6a19cc2cac967345b566 100644 (file)
@@ -903,6 +903,20 @@ void CustomTrackView::addClip(QDomElement xml, int clipId, ItemInfo info) {
     m_document->renderer()->doRefresh();
 }
 
+void CustomTrackView::slotUpdateClip(int clipId) {
+    QList<QGraphicsItem *> list = scene()->items();
+    ClipItem *clip = NULL;
+    for (int i = 0; i < list.size(); ++i) {
+        if (list.at(i)->type() == AVWIDGET) {
+            clip = static_cast <ClipItem *>(list.at(i));
+           if (clip->clipProducer() == clipId) {
+               clip->refreshClip();
+               m_document->renderer()->mltUpdateClip(m_tracksList.count() - clip->track(), clip->startPos(), clip->xml());
+           }
+        }
+    }
+}
+
 ClipItem *CustomTrackView::getClipItemAt(int pos, int track) {
     QList<QGraphicsItem *> list = scene()->items(QPointF(pos * m_scale, track * m_tracksHeight + m_tracksHeight / 2));
     ClipItem *clip = NULL;
index 09c52724832507440f046d309462b2ab76b974c8..6d21ade0278e9e7985434215d12abbb7b0b73cdf 100644 (file)
@@ -87,6 +87,7 @@ public slots:
     void slotTransitionUpdated(Transition *, QDomElement);
     void slotSwitchTrackAudio(int ix);
     void slotSwitchTrackVideo(int ix);
+    void slotUpdateClip(int clipId);
 
 protected:
     virtual void drawBackground(QPainter * painter, const QRectF & rect);
index 5b85e6cc22c9d7ed88057c398c3a61e48dd6fdae..1142ba1a289c203e50b833e868d7d60ae5ef498b 100644 (file)
@@ -156,6 +156,14 @@ const GenTime &DocClipBase::duration() const {
     return m_duration;
 }
 
+const GenTime &DocClipBase::maxDuration() const {
+    if (m_clipType == COLOR || m_clipType == IMAGE || m_clipType == TEXT || (m_clipType == SLIDESHOW &&  m_properties.value("loop") == "1")) {
+       GenTime dur(10000, KdenliveSettings::project_fps());
+       return dur;
+    }
+    return m_duration;
+}
+
 bool DocClipBase::hasFileSize() const {
     return true;
 }
@@ -367,11 +375,14 @@ void DocClipBase::setProperties(QMap <QString, QString> properties) {
     }
 }
 
+void DocClipBase::setProperty(QString key, QString value) {
+    m_properties.insert(key, value);
+}
+
 QMap <QString, QString> DocClipBase::properties() const {
     return m_properties;
 }
 
-
 void DocClipBase::slotGetAudioThumbs() {
 
     if (m_audioThumbCreated) {
index e7ec0ae33c1b45e9dacce0d9775a43e0e7d535e2..753ec2bbcfd95b3905c0f655fea1841f6a09595a 100644 (file)
@@ -87,6 +87,7 @@ Q_OBJECT public:
 
     /** Returns any property of this clip. */
     const QString getProperty(const QString prop) const;
+    void setProperty(QString key, QString value);
 
     /** Returns the internal unique id of the clip. */
     uint getId() const;
@@ -97,6 +98,7 @@ Q_OBJECT public:
 
     /** returns the duration of this clip */
     const GenTime & duration() const;
+    const GenTime &maxDuration() const;
     /** returns the duration of this clip */
     void setDuration(GenTime dur);
 
index df36874662a57e102744439c7d1244b3b1e6627d..1fe1bb32cf21796d528051ffc97c10942edb20a6 100644 (file)
@@ -379,6 +379,11 @@ void KdenliveDoc::slotAddColorClipFile(const QString name, const QString color,
     setModified(true);
 }
 
+void KdenliveDoc::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId) {
+    m_clipManager->slotAddSlideshowClipFile(name, path, count, duration, loop, group, groupId);
+    setModified(true);
+}
+
 void KdenliveDoc::slotCreateTextClip(QString group, int groupId) {
     QString titlesFolder = projectFolder().path() + "/titles/";
     KStandardDirs::makeDir(titlesFolder);
index cfb922f9c1d7525da8ef806770a3c6eb035d2f07..a3de7ba12df60ce699a14f46e922546953dee9df 100644 (file)
@@ -69,6 +69,7 @@ Q_OBJECT public:
     void slotDeleteFolder(const QString folderName, const int id);
     void slotEditFolder(const QString folderName, const QString oldfolderName, int clipId);
     void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId = -1);
+    void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId = -1);
     void deleteClip(const uint clipId);
     int getFramePos(QString duration);
     DocClipBase *getBaseClip(int clipId);
index 4e94371e282e685bce9ffac5ca706d8c7d483358..eb59244d9f5baf2795e1be054cae76b3cd4a62af 100644 (file)
       <label>Current project display ratio.</label>
       <default>1.7777778</default>
     </entry>
+    <entry name="project_fps" type="Double">
+      <label>Current project fps.</label>
+      <default>25</default>
+    </entry>
     <entry name="default_profile" type="String">
       <label>Default project format.</label>
       <default>hdv_1080_50i</default>
index 8f1b9d4785c308c0acd04c7e6db43f6cb8b31dd7..9d47cf486cfb9242a825dab267468170f6a1b515 100644 (file)
@@ -220,7 +220,25 @@ QPixmap KThumb::getImage(KUrl url, int frame, int width, int height) {
         return pix;
     }
     return getFrame(&producer, frame, width, height);
+}
+
+QPixmap KThumb::getImage(QDomElement xml, int frame, int width, int height) {
+    Mlt::Profile profile((char*) KdenliveSettings::current_profile().data());
+    QPixmap pix(width, height);
+    QDomDocument doc;
+    QDomElement westley = doc.createElement("westley");
+    doc.appendChild(westley);
+    westley.appendChild(doc.importNode(xml, true));
+    char *tmp = Render::decodedString(doc.toString());
+    kDebug()<<" - - - UPDATING THMB, XML: "<<doc.toString();
+    Mlt::Producer producer(profile, "westley-xml", tmp);
+    delete[] tmp;
 
+    if (producer.is_blank()) {
+        pix.fill(Qt::black);
+        return pix;
+    }
+    return getFrame(&producer, frame, width, height);
 }
 
 QPixmap KThumb::getFrame(Mlt::Producer* producer, int frame, int width, int height) {
index a5914f38be77b96d564b456ae3d5795049ed2def..13bdd68e36d9bff58ff2abc7322380541eebbd83 100644 (file)
@@ -78,6 +78,7 @@ Q_OBJECT public:
 public slots:
     void extractImage(int frame, int frame2);
     static QPixmap getImage(KUrl url, int width, int height);
+    static QPixmap getImage(QDomElement xml, int frame, int width, int height);
     /* void getImage(KUrl url, int frame, int width, int height);
      void getThumbs(KUrl url, int startframe, int endframe, int width, int height);*/
     void stopAudioThumbs();
index 34ff83f0ffaaacd8964d8c01641b45a60c6ffd85..df2fe8b0a9e3ae87b0a7e0eaa0906557848d1f13 100644 (file)
@@ -957,6 +957,10 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip) {
     ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
     if (dia.exec() == QDialog::Accepted) {
         m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
+       // update clip in timeline
+        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
+        currentTab->projectView()->slotUpdateClip(dia.clipId());
+       
     }
 }
 
index 3d7a98fee7a94ca1b5c15562b3e36d2a812fcfee..e32b3e6bee94721cc797efdb97eb2f3f1d1aba77 100644 (file)
@@ -40,32 +40,32 @@ const int UsageRole = NameRole + 2;
 
 ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId)
         : QTreeWidgetItem(parent, strings, QTreeWidgetItem::UserType), m_clipType(UNKNOWN), m_clipId(clipId) {
-    m_element = xml.cloneNode().toElement();
+    QDomElement element = xml.cloneNode().toElement();
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
-    if (!m_element.isNull()) {
-        m_element.setAttribute("id", clipId);
-        QString cType = m_element.attribute("type", QString::null);
+    if (!element.isNull()) {
+        element.setAttribute("id", clipId);
+        QString cType = element.attribute("type", QString::null);
         if (!cType.isEmpty()) {
             m_clipType = (CLIPTYPE) cType.toInt();
             slotSetToolTip();
         }
 
-        if (m_clipType == COLOR || m_clipType == IMAGE) m_element.setAttribute("duration", MAXCLIPDURATION);
-        else if (m_element.attribute("duration").isEmpty() && !m_element.attribute("out").isEmpty()) {
-            m_element.setAttribute("duration", m_element.attribute("out").toInt() - m_element.attribute("in").toInt());
+        if (m_clipType == COLOR || m_clipType == IMAGE) element.setAttribute("duration", MAXCLIPDURATION);
+        else if (element.attribute("duration").isEmpty() && !element.attribute("out").isEmpty()) {
+            element.setAttribute("duration", element.attribute("out").toInt() - element.attribute("in").toInt());
         }
     }
 }
 
 ProjectItem::ProjectItem(QTreeWidgetItem * parent, const QStringList & strings, QDomElement xml, int clipId)
         : QTreeWidgetItem(parent, strings, QTreeWidgetItem::UserType), m_clipType(UNKNOWN), m_clipId(clipId) {
-    m_element = xml.cloneNode().toElement();
+    QDomElement element = xml.cloneNode().toElement();
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
-    if (!m_element.isNull()) {
-        m_element.setAttribute("id", clipId);
-        QString cType = m_element.attribute("type", QString::null);
+    if (!element.isNull()) {
+        element.setAttribute("id", clipId);
+        QString cType = element.attribute("type", QString::null);
         if (!cType.isEmpty()) {
             m_clipType = (CLIPTYPE) cType.toInt();
             slotSetToolTip();
@@ -75,7 +75,7 @@ ProjectItem::ProjectItem(QTreeWidgetItem * parent, const QStringList & strings,
 
 // folder
 ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, int clipId)
-        : QTreeWidgetItem(parent, strings), m_element(QDomElement()), m_clipType(FOLDER), m_groupName(strings.at(1)), m_clipId(clipId), m_clip(NULL) {
+        : QTreeWidgetItem(parent, strings), m_clipType(FOLDER), m_groupName(strings.at(1)), m_clipId(clipId), m_clip(NULL) {
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     setIcon(0, KIcon("folder"));
@@ -87,11 +87,10 @@ ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     m_clip = clip;
-    m_element = clip->toXML();
     m_clipId = clip->getId();
-    QString name = m_element.attribute("name");
-    if (name.isEmpty()) name = KUrl(m_element.attribute("resource")).fileName();
-    m_clipType = (CLIPTYPE) m_element.attribute("type").toInt();
+    QString name = m_clip->getProperty("name");
+    if (name.isEmpty()) name = KUrl(m_clip->getProperty("resource")).fileName();
+    m_clipType = (CLIPTYPE) m_clip->getProperty("type").toInt();
     setText(1, name);
     kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
 }
@@ -101,11 +100,10 @@ ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     m_clip = clip;
-    m_element = clip->toXML();
     m_clipId = clip->getId();
-    QString name = m_element.attribute("name");
-    if (name.isEmpty()) name = KUrl(m_element.attribute("resource")).fileName();
-    m_clipType = (CLIPTYPE) m_element.attribute("type").toInt();
+    QString name = m_clip->getProperty("name");
+    if (name.isEmpty()) name = KUrl(m_clip->getProperty("resource")).fileName();
+    m_clipType = (CLIPTYPE) m_clip->getProperty("type").toInt();
     setText(1, name);
     kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
 }
@@ -128,7 +126,7 @@ CLIPTYPE ProjectItem::clipType() const {
 }
 
 int ProjectItem::clipMaxDuration() const {
-    return m_element.attribute("duration").toInt();
+    return m_clip->getProperty("duration").toInt();
 }
 
 bool ProjectItem::isGroup() const {
@@ -152,17 +150,17 @@ QStringList ProjectItem::names() const {
 }
 
 QDomElement ProjectItem::toXml() const {
-    return m_element;
+    return m_clip->toXML();
 }
 
 const KUrl ProjectItem::clipUrl() const {
-    if (m_clipType != COLOR && m_clipType != VIRTUAL && m_clipType != UNKNOWN)
-        return KUrl(m_element.attribute("resource"));
+    if (m_clipType != COLOR && m_clipType != VIRTUAL && m_clipType != UNKNOWN && m_clipType != FOLDER)
+        return KUrl(m_clip->getProperty("resource"));
     else return KUrl();
 }
 
 void ProjectItem::changeDuration(int frames) {
-    m_element.setAttribute("duration", frames);
+    m_clip->setProperty("duration", QString::number(frames));
     m_duration = GenTime(frames, 25);
     setData(1, DurationRole, Timecode::getEasyTimecode(m_duration, 25));
     m_durationKnown = true;
@@ -191,7 +189,7 @@ void ProjectItem::slotSetToolTip() {
         break;
     case 4:
         tip.append(i18n("Color clip"));
-        setData(1, DurationRole, Timecode::getEasyTimecode(GenTime(m_element.attribute("out", "250").toInt(), 25), 25));
+        setData(1, DurationRole, Timecode::getEasyTimecode(GenTime(m_clip->getProperty("out").toInt(), 25), 25));
         break;
     case 5:
         tip.append(i18n("Image clip") + "</b><br />" + clipUrl().path());
@@ -218,7 +216,7 @@ void ProjectItem::slotSetToolTip() {
 
 void ProjectItem::setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata) {
     if (attributes.contains("duration")) {
-        if (m_clipType == AUDIO || m_clipType == VIDEO || m_clipType == AV) m_element.setAttribute("duration", attributes["duration"].toInt());
+        if (m_clipType == AUDIO || m_clipType == VIDEO || m_clipType == AV) m_clip->setProperty("duration", attributes["duration"]);
         m_duration = GenTime(attributes["duration"].toInt(), 25);
         setData(1, DurationRole, Timecode::getEasyTimecode(m_duration, 25));
         m_durationKnown = true;
@@ -249,14 +247,6 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con
         m_clip->setClipType(m_clipType);
     }
     slotSetToolTip();
-    if (m_element.isNull()) {
-        QDomDocument doc;
-        m_element = doc.createElement("producer");
-    }
-    if (m_element.attribute("duration") == QString::null) m_element.setAttribute("duration", attributes["duration"].toInt());
-    m_element.setAttribute("resource", attributes["filename"]);
-    m_element.setAttribute("type", (int) m_clipType);
-
     if (KdenliveSettings::audiothumbnails()) m_clip->slotRequestAudioThumbs();
 
     m_clip->setProperties(attributes);
index cffb513c225735489d443982ca57801664da5909..2b52c89d0a056a8dd892fee8c882db312d3dcf62 100644 (file)
@@ -57,7 +57,6 @@ public:
     void setProperties(QMap <QString, QString> props);
 
 private:
-    QDomElement m_element;
     GenTime m_duration;
     QString m_groupName;
     bool m_durationKnown;
index 33678dc94db2a50f3eeffd942d6b7b21483bd665..2da1928d5cd13e73f337b1b44e46b101cdb6e598 100644 (file)
 #include "projectlist.h"
 #include "projectitem.h"
 #include "kdenlivesettings.h"
+#include "slideshowclip.h"
 #include "ui_colorclip_ui.h"
 
+
 #include "definitions.h"
 #include "clipmanager.h"
 #include "docclipbase.h"
@@ -75,6 +77,9 @@ ProjectList::ProjectList(QWidget *parent)
     QAction *addColorClip = addMenu->addAction(KIcon("document-new"), i18n("Add Color Clip"));
     connect(addColorClip, SIGNAL(triggered()), this, SLOT(slotAddColorClip()));
 
+    QAction *addSlideClip = addMenu->addAction(KIcon("document-new"), i18n("Add Slideshow Clip"));
+    connect(addSlideClip, SIGNAL(triggered()), this, SLOT(slotAddSlideshowClip()));
+
     QAction *addTitleClip = addMenu->addAction(KIcon("document-new"), i18n("Add Title Clip"));
     connect(addTitleClip, SIGNAL(triggered()), this, SLOT(slotAddTitleClip()));
 
@@ -134,7 +139,10 @@ void ProjectList::slotClipSelected() {
 
 void ProjectList::slotUpdateClipProperties(int id, QMap <QString, QString> properties) {
     ProjectItem *item = getItemById(id);
-    if (item) slotUpdateClipProperties(item, properties);
+    if (item) {
+      slotUpdateClipProperties(item, properties);
+      if (properties.contains("colour")) slotRefreshClipThumbnail(item);
+  }
 }
 
 void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QString> properties) {
@@ -410,6 +418,31 @@ void ProjectList::slotAddColorClip() {
     delete dia;
 }
 
+
+void ProjectList::slotAddSlideshowClip() {
+    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! Â NO CMD STK";
+    SlideshowClip *dia = new SlideshowClip();
+
+    if (dia->exec() == QDialog::Accepted) {
+
+        QString group = QString();
+        int groupId = -1;
+        ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
+        if (item && item->clipType() != FOLDER) {
+            while (item->parent()) {
+                item = static_cast <ProjectItem*>(item->parent());
+                if (item->clipType() == FOLDER) break;
+            }
+        }
+        if (item && item->clipType() == FOLDER) {
+            group = item->groupName();
+            groupId = item->clipId();
+        }
+
+        m_doc->slotAddSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), group, groupId);
+    }
+    delete dia;
+}
 void ProjectList::slotAddTitleClip() {
     QString group = QString();
     int groupId = -1;
@@ -427,6 +460,7 @@ void ProjectList::slotAddTitleClip() {
 
     m_doc->slotCreateTextClip(group, groupId);
 }
+
 void ProjectList::setDocument(KdenliveDoc *doc) {
     listView->clear();
     QList <DocClipBase*> list = doc->clipManager()->documentClipList();
@@ -468,10 +502,15 @@ QDomElement ProjectList::producersList() {
 
 void ProjectList::slotRefreshClipThumbnail(int clipId) {
     ProjectItem *item = getItemById(clipId);
+    if (item) slotRefreshClipThumbnail(item);
+}
+
+void ProjectList::slotRefreshClipThumbnail(ProjectItem *item) {
     if (item) {
         int height = 40;
         int width = (int)(height  * (double) m_render->renderWidth() / m_render->renderHeight());
-        QPixmap pix = KThumb::getImage(item->clipUrl(), item->referencedClip()->getProjectThumbFrame(), width, height);
+        QPixmap pix = KThumb::getImage(item->toXml(), item->referencedClip()->getProjectThumbFrame(), width, height);
+       //QPixmap pix = KThumb::getFrame(item->toXml()), 0, width, height);
         item->setIcon(0, pix);
     }
 }
index 4bc08c82064224ce87a6e4f2e6f43dbe22bec3be..1c03bc62ff727fcfa0991717df509586d1495adf 100644 (file)
@@ -117,6 +117,7 @@ public slots:
     void slotDeleteClip(int clipId);
     void slotUpdateClip(int id);
     void slotRefreshClipThumbnail(int clipId);
+    void slotRefreshClipThumbnail(ProjectItem *item);
 
 
 private:
@@ -141,6 +142,7 @@ private slots:
     void slotRemoveClip();
     void slotClipSelected();
     void slotAddColorClip();
+    void slotAddSlideshowClip();
     void slotAddTitleClip();
     void slotContextMenu(const QPoint &pos, QTreeWidgetItem *);
     void slotAddFolder();
index 823b3b2fb698edabedc8fca12a2ba9c9d08d240b..5f161c2a9d1831d8eea100a06bb6d9a1ccafe6b3 100644 (file)
@@ -378,7 +378,7 @@ void Render::getFileProperties(const QDomElement &xml, int clipId) {
     QDomElement westley = doc.createElement("westley");
     doc.appendChild(westley);
     westley.appendChild(doc.importNode(xml, true));
-    kDebug() << "////////////\n" << doc.toString() << "////////////////\n";
+    //kDebug() << "////////////\n" << doc.toString() << "////////////////\n";
     char *tmp = decodedString(doc.toString());
 
     Mlt::Producer producer(*m_mltProfile, "westley-xml", tmp);
@@ -1065,6 +1065,12 @@ void Render::mltCutClip(int track, GenTime position) {
     m_isBlocked = false;
 }
 
+void Render::mltUpdateClip(int track, GenTime position, QDomElement element) {
+    // TODO: optimize
+    mltCutClip(track, position);
+    mltInsertClip(track, position, element);
+}
+
 
 void Render::mltRemoveClip(int track, GenTime position) {
     m_isBlocked = true;
index 82fde52851199f20051c6bd1190eb1d2d93cdfc3..173ed2165bb4ddd6d874fb00f2c7fab1fcf501d0 100644 (file)
@@ -147,6 +147,7 @@ Q_OBJECT public:
 
     /** Playlist manipulation */
     void mltInsertClip(int track, GenTime position, QDomElement element);
+    void mltUpdateClip(int track, GenTime position, QDomElement element);
     void mltCutClip(int track, GenTime position);
     void mltResizeClipEnd(int track, GenTime pos, GenTime in, GenTime out);
     void mltResizeClipStart(int track, GenTime pos, GenTime moveEnd, GenTime moveStart, GenTime in, GenTime out);
diff --git a/src/slideshowclip.cpp b/src/slideshowclip.cpp
new file mode 100644 (file)
index 0000000..80ecf22
--- /dev/null
@@ -0,0 +1,118 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+#include <QDir>
+
+#include <KStandardDirs>
+#include <KDebug>
+#include <KFileItem>
+
+#include "kdenlivesettings.h"
+#include "slideshowclip.h"
+
+#define TYPE_JPEG 0
+#define TYPE_PNG 1
+#define TYPE_BMP 2
+#define TYPE_GIF 3
+
+SlideshowClip::SlideshowClip(QWidget * parent): QDialog(parent), m_count(0) {
+    setFont(KGlobalSettings::toolBarFont());
+    //wsetCaption(i18n("Add Slideshow Clip"));
+    m_view.setupUi(this);
+    m_view.clip_name->setText(i18n("Slideshow Clip"));
+    m_view.folder_url->setMode(KFile::Directory);
+    m_view.icon_list->setIconSize(QSize(50, 50));
+    connect(m_view.folder_url, SIGNAL(textChanged(const QString &)), this, SLOT(parseFolder()));
+    connect(m_view.image_type, SIGNAL(currentIndexChanged ( int )), this, SLOT(parseFolder()));
+    m_view.image_type->addItem("JPG");
+    m_view.image_type->addItem("PNG");
+    m_view.image_type->addItem("BMP");
+    m_view.image_type->addItem("GIF");
+    m_view.clip_duration->setText("00:00:03:00");
+    adjustSize();
+}
+
+void SlideshowClip::parseFolder() {
+    m_view.icon_list->clear();
+    QDir dir(m_view.folder_url->url().path());
+    QStringList filters;
+    switch (m_view.image_type->currentIndex()) {
+       case TYPE_PNG:
+           filters << "*.png"; 
+           break;
+       case TYPE_BMP:
+           filters << "*.bmp"; 
+           break;
+       case TYPE_GIF:
+           filters << "*.gif"; 
+           break;
+       default:
+           filters << "*.jpg" << "*.jpeg";     
+           break;
+    }
+
+    dir.setNameFilters(filters);
+    QStringList result = dir.entryList(QDir::Files);
+    m_count = result.count();
+    m_view.label_info->setText(i18n("%1 images found", m_count));
+    foreach (QString path, result) {
+       QIcon icon(dir.filePath(path));
+       QListWidgetItem *item = new QListWidgetItem(icon, KUrl(path).fileName());
+       m_view.icon_list->addItem(item);
+    }
+}
+
+QString SlideshowClip::selectedPath() const {
+    QString extension;
+    switch (m_view.image_type->currentIndex()) {
+       case TYPE_PNG:
+           extension = "/.all.png";    
+           break;
+       case TYPE_BMP:
+           extension = "/.all.bmp";    
+           break;
+       case TYPE_GIF:
+           extension = "/.all.gif";    
+           break;
+       default:
+           extension = "/.all.jpg";    
+           break;
+    }
+    return m_view.folder_url->url().path() + extension;
+}
+
+
+QString SlideshowClip::clipName() const {
+    return m_view.clip_name->text();
+}
+
+QString SlideshowClip::clipDuration() const {
+    return m_view.clip_duration->text();
+}
+
+int SlideshowClip::imageCount() const {
+    return m_count;
+}
+
+bool SlideshowClip::loop() const {
+    return m_view.slide_loop->isChecked();
+}
+#include "slideshowclip.moc"
+
+
diff --git a/src/slideshowclip.h b/src/slideshowclip.h
new file mode 100644 (file)
index 0000000..eae190b
--- /dev/null
@@ -0,0 +1,53 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+
+#ifndef SLIDESHOWDIALOG_H
+#define SLIDESHOWDIALOG_H
+
+#include <QDialog>
+
+#include "definitions.h"
+#include "docclipbase.h"
+#include "timecode.h"
+#include "ui_slideshowclip_ui.h"
+
+class SlideshowClip : public QDialog {
+    Q_OBJECT
+
+public:
+    SlideshowClip(QWidget * parent = 0);
+    /** return selected path for slideshow in MLT format */
+    QString selectedPath() const;
+    QString clipName() const;
+    QString clipDuration() const;
+    int imageCount() const;
+    bool loop() const;
+
+private slots:
+    void parseFolder();
+
+private:
+    Ui::SlideshowClip_UI m_view;
+    int m_count;
+};
+
+
+#endif
+
index b57d2dcb5ee77f6b4fa5a815908f58598f066b1f..e69b4e064e9604e4b4bf4120ff29c9ffd8a08322 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>310</width>
-    <height>459</height>
+    <width>283</width>
+    <height>435</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <item row="6" column="0" colspan="4" >
     <widget class="QTabWidget" name="tabWidget" >
      <property name="currentIndex" >
-      <number>0</number>
+      <number>3</number>
      </property>
      <widget class="QWidget" name="tab_video" >
       <property name="geometry" >
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>290</width>
-        <height>171</height>
+        <width>263</width>
+        <height>159</height>
        </rect>
       </property>
       <attribute name="title" >
       </layout>
      </widget>
      <widget class="QWidget" name="tab_audio" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>263</width>
+        <height>159</height>
+       </rect>
+      </property>
       <attribute name="title" >
        <string>Audio</string>
       </attribute>
          </property>
         </widget>
        </item>
-       <item row="1" column="1" colspan="2" >
-        <widget class="KLineEdit" name="clip_channels" >
-         <property name="readOnly" >
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
        <item row="2" column="1" colspan="2" >
         <widget class="KLineEdit" name="clip_frequency" >
          <property name="readOnly" >
          </property>
         </spacer>
        </item>
+       <item row="1" column="1" colspan="2" >
+        <widget class="KLineEdit" name="clip_channels" >
+         <property name="readOnly" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
        <item row="0" column="0" >
         <widget class="QLabel" name="label_9" >
          <property name="text" >
         </widget>
        </item>
       </layout>
-      <zorder>ClipProperties_2</zorder>
       <zorder>clip_acodec</zorder>
       <zorder>clip_frequency</zorder>
       <zorder>verticalSpacer_3</zorder>
       <zorder>label_11</zorder>
       <zorder>label_10</zorder>
      </widget>
+     <widget class="QWidget" name="tab" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>263</width>
+        <height>159</height>
+       </rect>
+      </property>
+      <attribute name="title" >
+       <string>Color</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_5" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label_13" >
+         <property name="text" >
+          <string>Color</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" >
+        <widget class="KColorButton" name="clip_color" />
+       </item>
+       <item row="1" column="1" >
+        <spacer name="verticalSpacer_5" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>122</width>
+           <height>118</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2" >
+      <property name="geometry" >
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>263</width>
+        <height>159</height>
+       </rect>
+      </property>
+      <attribute name="title" >
+       <string>Slideshow</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_6" >
+       <item row="0" column="0" >
+        <widget class="QLabel" name="label_14" >
+         <property name="text" >
+          <string>Image type</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" >
+        <widget class="KComboBox" name="image_type" />
+       </item>
+       <item row="1" column="0" >
+        <widget class="QLabel" name="clip_filesize_4" >
+         <property name="text" >
+          <string>Frame duration</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1" >
+        <widget class="KRestrictedLine" name="slide_duration" >
+         <property name="inputMask" >
+          <string>99:99:99:99; </string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" >
+        <widget class="QCheckBox" name="slide_fade" >
+         <property name="text" >
+          <string>Crossfade</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0" >
+        <widget class="QCheckBox" name="slide_luma" >
+         <property name="text" >
+          <string>Luma file</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1" >
+        <widget class="KComboBox" name="luma_file" />
+       </item>
+       <item row="4" column="1" >
+        <spacer name="verticalSpacer_6" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>15</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="2" column="1" >
+        <widget class="QCheckBox" name="slide_loop" >
+         <property name="text" >
+          <string>Loop</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="tab_advanced" >
       <property name="geometry" >
        <rect>
         <x>0</x>
         <y>0</y>
         <width>263</width>
-        <height>171</height>
+        <height>159</height>
        </rect>
       </property>
       <attribute name="title" >
   </layout>
  </widget>
  <customwidgets>
+  <customwidget>
+   <class>KColorButton</class>
+   <extends>QPushButton</extends>
+   <header>kcolorbutton.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
   <customwidget>
    <class>KDoubleNumInput</class>
    <extends>QWidget</extends>
diff --git a/src/widgets/slideshowclip_ui.ui b/src/widgets/slideshowclip_ui.ui
new file mode 100644 (file)
index 0000000..0d94678
--- /dev/null
@@ -0,0 +1,168 @@
+<ui version="4.0" >
+ <class>SlideshowClip_UI</class>
+ <widget class="QDialog" name="SlideshowClip_UI" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>319</width>
+    <height>332</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" >
+    <widget class="QLabel" name="label_3" >
+     <property name="text" >
+      <string>Name</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" colspan="2" >
+    <widget class="KLineEdit" name="clip_name" />
+   </item>
+   <item row="3" column="0" >
+    <widget class="QLabel" name="label_2" >
+     <property name="text" >
+      <string>Frame Duration</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1" colspan="2" >
+    <widget class="KRestrictedLine" name="clip_duration" >
+     <property name="inputMask" >
+      <string>99:99:99:99; </string>
+     </property>
+    </widget>
+   </item>
+   <item row="9" column="0" colspan="3" >
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" colspan="2" >
+    <widget class="KUrlRequester" name="folder_url" />
+   </item>
+   <item row="1" column="0" >
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Folder</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1" colspan="2" >
+    <widget class="KComboBox" name="image_type" />
+   </item>
+   <item row="4" column="0" >
+    <widget class="QLabel" name="label_4" >
+     <property name="text" >
+      <string>Image Type</string>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0" colspan="3" >
+    <widget class="KListWidget" name="icon_list" />
+   </item>
+   <item row="8" column="0" >
+    <widget class="QLabel" name="label_info" >
+     <property name="text" >
+      <string>No image found</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="0" >
+    <widget class="QCheckBox" name="slide_fade" >
+     <property name="text" >
+      <string>Crossfade</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="0" >
+    <widget class="QCheckBox" name="luma_fade" >
+     <property name="text" >
+      <string>Luma File</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1" colspan="2" >
+    <widget class="KComboBox" name="luma_file" />
+   </item>
+   <item row="5" column="1" >
+    <widget class="QCheckBox" name="slide_loop" >
+     <property name="text" >
+      <string>Loop</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KListWidget</class>
+   <extends>QListWidget</extends>
+   <header>klistwidget.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KRestrictedLine</class>
+   <extends>KLineEdit</extends>
+   <header>krestrictedline.h</header>
+  </customwidget>
+  <customwidget>
+   <class>KUrlRequester</class>
+   <extends>QFrame</extends>
+   <header>kurlrequester.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>SlideshowClip_UI</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>SlideshowClip_UI</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>