-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 )
--- /dev/null
+# 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
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();
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);
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 {
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;
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)));
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();
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);
m_zoneStart += move;
m_zoneEnd += move;
}
+ m_view->setDocumentModified();
update();
} else {
int pos = (int)((event->x() + offset()));
// 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);
qDeleteAll(m_guides);
}
+void CustomTrackView::setDocumentModified() {
+ m_document->setModified(true);
+}
void CustomTrackView::setContextMenu(QMenu *timeline, QMenu *clip, QMenu *transition) {
m_timelineContextMenu = timeline;
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)
void clipEnd();
void changeClipSpeed();
void doChangeClipSpeed(ItemInfo info, double speed, const QString &id);
+ void setDocumentModified();
public slots:
void setCursorPos(int pos, bool seek = true);
private:
uint m_tracksHeight;
+ uint m_selectedTrack;
int m_projectDuration;
int m_cursorPos;
ClipItem *m_dropItem;
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;
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;
+/***************************************************************************
+ * 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>
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() {
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();
+/***************************************************************************
+ * 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"
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
// 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";
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) {
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);
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;
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();
}
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;
}
}
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();
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);
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);
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);
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) {
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;
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);
};
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();
<rect>
<x>0</x>
<y>0</y>
- <width>389</width>
- <height>374</height>
+ <width>340</width>
+ <height>317</height>
</rect>
</property>
<property name="windowTitle" >
</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>
</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>