]> git.sesse.net Git - kdenlive/commitdiff
Don't allow clip moving over another one
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 5 Sep 2008 19:27:25 +0000 (19:27 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 5 Sep 2008 19:27:25 +0000 (19:27 +0000)
Add timecode overlay to export options
Add menus for insert/delete track (does not work yet)

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

20 files changed:
data/CMakeLists.txt
data/metadata.properties [new file with mode: 0644]
renderer/kdenlive_render.cpp
renderer/renderjob.cpp
renderer/renderjob.h
src/clipitem.cpp
src/customruler.cpp
src/customtrackview.cpp
src/customtrackview.h
src/effectslistview.cpp
src/effectstackview.cpp
src/headertrack.cpp
src/headertrack.h
src/initeffects.cpp
src/mainwindow.cpp
src/mainwindow.h
src/renderwidget.cpp
src/renderwidget.h
src/trackview.cpp
src/widgets/renderwidget_ui.ui

index 2e844e430d85464cdfd74065028cbdf9c77ba7db..963b7c5228d9eac0c5a2c2a24ec76b81146a714e 100644 (file)
@@ -1 +1 @@
-install(FILES banner.png timeline_nothumbs.png timeline_athumbs.png timeline_vthumbs.png timeline_avthumbs.png transition.png DESTINATION ${DATA_INSTALL_DIR}/kdenlive )
+install(FILES banner.png timeline_nothumbs.png timeline_athumbs.png timeline_vthumbs.png timeline_avthumbs.png transition.png metadata.properties DESTINATION ${DATA_INSTALL_DIR}/kdenlive )
diff --git a/data/metadata.properties b/data/metadata.properties
new file mode 100644 (file)
index 0000000..903f185
--- /dev/null
@@ -0,0 +1,54 @@
+# This properties file describes the fx available to the data_feed and 
+# data_show filters
+#
+# Syntax is as follows:
+#
+#      name=<filter>
+#      name.description=<user defined>
+#      name.properties.<variable>=<full-property>
+#      name.<property>=value
+#      etc
+#
+# Typically, the <filter> is a 'region' and additional filters are 
+# included as properties using the normal region filter syntax.
+#
+
+timecode=region
+.description=TimecodeOSD
+.properties.markup=filter[1].producer.text
+.properties.font=filter[1].producer.font
+.properties.size=filter[1].producer.size
+.properties.length[0]=filter[1].composite.out
+.composite.geometry=0,0:200x40
+.filter[0]=watermark
+.filter[0].resource=colour:0x66333388
+.filter[0].composite.titles=1
+.filter[1]=watermark
+.filter[1].resource=pango:
+.filter[1].producer.text=
+.filter[1].producer.font=Bitstream
+.filter[1].producer.size=30
+.filter[1].producer.weight=700
+.filter[1].composite.titles=1
+.filter[1].composite.halign=centre
+.filter[1].composite.valign=centre
+
+osdvolume=region
+.description=VolumeOSD
+.properties.markup=filter[1].producer.text
+.properties.font=filter[1].producer.font
+.properties.size=filter[1].producer.size
+.properties.length[0]=filter[1].composite.out
+.composite.geometry=200,200:250x90
+.filter[0]=watermark
+.filter[0].resource=colour:0x00000099
+.filter[0].composite.titles=1
+.filter[1]=watermark
+.filter[1].resource=pango:
+.filter[1].producer.text=
+.filter[1].producer.font=Bitstream
+.filter[1].producer.size=26
+.filter[1].producer.weight=700
+.filter[1].composite.titles=1
+.filter[1].composite.halign=centre
+.filter[1].composite.valign=centre
index 67a5088ce9c3533c8900710fc7d89deeb6adb918..1c3e3baa406d433812817f86eec3675c12b4b3bf 100644 (file)
@@ -27,6 +27,7 @@
 int main(int argc, char **argv) {
     QCoreApplication app(argc, argv);
     QStringList args = app.arguments();
+    QStringList preargs;
     int in = -1;
     int out = -1;
     if (!args.isEmpty()) args.takeFirst();
@@ -44,6 +45,11 @@ int main(int argc, char **argv) {
             out = args.at(0).section('=', -1).toInt();
             args.takeFirst();
         }
+        if (args.at(0).startsWith("preargs=")) {
+            QString a = args.at(0).section('=', 1);
+           preargs = a.split(" ", QString::SkipEmptyParts);
+            args.takeFirst();
+        }
         QString render = args.at(0);
         args.takeFirst();
         QString profile = args.at(0);
@@ -56,7 +62,7 @@ int main(int argc, char **argv) {
         args.takeFirst();
         QString dest = args.at(0);
         args.takeFirst();
-        RenderJob *job = new RenderJob(erase, render, profile, rendermodule, player, src, dest, args, in, out);
+        RenderJob *job = new RenderJob(erase, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
         job->start();
         app.exec();
     } else {
index df71e590eb360ae09880b3e0d29b4ac652ce321a..d7964701e6c481b352993177447459fec5f99793 100644 (file)
@@ -25,7 +25,7 @@
 
 static QDBusConnection connection(QLatin1String(""));
 
-RenderJob::RenderJob(bool erase, QString renderer, QString profile, QString rendermodule, QString player, QString scenelist, QString dest, QStringList args, int in, int out) : QObject(), m_jobUiserver(NULL) {
+RenderJob::RenderJob(bool erase, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in, int out) : QObject(), m_jobUiserver(NULL) {
     m_scenelist = scenelist;
     m_dest = dest;
     m_player = player;
@@ -36,6 +36,8 @@ RenderJob::RenderJob(bool erase, QString renderer, QString profile, QString rend
     m_args << scenelist;
     if (in != -1) m_args << "in=" + QString::number(in);
     if (out != -1) m_args << "out=" + QString::number(out);
+    m_args << preargs;
+    //qDebug()<<"PRE ARGS: "<<preargs;
     m_args << "-profile" << profile;
     m_args << "-consumer" << rendermodule + ":" + m_dest << "progress=1" << args;
     connect(m_renderProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotIsOver(int, QProcess::ExitStatus)));
index bfccb5e916a38ada929ec33375fffc93a968b7e3..3fd75476888495aca21487866f971939906e5b31 100644 (file)
@@ -28,7 +28,7 @@
 class RenderJob : public QObject {
     Q_OBJECT
 public:
-    RenderJob(bool erase, QString renderer, QString profile, QString rendermodule, QString player, QString scenelist, QString dest, QStringList args, int in = -1, int out = -1);
+    RenderJob(bool erase, const QString &renderer, const QString &profile, const QString &rendermodule, const QString &player, const QString &scenelist, const QString &dest, const QStringList &preargs, const QStringList &args, int in = -1, int out = -1);
     ~RenderJob();
     void start();
 
index b7fbfbdba19e8ba7cf42bc33c76fd57bb205cb3c..dce5bed7c037f185f0101b986776fe151dfe5c7c 100644 (file)
@@ -949,11 +949,27 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
                     if (pos().x() < otherPos.x()) {
                         // move clip just before colliding clip
                         int npos = (static_cast < AbstractClipItem* >(items.at(i))->startPos() - m_cropDuration).frames(m_fps);
+                        // check we don't run into another clip
                         newPos.setX(npos);
+                        sceneShape = rect();
+                        sceneShape.translate(newPos);
+                        QList<QGraphicsItem*> subitems = scene()->items(sceneShape, Qt::IntersectsItemShape);
+                        items.removeAll(this);
+                        for (int j = 0; j < subitems.count(); i++) {
+                            if (subitems.at(j)->type() == type()) return pos();
+                        }
                     } else {
                         // get pos just after colliding clip
                         int npos = static_cast < AbstractClipItem* >(items.at(i))->endPos().frames(m_fps);
+                        // check we don't run into another clip
                         newPos.setX(npos);
+                        sceneShape = rect();
+                        sceneShape.translate(newPos);
+                        QList<QGraphicsItem*> subitems = scene()->items(sceneShape, Qt::IntersectsItemShape);
+                        items.removeAll(this);
+                        for (int j = 0; j < subitems.count(); i++) {
+                            if (subitems.at(j)->type() == type()) return pos();
+                        }
                     }
                     m_track = newTrack;
                     m_startPos = GenTime((int) newPos.x(), m_fps);
index 3ea21a4d2d8eb3464a6e44887f5da5e861486e96..c5031c065ac2d99d405aede3435e58eb165078bb 100644 (file)
@@ -107,6 +107,7 @@ void CustomRuler::mouseMoveEvent(QMouseEvent * event) {
             m_zoneStart += move;
             m_zoneEnd += move;
         }
+        m_view->setDocumentModified();
         update();
     } else {
         int pos = (int)((event->x() + offset()));
index a70c3c8cd49a67138a6c6b9ca106c9f3646596dc..18e8e241ad8d739796f7dc00d43be6e845533518 100644 (file)
@@ -72,7 +72,7 @@
 // const int duration = animate ? 1500 : 1;
 
 CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscene, QWidget *parent)
-        : QGraphicsView(projectscene, parent), m_scene(projectscene), m_cursorPos(0), m_dropItem(NULL), m_cursorLine(NULL), m_operationMode(NONE), m_dragItem(NULL), m_visualTip(NULL), m_moveOpMode(NONE), m_animation(NULL), m_projectDuration(0), m_clickPoint(QPoint()), m_document(doc), m_autoScroll(KdenliveSettings::autoscroll()), m_tracksHeight(KdenliveSettings::trackheight()), m_tool(SELECTTOOL), m_dragGuide(NULL), m_findIndex(0), m_menuPosition(QPoint()), m_blockRefresh(false), m_selectionGroup(NULL) {
+        : QGraphicsView(projectscene, parent), m_scene(projectscene), m_cursorPos(0), m_dropItem(NULL), m_cursorLine(NULL), m_operationMode(NONE), m_dragItem(NULL), m_visualTip(NULL), m_moveOpMode(NONE), m_animation(NULL), m_projectDuration(0), m_clickPoint(QPoint()), m_document(doc), m_autoScroll(KdenliveSettings::autoscroll()), m_tracksHeight(KdenliveSettings::trackheight()), m_tool(SELECTTOOL), m_dragGuide(NULL), m_findIndex(0), m_menuPosition(QPoint()), m_blockRefresh(false), m_selectionGroup(NULL), m_selectedTrack(0) {
     if (doc) m_commandStack = doc->commandStack();
     else m_commandStack == NULL;
     setMouseTracking(true);
@@ -102,6 +102,9 @@ CustomTrackView::~CustomTrackView() {
     qDeleteAll(m_guides);
 }
 
+void CustomTrackView::setDocumentModified() {
+    m_document->setModified(true);
+}
 
 void CustomTrackView::setContextMenu(QMenu *timeline, QMenu *clip, QMenu *transition) {
     m_timelineContextMenu = timeline;
@@ -1996,15 +1999,15 @@ void CustomTrackView::slotRefreshGuides() {
 void CustomTrackView::drawBackground(QPainter * painter, const QRectF & rect) {
     QColor base = palette().button().color();
     QRectF r = rect;
-    //r.moveTo(horizontalScrollBar()->value(), verticalScrollBar()->value());
     r.setWidth(r.width() + 1);
     painter->setClipRect(r);
     painter->drawLine(r.left(), 0, r.right(), 0);
     uint max = m_scene->m_tracksList.count();
     for (uint i = 0; i < max;i++) {
+        /*if (max - i - 1 == m_selectedTrack) painter->fillRect(r.left(), m_tracksHeight * i + 1, r.right() - r.left() + 1, m_tracksHeight - 1, QBrush(QColor(211, 205, 147)));
+               else*/
         if (m_scene->m_tracksList.at(max - i - 1).type == AUDIOTRACK) painter->fillRect(r.left(), m_tracksHeight * i + 1, r.right() - r.left() + 1, m_tracksHeight - 1, QBrush(QColor(240, 240, 255)));
         painter->drawLine(r.left(), m_tracksHeight * (i + 1), r.right(), m_tracksHeight * (i + 1));
-        //painter->drawText(QRectF(10, 50 * i, 100, 50 * i + 49), Qt::AlignLeft, i18n(" Track ") + QString::number(i + 1));
     }
     int lowerLimit = m_tracksHeight * m_scene->m_tracksList.count() + 1;
     if (height() > lowerLimit)
index 6ef7a4379aa508b079e9e06cd98548d8209e52c8..186c2d64161938a70cdae6909e7280d62a439c53 100644 (file)
@@ -95,6 +95,7 @@ public:
     void clipEnd();
     void changeClipSpeed();
     void doChangeClipSpeed(ItemInfo info, double speed, const QString &id);
+    void setDocumentModified();
 
 public slots:
     void setCursorPos(int pos, bool seek = true);
@@ -138,6 +139,7 @@ protected:
 
 private:
     uint m_tracksHeight;
+    uint m_selectedTrack;
     int m_projectDuration;
     int m_cursorPos;
     ClipItem *m_dropItem;
index e0d2cf9cfa6290e10ab67f25c8be561211e97328..8c1d88648e08f8ffb3d7ff313771daa07e9b5cbf 100644 (file)
@@ -101,7 +101,7 @@ void EffectsListView::reloadEffectList() {
 void EffectsListView::slotRemoveEffect() {
     QListWidgetItem *item = m_effectsList->currentItem();
     QString effectId = item->text();
-    QString path = KStandardDirs::locateLocal("data", "kdenlive/effects/", true);
+    QString path = KStandardDirs::locateLocal("appdata", "effects/", true);
 
     QDir directory = QDir(path);
     QStringList filter;
index 6c018c787298db7dbcdcbd46a79a806c555d132e..1812e6f44761d31052daa92762f55bab768c8e8e 100644 (file)
@@ -77,7 +77,7 @@ EffectStackView::EffectStackView(QWidget *parent)
 void EffectStackView::slotSaveEffect() {
     QString name = QInputDialog::getText(this, i18n("Save Effect"), i18n("Name for saved effect: "));
     if (name.isEmpty()) return;
-    QString path = KStandardDirs::locateLocal("data", "kdenlive/effects/", true);
+    QString path = KStandardDirs::locateLocal("appdata", "effects/", true);
     path = path + name + ".xml";
     if (QFile::exists(path)) if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it ?")) == KMessageBox::No) return;
 
index 23f9e3b68c8194615c053b5a6b7857e359f286f5..584cabf24c91d2cba85f484713b1426fbd3a2699 100644 (file)
@@ -1,10 +1,30 @@
+/***************************************************************************
+ *   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 <QMouseEvent>
 #include <QStylePainter>
 #include <QFrame>
 #include <QWidget>
 #include <QPainter>
+#include <QAction>
 
+#include <KIcon>
 #include <KLocale>
 #include <KDebug>
 
@@ -28,6 +48,15 @@ HeaderTrack::HeaderTrack(int index, TrackInfo info, QWidget *parent)
     view.buttonAudio->setChecked(!info.isMute);
     connect(view.buttonVideo, SIGNAL(clicked()), this, SLOT(switchVideo()));
     connect(view.buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
+
+    m_contextMenu = new QMenu(this);
+    QAction *insertAction = new QAction(i18n("Insert track"), this);
+    m_contextMenu->addAction(insertAction);
+    connect(insertAction, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTrack()));
+
+    QAction *removeAction = new QAction(KIcon("edit-delete"), i18n("Delete track"), this);
+    m_contextMenu->addAction(removeAction);
+    connect(removeAction, SIGNAL(triggered(QAction *)), this, SLOT(slotDeleteTrack()));
 }
 
 void HeaderTrack::switchVideo() {
@@ -38,6 +67,19 @@ void HeaderTrack::switchAudio() {
     emit switchTrackAudio(m_index);
 }
 
+void HeaderTrack::slotDeleteTrack() {
+    emit deleteTrack(m_index);
+}
+
+void HeaderTrack::slotAddTrack() {
+    emit insertTrack(m_index);
+}
+
+// virtual
+void HeaderTrack::contextMenuEvent(QContextMenuEvent * event) {
+    m_contextMenu->popup(event->globalPos());
+}
+
 // virtual
 /*void HeaderTrack::paintEvent(QPaintEvent *e) {
     QRect region = e->rect();
index 28c7a10633ae1ce18dad7b57fafd915bf7cac961..93d70548d55bbf739961b83b1d13e0fffb5fd6fe 100644 (file)
@@ -1,6 +1,28 @@
+/***************************************************************************
+ *   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 HEADERTRACK_H
 #define HEADERTRACK_H
 
+#include <QContextMenuEvent>
+#include <QMenu>
+
 #include "definitions.h"
 #include "ui_trackheader_ui.h"
 
@@ -12,19 +34,25 @@ public:
 
 protected:
     //virtual void paintEvent(QPaintEvent * /*e*/);
+    virtual void contextMenuEvent(QContextMenuEvent * event);
 
 private:
     int m_index;
     TRACKTYPE m_type;
     Ui::TrackHeader_UI view;
+    QMenu *m_contextMenu;
 
 private slots:
     void switchAudio();
     void switchVideo();
+    void slotDeleteTrack();
+    void slotAddTrack();
 
 signals:
     void switchTrackAudio(int);
     void switchTrackVideo(int);
+    void insertTrack(int);
+    void deleteTrack(int);
 };
 
 #endif
index 5c97b461435a9f4bb2228374bc04f737ba918df4..e4eb306904677c390c1d268b57c2dd2e3cd5ee36 100644 (file)
@@ -138,7 +138,7 @@ Mlt::Repository *initEffects::parseEffectFiles() {
 // static
 void initEffects::parseCustomEffectsFile() {
     MainWindow::customEffects.clear();
-    QString path = KStandardDirs::locateLocal("data", "kdenlive/effects/", true);
+    QString path = KStandardDirs::locateLocal("appdata", "effects/", true);
     QDir directory = QDir(path);
     QStringList filter;
     filter << "*.xml";
index ef6523894ea17a0d6c95b1575f48ede0485e4cfd..d8f36d4894f98fe606a97a8c270ad91ddcb1f0b8 100644 (file)
@@ -913,7 +913,7 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale) {
     m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
     if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
     slotGotProgressInfo(QString(), -1);
-    //m_projectMonitor->refreshMonitor(true);
+    m_clipMonitor->refreshMonitor(true);
 }
 
 void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles) {
@@ -1013,7 +1013,7 @@ void MainWindow::slotEditProjectSettings() {
 void MainWindow::slotRenderProject() {
     if (!m_renderWidget) {
         m_renderWidget = new RenderWidget(this);
-        connect(m_renderWidget, SIGNAL(doRender(const QString&, const QString&, const QStringList &, bool, bool)), this, SLOT(slotDoRender(const QString&, const QString&, const QStringList &, bool, bool)));
+        connect(m_renderWidget, SIGNAL(doRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool)), this, SLOT(slotDoRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool)));
     }
     /*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
     if (currentTab) m_renderWidget->setTimeline(currentTab);
@@ -1021,7 +1021,7 @@ void MainWindow::slotRenderProject() {
     m_renderWidget->show();
 }
 
-void MainWindow::slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter) {
+void MainWindow::slotDoRender(const QString &dest, const QString &render, const QStringList &overlay_args, const QStringList &avformat_args, bool zoneOnly, bool playAfter) {
     if (dest.isEmpty()) return;
     int in;
     int out;
@@ -1038,6 +1038,7 @@ void MainWindow::slotDoRender(const QString &dest, const QString &render, const
         QStringList args;
         args << "-erase";
         if (zoneOnly) args << "in=" + QString::number(in) << "out=" + QString::number(out);
+        if (!overlay_args.isEmpty()) args << "preargs=" + overlay_args.join(" ");
         QString videoPlayer = "-";
         if (playAfter) {
             videoPlayer = KdenliveSettings::defaultplayerapp();
@@ -1045,6 +1046,7 @@ void MainWindow::slotDoRender(const QString &dest, const QString &render, const
         }
         args << KdenliveSettings::rendererpath() << m_activeDocument->profilePath() << render << videoPlayer << temp.fileName() << dest << avformat_args;
         QProcess::startDetached("kdenlive_render", args);
+        kDebug() << "///  STARTING RENDER PROCESS\n\nARGS:\n" << args;
     }
 }
 
index 6063959d70b1714572ffb57f3246164d823391c4..d55d05e0480ef4894679b6a10b6cc8ab1583446e 100644 (file)
@@ -192,7 +192,7 @@ private slots:
     void slotSwitchMarkersComments();
     void slotSwitchSnap();
     void slotRenderProject();
-    void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
+    void slotDoRender(const QString &dest, const QString &render, const QStringList &overlay_args, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
     void slotFullScreen();
     void slotUpdateDocumentState(bool modified);
     void slotZoomIn();
index 7034ed196d6f1d0527d6acfeb0623066a3ac9b82..8f8db8f0223892f4f8a245ade060016638657be6 100644 (file)
@@ -83,7 +83,7 @@ void RenderWidget::slotSaveProfile() {
     ui.extension->setText(m_view.size_list->currentItem()->data(ExtensionRole).toString());
     ui.profile_name->setFocus();
     if (d->exec() == QDialog::Accepted) {
-        QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+        QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
         QDomDocument doc;
         QFile file(exportFile);
         doc.setContent(&file, false);
@@ -162,7 +162,7 @@ void RenderWidget::slotEditProfile() {
 
     if (d->exec() == QDialog::Accepted) {
         slotDeleteProfile();
-        QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+        QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
         QDomDocument doc;
         QFile file(exportFile);
         doc.setContent(&file, false);
@@ -219,7 +219,7 @@ void RenderWidget::slotDeleteProfile() {
     QString currentGroup = m_view.format_list->currentItem()->text();
     QString currentProfile = m_view.size_list->currentItem()->text();
 
-    QString exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+    QString exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
     QDomDocument doc;
     QFile file(exportFile);
     doc.setContent(&file, false);
@@ -265,10 +265,17 @@ void RenderWidget::slotExport() {
     if (!item) return;
     QFile f(m_view.out_file->url().path());
     if (f.exists()) {
-        if (KMessageBox::warningYesNo(this, i18n("File already exists. Doy you want to overwrite it ?")) != KMessageBox::Yes)
+        if (KMessageBox::warningYesNo(this, i18n("File already exists. Do you want to overwrite it ?")) != KMessageBox::Yes)
             return;
     }
-    emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), m_view.advanced_params->text().split(' '), m_view.zone_only->isChecked(), m_view.play_after->isChecked());
+    QStringList overlayargs;
+    if (m_view.tc_overlay->isChecked()) {
+        QString filterFile = KStandardDirs::locate("appdata", "metadata.properties");
+        overlayargs << "meta.attr.timecode=1" << "meta.attr.timecode.markup=#timecode";
+        overlayargs << "-attach" << "data_feed:attr_check" << "-attach";
+        overlayargs << "data_show:" + filterFile << "_fezzik=1" << "dynamic=1";
+    }
+    emit doRender(m_view.out_file->url().path(), item->data(RenderRole).toString(), overlayargs, m_view.advanced_params->text().split(' '), m_view.zone_only->isChecked(), m_view.play_after->isChecked());
 }
 
 void RenderWidget::setDocumentStandard(QString std) {
@@ -330,9 +337,9 @@ void RenderWidget::refreshParams() {
 void RenderWidget::parseProfiles(QString group, QString profile) {
     m_view.size_list->clear();
     m_view.format_list->clear();
-    QString exportFile = KStandardDirs::locate("data", "kdenlive/export/profiles.xml");
+    QString exportFile = KStandardDirs::locate("appdata", "export/profiles.xml");
     parseFile(exportFile, false);
-    exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
+    exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
     parseFile(exportFile, true);
     refreshView();
     QList<QListWidgetItem *> child;
index 0abe2fb459fa3b070756a06095fb91d2e6de098c..52f3ff79e71e2a625ff2941a00cf5b6da732edbd 100644 (file)
@@ -49,7 +49,7 @@ private:
     void parseFile(QString exportFile, bool editable);
 
 signals:
-    void doRender(const QString&, const QString&, const QStringList &, bool, bool);
+    void doRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool);
 };
 
 
index afe017278310e1628ecf46a094c7f13e6bdfe8b4..a22093b2f32c24885e00097166f6f435e92e91ed 100644 (file)
@@ -304,6 +304,8 @@ void TrackView::slotRebuildTrackHeaders() {
         HeaderTrack *header = new HeaderTrack(i, list.at(max - i - 1), this);
         connect(header, SIGNAL(switchTrackVideo(int)), m_trackview, SLOT(slotSwitchTrackVideo(int)));
         connect(header, SIGNAL(switchTrackAudio(int)), m_trackview, SLOT(slotSwitchTrackAudio(int)));
+        connect(header, SIGNAL(deleteTrack(int)), m_trackview, SLOT(slotDeleteTrack(int)));
+        connect(header, SIGNAL(insertTrack(int)), m_trackview, SLOT(slotInsertTrack(int)));
         m_headersLayout->addWidget(header);
     }
     view->headers_container->adjustSize();
index 1bdc4f82c4698038b633688d7b6001776222b36c..68ae5c6947d6a4d1ebc891996cda228ed4644f6f 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>389</width>
-    <height>374</height>
+    <width>340</width>
+    <height>317</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -37,7 +37,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="0" colspan="4" >
+   <item row="4" column="0" colspan="4" >
     <layout class="QHBoxLayout" name="horizontalLayout" >
      <item>
       <widget class="QCheckBox" name="enable_params" >
      </item>
     </layout>
    </item>
-   <item row="4" column="0" >
+   <item row="5" column="0" >
     <widget class="KPushButton" name="buttonStart" >
      <property name="text" >
       <string>Start</string>
      </property>
     </widget>
    </item>
-   <item row="4" column="1" >
+   <item row="5" column="1" >
     <spacer name="horizontalSpacer" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
@@ -71,7 +71,7 @@
      </property>
     </spacer>
    </item>
-   <item row="4" column="2" colspan="2" >
+   <item row="5" column="2" colspan="2" >
     <widget class="QDialogButtonBox" name="buttonBox" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
       <number>0</number>
      </property>
      <widget class="QWidget" name="tab_2" >
-      <property name="geometry" >
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>373</width>
-        <height>203</height>
-       </rect>
-      </property>
       <attribute name="title" >
        <string>Templates</string>
       </attribute>
      </widget>
     </widget>
    </item>
+   <item row="3" column="0" colspan="2" >
+    <widget class="QCheckBox" name="tc_overlay" >
+     <property name="text" >
+      <string>Timecode overlay</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>