#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;
void MainWindow::newFile() {
QString profileName;
KUrl projectFolder;
+ QPoint projectTracks(3, 2);
if (m_timelineArea->count() == 0) profileName = KdenliveSettings::default_profile();
else {
ProjectSettings *w = new ProjectSettings;
if (w->exec() != QDialog::Accepted) return;
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
+ projectTracks = w->tracks();
delete w;
}
- KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, this);
+ KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, this);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description());
void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale) {
KdenliveDoc *doc;
- doc = new KdenliveDoc(url, KUrl(), m_commandStack, QString(), this);
+ doc = new KdenliveDoc(url, KUrl(), m_commandStack, QString(), QPoint(3, 2), this);
if (stale == NULL) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = 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) {
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;
}
}
m_activeDocument->backupMltPlaylist();
if (m_activeTimeline) {
disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
+ disconnect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
disconnect(m_projectMonitor, SIGNAL(durationChanged(int)), m_activeTimeline, SLOT(setDuration(int)));
disconnect(m_projectList, SIGNAL(projectModified()), m_activeDocument, SLOT(setModified()));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
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*)));
disconnect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
disconnect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
disconnect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
+ disconnect(transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
+ disconnect(trackView, SIGNAL(zoneMoved(int, int)), m_projectMonitor, SLOT(slotZoneMoved(int, int)));
effectStack->clear();
}
m_activeDocument->setRenderer(NULL);
KdenliveSettings::setProject_fps(doc->fps());
m_monitorManager->resetProfiles(doc->timecode());
m_projectList->setDocument(doc);
+ transitionConfig->updateProjectFormat(doc->mltProfile());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
+ connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int)));
connect(doc, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
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 &)));
connect(effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
connect(effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
connect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
+ connect(transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
connect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
+ connect(trackView, SIGNAL(zoneMoved(int, int)), m_projectMonitor, SLOT(slotZoneMoved(int, int)));
+
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu);
m_activeTimeline = trackView;
if (m_renderWidget) m_renderWidget->setDocumentStandard(doc->getDocumentStandard());
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());