void MainWindow::newFile(bool showProjectSettings)
{
+ if (!m_timelineArea->isEnabled()) return;
QString profileName;
KUrl projectFolder;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
}
KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, m_projectMonitor->render, this);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
- TrackView *trackView = new TrackView(doc, this);
+ bool ok;
+ TrackView *trackView = new TrackView(doc, &ok, this);
m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description());
+ if (!ok) {
+ // MLT is broken
+ m_timelineArea->setEnabled(false);
+ m_projectList->setEnabled(false);
+ m_monitorManager->slotBlockMonitors();
+ slotPreferences(6);
+ return;
+ }
if (m_timelineArea->count() == 1) {
connectDocumentInfo(doc);
connectDocument(trackView, doc);
void MainWindow::activateDocument()
{
- if (m_timelineArea->currentWidget() == NULL) return;
+ if (m_timelineArea->currentWidget() == NULL || !m_timelineArea->isEnabled()) return;
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
{
+ if (!m_timelineArea->isEnabled()) return;
KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, this);
if (stale == NULL) {
stale = new KAutoSaveFile(url, doc);
stale->setParent(doc);
}
connectDocumentInfo(doc);
- TrackView *trackView = new TrackView(doc, this);
+ bool ok;
+ TrackView *trackView = new TrackView(doc, &ok, this);
m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description()));
+ if (!ok) {
+ m_timelineArea->setEnabled(false);
+ m_projectList->setEnabled(false);
+ m_monitorManager->slotBlockMonitors();
+ slotPreferences(6);
+ return;
+ }
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
trackView->setDuration(trackView->duration());
trackView->projectView()->initCursorPos(m_projectMonitor->render->seekPosition().frames(doc->fps()));
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
m_renderWidget = new RenderWidget(projectfolder, this);
- connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &)));
+ connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &, const QString&)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &, const QString&)));
connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
connect(m_renderWidget, SIGNAL(abortProcess(const QString &)), this, SIGNAL(abortRenderJob(const QString &)));
connect(m_renderWidget, SIGNAL(openDvdWizard(const QString &, const QString &)), this, SLOT(slotDvdWizard(const QString &, const QString &)));
if (m_activeDocument) {
m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_renderWidget->setGuides(m_activeDocument->guidesXml(), m_activeDocument->projectDuration());
- m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("renderprofile"));
m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
+ m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"));
}
}
/*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
m_renderWidget->setProfile(doc->mltProfile());
m_renderWidget->setGuides(doc->guidesXml(), doc->projectDuration());
m_renderWidget->setDocumentPath(doc->projectFolder().path(KUrl::AddTrailingSlash));
- m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"));
+ m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"));
}
//doc->setRenderer(m_projectMonitor->render);
m_commandStack->setActiveStack(doc->commandStack());
if (m_activeTimeline) {
ClipItem *item = m_activeTimeline->projectView()->getActiveClipUnderCursor();
if (item) {
- pos = m_projectMonitor->position() - item->startPos() + item->cropStart();
+ pos = (m_projectMonitor->position() - item->startPos() + item->cropStart()) / item->speed();
clip = item->baseClip();
}
}
if (m_activeTimeline) {
ClipItem *item = m_activeTimeline->projectView()->getActiveClipUnderCursor();
if (item) {
- pos = m_projectMonitor->position() - item->startPos() + item->cropStart();
+ pos = (m_projectMonitor->position() - item->startPos() + item->cropStart()) / item->speed();
clip = item->baseClip();
}
}
if (m_activeTimeline) {
ClipItem *item = m_activeTimeline->projectView()->getActiveClipUnderCursor();
if (item) {
- pos = m_projectMonitor->position() - item->startPos() + item->cropStart();
+ pos = (m_projectMonitor->position() - item->startPos() + item->cropStart()) / item->speed();
clip = item->baseClip();
}
}
slotTranscode(urls);
}
-void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &name)
+void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &name, const QString &file)
{
if (m_activeDocument == NULL) return;
m_activeDocument->setDocumentProperty("renderdestination", dest);
m_activeDocument->setDocumentProperty("renderprofile", name);
+ m_activeDocument->setDocumentProperty("renderurl", file);
m_activeDocument->setModified(true);
}