]> git.sesse.net Git - kdenlive/commitdiff
Small fixes for composite transition and more fixes for title clips.
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 22 Sep 2008 12:23:11 +0000 (12:23 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 22 Sep 2008 12:23:11 +0000 (12:23 +0000)
svn path=/branches/KDE4/; revision=2401

20 files changed:
src/CMakeLists.txt
src/addclipcommand.h
src/customtrackview.cpp
src/docclipbase.cpp
src/editclipcommand.cpp [new file with mode: 0644]
src/editclipcommand.h [new file with mode: 0644]
src/geometryval.cpp
src/geometryval.h
src/graphicsscenerectmove.cpp
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/keyframehelper.cpp
src/mainwindow.cpp
src/projectitem.cpp
src/projectlist.cpp
src/titlewidget.cpp
src/transitionsettings.cpp
src/transitionsettings.h
src/widgets/transitionsettings_ui.ui
src/widgets/wipeval_ui.ui

index 089e60a619c45d539181666c9ed87953ee28aec5..a28ad5901b758abd874581f061d161b614b15019 100644 (file)
@@ -132,6 +132,7 @@ set(kdenlive_SRCS
   customtrackscene.cpp
   abstractgroupitem.cpp
   keyframehelper.cpp
+  editclipcommand.cpp
 )
 
 kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
index 7f75d8bd2ce2272a47717898d012c0636da260a2..109ce99b55289fc30ac1f3a03330ba647341ad04 100644 (file)
@@ -29,7 +29,7 @@ class KdenliveDoc;
 
 class AddClipCommand : public QUndoCommand {
 public:
-    AddClipCommand(KdenliveDoc *list, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent = 0);
+    AddClipCommand(KdenliveDoc *doc, const QDomElement &xml, const QString &id, bool doIt, QUndoCommand * parent = 0);
 
     virtual void undo();
     virtual void redo();
index 66838e1b7a9f1d1e830a6bf084f9a33be1c3d493..29a7e14ebe3d31093d4f21ee7de19d3d3f0d67f6 100644 (file)
@@ -1259,7 +1259,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
         } else if (m_dragItem->type() == TRANSITIONWIDGET) {
             MoveTransitionCommand *command = new MoveTransitionCommand(this, m_dragItemInfo, info, false);
             m_commandStack->push(command);
-            Transition *transition = (Transition *) m_dragItem;
+            Transition *transition = static_cast <Transition *>(m_dragItem);
             m_document->renderer()->mltMoveTransition(transition->transitionTag(), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), 0, m_dragItemInfo.startPos, m_dragItemInfo.endPos, info.startPos, info.endPos);
         }
 
@@ -1280,8 +1280,8 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
         } else if (m_dragItem->type() == TRANSITIONWIDGET) {
             MoveTransitionCommand *command = new MoveTransitionCommand(this, m_dragItemInfo, info, false);
             m_commandStack->push(command);
-            Transition *transition = (Transition *) m_dragItem;
-//             m_document->renderer()->mltMoveTransition(transition->transitionTag(), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), 0, m_dragItemInfo.startPos, m_dragItemInfo.endPos, info.startPos, info.endPos);
+            Transition *transition = static_cast <Transition *>(m_dragItem);
+            m_document->renderer()->mltMoveTransition(transition->transitionTag(), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), (int)(m_scene->m_tracksList.count() - m_dragItemInfo.track), 0, m_dragItemInfo.startPos, m_dragItemInfo.endPos, info.startPos, info.endPos);
         }
         //m_document->renderer()->doRefresh();
     } else if (m_operationMode == FADEIN) {
@@ -1347,7 +1347,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
         updateEffect(m_scene->m_tracksList.count() - item->track(), item->startPos(), item->selectedEffect(), item->selectedEffectIndex());
     }
 
-    emit transitionItemSelected((m_dragItem && m_dragItem->type() == TRANSITIONWIDGET) ? (Transition*) m_dragItem : NULL);
+    emit transitionItemSelected((m_dragItem && m_dragItem->type() == TRANSITIONWIDGET) ? static_cast <Transition *>(m_dragItem) : NULL);
     m_document->setModified(true);
     m_operationMode = NONE;
 }
index 3c6620ccd721f0a1c2814ce276e3a1773d14ae9e..18e900bdaf31ea8dcbacbf2bfa08b3e8d054e845 100644 (file)
@@ -43,7 +43,8 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
     }
     if (m_name.isEmpty()) m_name = url.fileName();
 
-    if (!url.isEmpty() && QFile::exists(url.path())) {
+    //if (!url.isEmpty() && QFile::exists(url.path()))
+    {
         m_thumbProd = new KThumb(clipManager, url);
         if (m_clipType == AV || m_clipType == AUDIO) slotCreateAudioTimer();
     }
@@ -450,6 +451,13 @@ void DocClipBase::setProperties(QMap <QString, QString> properties) {
         else if (i.key() == "out") setDuration(GenTime(i.value().toInt(), KdenliveSettings::project_fps()));
         else if (m_clipType == SLIDESHOW && keys.contains(i.key())) refreshProducer = true;
         else if (i.key() == "transparency") m_clipProducer->set("transparency", i.value().toInt());
+        else if (i.key() == "colour") {
+            char *tmp = (char *) qstrdup(i.value().toUtf8().data());
+            m_clipProducer->set("colour", tmp);
+            delete[] tmp;
+        } else if (i.key() == "xmldata") {
+            m_clipProducer->set("force_reload", 1);
+        }
     }
     if (refreshProducer) slotRefreshProducer();
 }
@@ -459,6 +467,13 @@ void DocClipBase::setProperty(QString key, QString value) {
     if (key == "resource") m_thumbProd->updateClipUrl(KUrl(value));
     else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
     else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
+    else if (key == "colour") {
+        char *tmp = (char *) qstrdup(value.toUtf8().data());
+        m_clipProducer->set("colour", tmp);
+        delete[] tmp;
+    } else if (key == "xmldata") {
+        m_clipProducer->set("force_reload", 1);
+    }
 }
 
 QMap <QString, QString> DocClipBase::properties() const {
diff --git a/src/editclipcommand.cpp b/src/editclipcommand.cpp
new file mode 100644 (file)
index 0000000..14ea52f
--- /dev/null
@@ -0,0 +1,41 @@
+/***************************************************************************
+ *   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 <KLocale>
+
+#include "editclipcommand.h"
+#include "projectlist.h"
+
+EditClipCommand::EditClipCommand(ProjectList *list, const QString &id, QMap <QString, QString> oldparams, QMap <QString, QString> newparams, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_list(list), m_id(id), m_oldparams(oldparams), m_newparams(newparams), m_doIt(doIt) {
+    setText(i18n("Edit clip"));
+}
+
+
+// virtual
+void EditClipCommand::undo() {
+    kDebug() << "----  undoing action";
+    m_list->slotUpdateClipProperties(m_id, m_oldparams);
+}
+// virtual
+void EditClipCommand::redo() {
+    kDebug() << "----  redoing action";
+    if (m_doIt) m_list->slotUpdateClipProperties(m_id, m_newparams);
+    m_doIt = true;
+}
+
diff --git a/src/editclipcommand.h b/src/editclipcommand.h
new file mode 100644 (file)
index 0000000..8821c7f
--- /dev/null
@@ -0,0 +1,46 @@
+/***************************************************************************
+ *   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 EDITCLIPCOMMAND_H
+#define EDITCLIPCOMMAND_H
+
+#include <QUndoCommand>
+#include <KDebug>
+#include <QDomElement>
+
+class ProjectList;
+
+class EditClipCommand : public QUndoCommand {
+public:
+    EditClipCommand(ProjectList *list, const QString &id, QMap <QString, QString> oldparams, QMap <QString, QString> newparams, bool doIt, QUndoCommand * parent = 0);
+
+    virtual void undo();
+    virtual void redo();
+
+private:
+    ProjectList *m_list;
+    QMap <QString, QString> m_oldparams;
+    QMap <QString, QString> m_newparams;
+    QString m_id;
+    bool m_doIt;
+};
+
+#endif
+
index 629ed7cb526710a9e38693146138dcf4b77eacaa..65ddfe564a51179d5fdf607c21f1671821dc125e 100644 (file)
@@ -30,7 +30,7 @@
 #include "geometryval.h"
 #include "kdenlivesettings.h"
 
-Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent): QWidget(parent), m_profile(profile) {
+Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent): QWidget(parent), m_profile(profile), m_geom(NULL), m_path(NULL), paramRect(NULL) {
     ui.setupUi(this);
     QVBoxLayout* vbox = new QVBoxLayout(ui.widget);
     QGraphicsView *view = new QGraphicsView(this);
@@ -96,13 +96,14 @@ Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent): QWidge
     //view->fitInView(m_frameBorder, Qt::KeepAspectRatio);
     const double sc = 100.0 / profile.height * 0.8;
     QRectF srect = view->sceneRect();
-    view->setSceneRect(srect.x(), -srect.height() / 2, srect.width(), srect.height() * 2);
+    view->setSceneRect(srect.x(), -srect.height() / 3, srect.width(), srect.height() + srect.height() / 3 * 2);
     scene->setZoom(sc);
     view->centerOn(m_frameBorder);
     connect(ui.buttonNext , SIGNAL(clicked()) , this , SLOT(slotNextFrame()));
     connect(ui.buttonPrevious , SIGNAL(clicked()) , this , SLOT(slotPreviousFrame()));
     connect(ui.buttonDelete , SIGNAL(clicked()) , this , SLOT(slotDeleteFrame()));
     connect(ui.buttonAdd , SIGNAL(clicked()) , this , SLOT(slotAddFrame()));
+    connect(scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateTransitionProperties()));
 }
 
 void Geometryval::slotAlignCenter() {
@@ -243,8 +244,8 @@ void Geometryval::slotSyncCursor() {
     KdenliveSettings::setTransitionfollowcursor(m_syncAction->isChecked());
 }
 
-void Geometryval::slotPositionChanged(int pos) {
-    if (KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos);
+void Geometryval::slotPositionChanged(int pos, bool seek) {
+    if (seek && KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos);
     ui.spinPos->setValue(pos);
     m_helper->setValue(pos);
     Mlt::GeometryItem item;
@@ -330,31 +331,34 @@ void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame)
     param = par;
     QString val = par.attribute("value");
     char *tmp = (char *) qstrdup(val.toUtf8().data());
-    m_geom = new Mlt::Geometry(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
+    if (m_geom) m_geom->parse(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
+    else m_geom = new Mlt::Geometry(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
     delete[] tmp;
-    kDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise();
+    //kDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise();
     //read param her and set rect
     m_helper->setKeyGeometry(m_geom, maxFrame - minFrame - 1);
-    QDomDocument doc;
+    m_helper->update();
+    /*QDomDocument doc;
     doc.appendChild(doc.importNode(par, true));
-    kDebug() << "IMPORTED TRANS: " << doc.toString();
+    kDebug() << "IMPORTED TRANS: " << doc.toString();*/
     ui.spinPos->setMaximum(maxFrame - minFrame - 1);
     Mlt::GeometryItem item;
-    m_path = new QGraphicsPathItem();
-    m_path->setPen(QPen(Qt::red));
+    if (m_path == NULL) {
+        m_path = new QGraphicsPathItem();
+        m_path->setPen(QPen(Qt::red));
+        scene->addItem(m_path);
+    }
     updateTransitionPath();
 
-    connect(scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateTransitionProperties()));
-
     m_geom->fetch(&item, 0);
+    if (paramRect) delete paramRect;
     paramRect = new QGraphicsRectItem(QRectF(0, 0, item.w(), item.h()));
     paramRect->setPos(item.x(), item.y());
     paramRect->setZValue(0);
 
     paramRect->setPen(QPen(QBrush(QColor(255, 0, 0, 255)), 1.0));
     scene->addItem(paramRect);
-    scene->addItem(m_path);
-    slotPositionChanged(0);
+    slotPositionChanged(0, false);
     connect(ui.spinPos, SIGNAL(valueChanged(int)), this , SLOT(slotPositionChanged(int)));
     connect(ui.spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
 }
index bc379fe2dc065f9e0afe603cc06748592dfa2dd8..27b8c46dac6a9b674a032afc226acb756bcce307 100644 (file)
@@ -63,7 +63,7 @@ public slots:
 private slots:
     void slotNextFrame();
     void slotPreviousFrame();
-    void slotPositionChanged(int pos);
+    void slotPositionChanged(int pos, bool seek = true);
     void slotDeleteFrame();
     void slotAddFrame();
     void slotUpdateTransitionProperties();
index 147f34018039c553fcd840f496d449745149bac6..d972c9cf44a3ef757a628bf3b584832f520f50cd 100644 (file)
@@ -14,7 +14,7 @@
 GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent): QGraphicsScene(parent), m_selectedItem(NULL), resizeMode(NoResize), m_tool(TITLE_RECTANGLE) {
     //grabMouse();
     zoom = 1.0;
-    setBackgroundBrush(QBrush(Qt::black));
+    setBackgroundBrush(QBrush(Qt::transparent));
 }
 
 void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item) {
@@ -83,6 +83,7 @@ void GraphicsSceneRectMove::keyPressEvent(QKeyEvent * keyEvent) {
     default:
         QGraphicsScene::keyPressEvent(keyEvent);
     }
+    emit actionFinished();
 }
 
 //virtual
index 35d42124705d04e3eaaf015aa1d41be213799ec6..6f7332a8388514550aef29ba6d1fcf017362be5c 100644 (file)
@@ -721,12 +721,6 @@ void KdenliveDoc::slotAddClipFile(const KUrl url, const QString group, const QSt
     setModified(true);
 }
 
-void KdenliveDoc::slotAddTextClipFile(const QString path, const QString xml, const QString group, const QString &groupId) {
-    kDebug() << "/////////  DOCUM, ADD TXT CLP: " << path;
-    m_clipManager->slotAddTextClipFile(path, xml, group, groupId);
-    setModified(true);
-}
-
 void KdenliveDoc::slotAddFolder(const QString folderName) {
     AddFolderCommand *command = new AddFolderCommand(this, folderName, QString::number(m_clipManager->getFreeClipId()), true);
     commandStack()->push(command);
@@ -778,27 +772,12 @@ void KdenliveDoc::slotCreateTextClip(QString group, const QString &groupId) {
         QPixmap pix = dia_ui->renderedPixmap();
         pix.save(path + ".png");
         //dia_ui->saveTitle(path + ".kdenlivetitle");
-        slotAddTextClipFile(path, dia_ui->xml().toString(), QString(), QString());
+        m_clipManager->slotAddTextClipFile(path, dia_ui->xml().toString(), QString(), QString());
+        setModified(true);
     }
     delete dia_ui;
 }
 
-void KdenliveDoc::editTextClip(QString path, const QString &id) {
-    DocClipBase *clip = m_clipManager->getClipById(id);
-    if (!clip) return;
-    TitleWidget *dia_ui = new TitleWidget(KUrl()/*path + ".kdenlivetitle")*/, path, m_render, kapp->activeWindow());
-    QDomDocument doc;
-    doc.setContent(clip->getProperty("xmldata"));
-    dia_ui->setXml(doc);
-    if (dia_ui->exec() == QDialog::Accepted) {
-        QPixmap pix = dia_ui->renderedPixmap();
-        pix.save(path + ".png");
-        //dia_ui->saveTitle(path + ".kdenlivetitle");
-        //slotAddClipFile(KUrl("/tmp/kdenlivetitle.png"), QString(), -1);
-        emit refreshClipThumbnail(id);
-    }
-    delete dia_ui;
-}
 
 
 #include "kdenlivedoc.moc"
index 1f3daa1ff6622950cd0dc0679e2a7354116e9953..bf15ba55b83a9fd0d9c374545e8cb00a8c878c1f 100644 (file)
@@ -70,8 +70,6 @@ Q_OBJECT public:
     void deleteFolder(const QString foldername, const QString &clipId);
     void slotAddClipFile(const KUrl url, const QString group, const QString &groupId = QString());
     void slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId = QString());
-    void slotAddTextClipFile(const QString path, const QString xml, const QString group, const QString &groupId = QString());
-    void editTextClip(QString path, const QString &id);
     void slotAddFolder(const QString folderName);
     void slotDeleteFolder(const QString folderName, const QString &id);
     void slotEditFolder(const QString folderName, const QString oldfolderName, const QString &clipId);
@@ -150,7 +148,6 @@ signals:
     void progressInfo(const QString &, int);
     /** emited when the document state has been modified (= needs saving or not) */
     void docModified(bool);
-    void refreshClipThumbnail(const QString &);
     void selectLastAddedClip(const QString &);
 };
 
index c46928a7facf46ac6c351344f56c6b0fb4ac7926..6d74ce805471535ab1feef819d697d89be12ff5d 100644 (file)
@@ -72,21 +72,24 @@ void KeyframeHelper::paintEvent(QPaintEvent *e) {
     m_scale = (double) width() / m_length;
     if (m_geom != NULL) {
         int pos = 0;
-        p.setBrush(QColor(255, 20, 20));
+        p.setPen(QColor(255, 20, 20));
         Mlt::GeometryItem item;
         while (true) {
             if (m_geom->next_key(&item, pos) == 1) break;
             pos = item.frame();
             int scaledPos = pos * m_scale;
-            p.drawLine(scaledPos, clipRect.y() , scaledPos, clipRect.bottom());
+            p.drawLine(scaledPos, 0, scaledPos, 10);
             //p.fillRect(QRect(scaledPos - 1, 0, 2, 15), QBrush(QColor(255, 20, 20)));
             pos++;
         }
     }
+    p.setPen(palette().dark().color());
+    p.drawLine(clipRect.x(), 5, clipRect.right(), 5);
+
     // draw pointer
     QPolygon pa(3);
     const int cursor = m_position * m_scale;
-    pa.setPoints(3, cursor - 5, 14, cursor + 5, 14, cursor/*+0*/, 9);
+    pa.setPoints(3, cursor - 5, 11, cursor + 5, 11, cursor/*+0*/, 6);
     p.setBrush(palette().dark().color());
     p.drawPolygon(pa);
 
index ca97c25dd4eab7693010f1b6520d9f0c67cd251d..630503560052007631d35c305782a349d062c86f 100644 (file)
@@ -76,6 +76,8 @@
 #include "jogshuttle.h"
 #include "clipproperties.h"
 #include "wizard.h"
+#include "editclipcommand.h"
+#include "titlewidget.h"
 
 static const int ID_STATUS_MSG = 1;
 static const int ID_EDITMODE_MSG = 2;
@@ -1095,7 +1097,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
             disconnect(m_activeDocument, SIGNAL(addProjectFolder(const QString, const QString &, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, const QString &, bool, bool)));
             disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
             disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
-            disconnect(m_activeDocument, SIGNAL(refreshClipThumbnail(const QString &)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &)));
             disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
             disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &)));
             disconnect(m_activeTimeline, SIGNAL(clipItemSelected(ClipItem*)), effectStack, SLOT(slotClipItemSelected(ClipItem*)));
@@ -1137,7 +1138,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
     connect(doc, SIGNAL(addProjectFolder(const QString, const QString &, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, const QString &, bool, bool)));
     connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
     connect(doc, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
-    connect(doc, SIGNAL(refreshClipThumbnail(const QString &)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &)));
     connect(doc, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
 
     connect(doc, SIGNAL(deleteTimelineClip(const QString &)), trackView, SLOT(slotDeleteClip(const QString &)));
@@ -1370,13 +1370,35 @@ void MainWindow::slotGotProgressInfo(const QString &message, int progress) {
 
 void MainWindow::slotShowClipProperties(DocClipBase *clip) {
     if (clip->clipType() == TEXT) {
-        m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
+        QString path = clip->getProperty("xml");
+        TitleWidget *dia_ui = new TitleWidget(KUrl()/*path + ".kdenlivetitle")*/, path, m_projectMonitor->render, this);
+        QDomDocument doc;
+        doc.setContent(clip->getProperty("xmldata"));
+        dia_ui->setXml(doc);
+        if (dia_ui->exec() == QDialog::Accepted) {
+            kDebug() << "//  UPDATUING CLIP TITLE: " << path;
+            QPixmap pix = dia_ui->renderedPixmap();
+            pix.save(path + ".png");
+            //slotAddClipFile(KUrl("/tmp/kdenlivetitle.png"), QString(), -1);
+            //m_clipManager->slotEditTextClipFile(id, dia_ui->xml().toString());
+            QMap <QString, QString> newprops;
+            newprops.insert("xmldata", dia_ui->xml().toString());
+            EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
+            m_activeDocument->commandStack()->push(command);
+            //setModified(true);
+        }
+        delete dia_ui;
+
+        //m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
         return;
     }
     ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
     connect(&dia, SIGNAL(addMarker(const QString &, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, GenTime, QString)));
     if (dia.exec() == QDialog::Accepted) {
-        m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
+        EditClipCommand *command = new EditClipCommand(m_projectList, dia.clipId(), clip->properties(), dia.properties(), true);
+        m_activeDocument->commandStack()->push(command);
+
+        //m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
         if (dia.needsTimelineRefresh()) {
             // update clip occurences in timeline
             m_activeTimeline->projectView()->slotUpdateClip(dia.clipId());
index 4f3e2a913e3cadafb8fbd4d24ca443226bbddb8c..ffe030e5bb6dd8c7e595d245bcd17bb475132932 100644 (file)
@@ -208,7 +208,7 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con
         m_clip->setClipType(m_clipType);
     }
     slotSetToolTip();
-    if (KdenliveSettings::audiothumbnails()) m_clip->slotRequestAudioThumbs();
+    if ((m_clipType == AV || m_clipType == AUDIO) && KdenliveSettings::audiothumbnails()) m_clip->slotRequestAudioThumbs();
 
     m_clip->setProperties(attributes);
     /*
index 95152d9222c626c7ca70d0d1dcc1dd11b3def42f..4e0a2397a40c220c70df7ca631d9b036394787ad 100644 (file)
@@ -151,7 +151,7 @@ void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QSt
     ProjectItem *item = getItemById(id);
     if (item) {
         slotUpdateClipProperties(item, properties);
-        if (properties.contains("colour") || properties.contains("resource")) slotRefreshClipThumbnail(item);
+        if (properties.contains("colour") || properties.contains("resource") || properties.contains("xmldata")) slotRefreshClipThumbnail(item);
         if (properties.contains("out")) item->changeDuration(properties.value("out").toInt());
     }
 }
@@ -459,6 +459,7 @@ void ProjectList::slotRefreshClipThumbnail(const QString &clipId) {
 
 void ProjectList::slotRefreshClipThumbnail(ProjectItem *item) {
     if (item) {
+        kDebug() << " / / / /PROJECT LIST, REFRESH THMB";
         int height = 50;
         int width = (int)(height  * m_render->dar());
         QPixmap pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
index 903dc8f0971259ed9883b0d3a09002e515b42619..19cc14c96d0011f7d9f509d8e05ccd247d66504f 100644 (file)
@@ -137,9 +137,9 @@ TitleWidget::TitleWidget(KUrl url, QString projectPath, Render *render, QWidget
     m_titledocument.setScene(m_scene);
 
     // a gradient background
-    QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
+    /*QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
     gradient->setSpread(QGradient::ReflectSpread);
-    //scene->setBackgroundBrush(*gradient);
+    scene->setBackgroundBrush(*gradient);*/
 
     m_frameImage = new QGraphicsPixmapItem();
     QTransform qtrans;
@@ -165,14 +165,14 @@ TitleWidget::TitleWidget(KUrl url, QString projectPath, Render *render, QWidget
     m_frameBorder = new QGraphicsRectItem(QRectF(0, 0, m_frameWidth, m_frameHeight));
     m_frameBorder->setPen(framepen);
     m_frameBorder->setZValue(-1100);
-    m_frameBorder->setBrush(QColor(0, 0, 0, 0));
+    m_frameBorder->setBrush(Qt::transparent);
     m_frameBorder->setFlags(QGraphicsItem::ItemClipsToShape);
     graphicsView->scene()->addItem(m_frameBorder);
 
     initViewports();
 
     graphicsView->show();
-    graphicsView->setRenderHint(QPainter::Antialiasing);
+    //graphicsView->setRenderHint(QPainter::Antialiasing);
     graphicsView->setInteractive(true);
     QTimer::singleShot(500, this, SLOT(slotAdjustZoom()));
     //graphicsView->resize(400, 300);
@@ -630,7 +630,7 @@ QPixmap TitleWidget::renderedPixmap() {
     QPixmap pix(m_frameWidth, m_frameHeight);
     pix.fill(Qt::transparent);
     QPainter painter(&pix);
-    //painter.setRenderHint( QPainter::Antialiasing );
+    painter.setRenderHint(QPainter::Antialiasing);
     m_scene->clearSelection();
     QPen framepen = m_frameBorder->pen();
     m_frameBorder->setPen(Qt::NoPen);
index bf32b94a25b5c4fe74bea21dd75427f808b5bbde..c9cc9d069a8c4ba4310cc49fe4a7f83682162097 100644 (file)
@@ -30,10 +30,10 @@ TransitionSettings::TransitionSettings(QWidget* parent): QWidget(parent) {
     effectEdit = new EffectStackEdit(ui.frame, this);
     connect(effectEdit, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
     setEnabled(false);
-    ui.listWidget->addItems(MainWindow::transitions.effectNames());
-    kDebug() << MainWindow::transitions.effectNames().size();
-    ui.listWidget->setCurrentRow(0);
-    connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(slotTransitionChanged()));
+    ui.transitionList->addItems(MainWindow::transitions.effectNames());
+    //kDebug() << MainWindow::transitions.effectNames().size();
+    //ui.listWidget->setCurrentRow(0);
+    connect(ui.transitionList, SIGNAL(activated(int)), this, SLOT(slotTransitionChanged()));
     connect(this, SIGNAL(transferParamDesc(const QDomElement&, int , int)), effectEdit , SLOT(transferParamDesc(const QDomElement&, int , int)));
     connect(effectEdit, SIGNAL(parameterChanged(const QDomElement&, const QDomElement&)), this , SLOT(slotUpdateEffectParams(const QDomElement&, const QDomElement&)));
     ui.splitter->setStretchFactor(0, 1);
@@ -48,7 +48,7 @@ void TransitionSettings::updateProjectFormat(MltVideoProfile profile) {
 void TransitionSettings::slotTransitionChanged(bool reinit) {
     QDomElement e = m_usedTransition->toXML().cloneNode().toElement();
     if (reinit) {
-        QDomElement newTransition = MainWindow::transitions.getEffectByName(ui.listWidget->currentItem()->text());
+        QDomElement newTransition = MainWindow::transitions.getEffectByName(ui.transitionList->currentText());
         slotUpdateEffectParams(e, newTransition);
         emit transferParamDesc(newTransition, m_usedTransition->startPos().frames(KdenliveSettings::project_fps()), m_usedTransition->endPos().frames(KdenliveSettings::project_fps()));
     } else {
@@ -60,16 +60,23 @@ void TransitionSettings::slotTransitionChanged(bool reinit) {
 void TransitionSettings::slotTransitionItemSelected(Transition* t) {
     setEnabled(t != NULL);
     if (t == m_usedTransition) {
+        if (t && (t->duration() != m_transitionDuration || t->startPos() != m_transitionStart)) {
+            m_transitionDuration = t->duration();
+            m_transitionStart = t->startPos();
+            slotTransitionChanged(false);
+        }
         return;
     }
     m_usedTransition = t;
     if (m_usedTransition) {
-        QList<QListWidgetItem*> list = ui.listWidget->findItems(m_usedTransition->transitionName(), Qt::MatchExactly);
-        if (list.size() > 0) {
-            ui.listWidget->blockSignals(true);
-            ui.listWidget->setCurrentItem(list[0]);
+        m_transitionDuration = t->duration();
+        m_transitionStart = t->startPos();
+        int ix = ui.transitionList->findText(m_usedTransition->transitionName(), Qt::MatchExactly);
+        if (ix != -1) {
+            ui.transitionList->blockSignals(true);
+            ui.transitionList->setCurrentIndex(ix);
             slotTransitionChanged(false);
-            ui.listWidget->blockSignals(false);
+            ui.transitionList->blockSignals(false);
         }
     }
 
index 2d7bf2bc18f691d0bf47ed86185b6f9985bcbf50..a8404ef3922a079a4dd73ce82d0e962f5c886f64 100644 (file)
@@ -37,6 +37,8 @@ private:
     Ui::TransitionSettings_UI ui;
     EffectStackEdit *effectEdit;
     Transition* m_usedTransition;
+    GenTime m_transitionDuration;
+    GenTime m_transitionStart;
 
 public slots:
     void slotTransitionItemSelected(Transition*);
index 9b36f04e5a44d4301ed2561b84baab4699bbd2ab..944d556180e60c0460fd4b979ab931ac985712c2 100644 (file)
   </property>
   <layout class="QGridLayout" name="gridLayout" >
    <item row="0" column="0" >
+    <widget class="QLabel" name="label" >
+     <property name="text" >
+      <string>Transition type</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="2" >
     <widget class="QSplitter" name="splitter" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
-     <widget class="QListWidget" name="listWidget" />
      <widget class="QFrame" name="frame" >
       <property name="sizePolicy" >
        <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
      </widget>
     </widget>
    </item>
+   <item row="0" column="1" >
+    <widget class="KComboBox" name="transitionList" />
+   </item>
   </layout>
+  <zorder>splitter</zorder>
+  <zorder>label</zorder>
+  <zorder>transitionList</zorder>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
+ </customwidgets>
  <resources/>
  <connections/>
 </ui>
index 7ba6886c4d29a6620c946f0d64fb21ebd6c817f2..a22a0736ec8d32b9c3b03c3c2b042380037c7a59 100644 (file)
@@ -5,47 +5,24 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>193</width>
-    <height>302</height>
+    <width>287</width>
+    <height>191</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
   <layout class="QGridLayout" name="gridLayout_5" >
-   <property name="margin" >
-    <number>0</number>
-   </property>
-   <item row="1" column="0" >
-    <widget class="QGroupBox" name="groupBox_2" >
+   <item row="0" column="0" >
+    <widget class="QGroupBox" name="groupBox" >
      <property name="title" >
       <string/>
      </property>
-     <layout class="QGridLayout" name="gridLayout_3" >
-      <item row="2" column="1" colspan="2" >
-       <widget class="QSlider" name="end_transp" >
-        <property name="maximum" >
-         <number>100</number>
-        </property>
-        <property name="value" >
-         <number>100</number>
-        </property>
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0" >
-       <widget class="QLabel" name="label_2" >
-        <property name="text" >
-         <string>Transparency</string>
-        </property>
-       </widget>
-      </item>
+     <layout class="QGridLayout" name="gridLayout_2" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_4" >
+       <widget class="QLabel" name="label_3" >
         <property name="text" >
-         <string>End</string>
+         <string>Start</string>
         </property>
         <property name="alignment" >
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
        </widget>
       </item>
       <item row="0" column="1" >
-       <layout class="QGridLayout" name="gridLayout_4" >
+       <layout class="QGridLayout" name="gridLayout" >
         <property name="spacing" >
          <number>0</number>
         </property>
         <item row="0" column="1" >
-         <widget class="QPushButton" name="end_up" >
+         <widget class="QPushButton" name="start_up" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
@@ -77,7 +54,7 @@
          </widget>
         </item>
         <item row="1" column="0" >
-         <widget class="QPushButton" name="end_left" >
+         <widget class="QPushButton" name="start_left" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
@@ -96,7 +73,7 @@
          </widget>
         </item>
         <item row="1" column="1" >
-         <widget class="QPushButton" name="end_center" >
+         <widget class="QPushButton" name="start_center" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="1" column="2" >
-         <widget class="QPushButton" name="end_right" >
+         <widget class="QPushButton" name="start_right" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="2" column="1" >
-         <widget class="QPushButton" name="end_down" >
+         <widget class="QPushButton" name="start_down" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
         </item>
        </layout>
       </item>
+      <item row="1" column="0" colspan="2" >
+       <layout class="QHBoxLayout" name="horizontalLayout" >
+        <item>
+         <widget class="QLabel" name="label" >
+          <property name="text" >
+           <string>Transparency</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSlider" name="start_transp" >
+          <property name="maximum" >
+           <number>100</number>
+          </property>
+          <property name="value" >
+           <number>100</number>
+          </property>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
      </layout>
     </widget>
    </item>
-   <item row="2" column="0" >
-    <spacer name="verticalSpacer" >
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>20</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="0" >
-    <widget class="QGroupBox" name="groupBox" >
+   <item row="0" column="1" >
+    <widget class="QGroupBox" name="groupBox_2" >
      <property name="title" >
       <string/>
      </property>
-     <layout class="QGridLayout" name="gridLayout_2" >
-      <item row="2" column="3" colspan="2" >
-       <widget class="QSlider" name="start_transp" >
-        <property name="maximum" >
-         <number>100</number>
-        </property>
-        <property name="value" >
-         <number>100</number>
-        </property>
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="2" >
-       <widget class="QLabel" name="label" >
-        <property name="text" >
-         <string>Transparency</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2" >
-       <widget class="QLabel" name="label_3" >
+     <layout class="QGridLayout" name="gridLayout_3" >
+      <item row="0" column="0" >
+       <widget class="QLabel" name="label_4" >
         <property name="text" >
-         <string>Start</string>
+         <string>End</string>
         </property>
         <property name="alignment" >
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
         </property>
        </widget>
       </item>
-      <item row="0" column="3" >
-       <layout class="QGridLayout" name="gridLayout" >
+      <item row="0" column="1" >
+       <layout class="QGridLayout" name="gridLayout_4" >
         <property name="spacing" >
          <number>0</number>
         </property>
         <item row="0" column="1" >
-         <widget class="QPushButton" name="start_up" >
+         <widget class="QPushButton" name="end_up" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="1" column="0" >
-         <widget class="QPushButton" name="start_left" >
+         <widget class="QPushButton" name="end_left" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="1" column="1" >
-         <widget class="QPushButton" name="start_center" >
+         <widget class="QPushButton" name="end_center" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="1" column="2" >
-         <widget class="QPushButton" name="start_right" >
+         <widget class="QPushButton" name="end_right" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
          </widget>
         </item>
         <item row="2" column="1" >
-         <widget class="QPushButton" name="start_down" >
+         <widget class="QPushButton" name="end_down" >
           <property name="maximumSize" >
            <size>
             <width>30</width>
         </item>
        </layout>
       </item>
+      <item row="1" column="0" colspan="2" >
+       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+        <item>
+         <widget class="QLabel" name="label_2" >
+          <property name="text" >
+           <string>Transparency</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSlider" name="end_transp" >
+          <property name="maximum" >
+           <number>100</number>
+          </property>
+          <property name="value" >
+           <number>100</number>
+          </property>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
      </layout>
     </widget>
    </item>
+   <item row="1" column="0" colspan="2" >
+    <spacer name="verticalSpacer" >
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>20</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>