if (!KdenliveSettings::colortheme().isEmpty()) slotChangePalette(NULL, KdenliveSettings::colortheme());
setFont(KGlobalSettings::toolBarFont());
parseProfiles(MltPath);
+ KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
m_commandStack = new QUndoGroup;
setDockNestingEnabled(true);
m_timelineArea = new KTabWidget(this);
setCentralWidget(m_timelineArea);
- KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
m_fileOpenRecent = KStandardAction::openRecent(this, SLOT(openFile(const KUrl &)), actionCollection());
readOptions();
m_fileRevert = KStandardAction::revert(this, SLOT(slotRevert()), actionCollection());
// Prepare layout actions
KActionCategory *layoutActions = new KActionCategory(i18n("Layouts"), actionCollection());
+ m_loadLayout = new KSelectAction(i18n("Load Layout"), actionCollection());
for (int i = 1; i < 5; i++) {
- KAction *load = new KAction(KIcon(), i18n("Load Layout %1").arg(i), this);
+ KAction *load = new KAction(KIcon(), i18n("Layout %1").arg(i), this);
load->setData("_" + QString::number(i));
- layoutActions->addAction("load_layout" + QString::number(i), load);
+ layoutActions->addAction("load_layout" + QString::number(i), load);
+ m_loadLayout->addAction(load);
KAction *save = new KAction(KIcon(), i18n("Save As Layout %1").arg(i), this);
save->setData("_" + QString::number(i));
layoutActions->addAction("save_layout" + QString::number(i), save);
}
+ layoutActions->addAction("load_layouts", m_loadLayout);
+ connect(m_loadLayout, SIGNAL(triggered(QAction*)), this, SLOT(slotLoadLayout(QAction*)));
KAction *action;
// Stop motion actions. Beware of the order, we MUST use the same order in stopmotion/stopmotion.cpp
m_stopmotion_actions = new KActionCategory(i18n("Stop Motion"), actionCollection());
action = new KAction(KIcon("media-record"), i18n("Capture frame"), this);
- action->setShortcut(Qt::Key_Space);
//action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
m_stopmotion_actions->addAction("stopmotion_capture", action);
action = new KAction(i18n("Switch live / captured frame"), this);
/*ScriptingPart* sp = new ScriptingPart(this, QStringList());
guiFactory()->addClient(sp);*/
-
- QMenu *loadLayout = (QMenu*)(factory()->container("layout_load", this));
- if (loadLayout)
- connect(loadLayout, SIGNAL(triggered(QAction*)), this, SLOT(slotLoadLayout(QAction*)));
QMenu *saveLayout = (QMenu*)(factory()->container("layout_save_as", this));
if (saveLayout)
connect(saveLayout, SIGNAL(triggered(QAction*)), this, SLOT(slotSaveLayout(QAction*)));
Mlt::Factory::close();
}
-void MainWindow::queryQuit()
-{
- if (queryClose()) {
- close();
- }
-}
-
//virtual
bool MainWindow::queryClose()
{
connect(m_projectList, SIGNAL(deleteProjectClips(QStringList, QMap<QString, QString>)), this, SLOT(slotDeleteProjectClips(QStringList, QMap<QString, QString>)));
connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
- connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool)));
+ connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool, bool)));
connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QPixmap &)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QPixmap &)));
- connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool)));
+ connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool, bool)));
connect(m_projectMonitor->render, SIGNAL(removeInvalidClip(const QString &, bool)), m_projectList, SLOT(slotRemoveInvalidClip(const QString &, bool)));
- connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &)));
+ connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &, bool)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &, bool)));
connect(m_clipMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustClipMonitor()));
connect(m_projectMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustProjectMonitor()));
connect(maxCurrent, SIGNAL(triggered(bool)), this, SLOT(slotMaximizeCurrent(bool)));*/
m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
- KStandardAction::quit(this, SLOT(queryQuit()), collection);
+ KStandardAction::quit(this, SLOT(close()), collection);
KStandardAction::open(this, SLOT(openFile()), collection);
m_saveAction = KStandardAction::save(this, SLOT(saveFile()), collection);
KStandardAction::saveAs(this, SLOT(saveFileAs()), collection);
void MainWindow::loadLayouts()
{
QMenu *saveLayout = (QMenu*)(factory()->container("layout_save_as", this));
- QMenu *loadLayout = (QMenu*)(factory()->container("layout_load", this));
- if (loadLayout == NULL || saveLayout == NULL) return;
+ if (m_loadLayout == NULL || saveLayout == NULL) return;
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layoutGroup(config, "Layouts");
QStringList entries = layoutGroup.keyList();
- QList<QAction *> loadActions = loadLayout->actions();
+ QList<QAction *> loadActions = m_loadLayout->actions();
QList<QAction *> saveActions = saveLayout->actions();
for (int i = 1; i < 5; i++) {
// Rename the layouts actions
}
for (int j = 0; j < saveActions.count(); j++) {
if (saveActions.at(j)->data().toString().endsWith("_" + QString::number(i))) {
- saveActions[j]->setText(layoutName);
+ saveActions[j]->setText(i18n("Save as %1").arg(layoutName));
saveActions[j]->setData(key);
break;
}
QString profileName = KdenliveSettings::default_profile();
KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
+ bool useProxy = KdenliveSettings::enableproxy();
+ QString proxyParams = KdenliveSettings::proxyparams();
+ bool generateProxy = KdenliveSettings::enableproxy();
+ int proxyMinSize = 1000;
if (!showProjectSettings) {
if (!KdenliveSettings::activatetabs())
if (!closeCurrentDocument())
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
projectTracks = w->tracks();
+ useProxy = w->useProxy();
+ proxyParams = w->proxyParams();
+ generateProxy = w->generateProxy();
+ proxyMinSize = w->proxyMinSize();
delete w;
}
m_timelineArea->setEnabled(true);
m_projectList->setEnabled(true);
KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, m_projectMonitor->render, m_notesWidget, this);
+ doc->setDocumentProperty("useproxy", QString::number((int) useProxy));
+ doc->setDocumentProperty("proxyparams", proxyParams);
+ doc->setDocumentProperty("generateproxy", QString::number((int) generateProxy));
+ doc->setDocumentProperty("proxyminsize", QString::number(proxyMinSize));
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
bool ok;
TrackView *trackView = new TrackView(doc, &ok, this);
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
if (m_activeDocument->profilePath() != profile) slotUpdateProjectProfile(profile);
+ m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
+ m_activeDocument->setDocumentProperty("generateproxy", QString::number((int) w->generateProxy()));
+ m_activeDocument->setDocumentProperty("proxyminsize", QString::number(w->proxyMinSize()));
+ if (QString::number((int) w->useProxy()) != m_activeDocument->getDocumentProperty("enableproxy")) {
+ m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) w->useProxy()));
+ slotUpdateProxySettings();
+ }
}
delete w;
}
{
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
- m_renderWidget = new RenderWidget(projectfolder, this);
+ m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), this);
connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap <QString, QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap <QString, QString>)));
connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
disconnect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
+ disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(const QString &)));
m_effectStack->clear();
}
//m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
- disconnect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+ disconnect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
m_clipMonitor->stop();
}
KdenliveSettings::setCurrent_profile(doc->profilePath());
m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
- connect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+ connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+ connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &, bool)));
connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(actions, this);
connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
- //connect(dialog, SIGNAL(doResetProfile()), this, SLOT(slotDetectAudioDriver()));
connect(dialog, SIGNAL(doResetProfile()), m_monitorManager, SLOT(slotResetProfiles()));
#ifndef Q_WS_MAC
connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
ClipProperties dia(cliplist, m_activeDocument->timecode(), commonproperties, this);
if (dia.exec() == QDialog::Accepted) {
QUndoCommand *command = new QUndoCommand();
+ QMap <QString, QString> newImageProps = dia.properties();
+ // Transparency setting applies only for images
+ QMap <QString, QString> newProps = newImageProps;
+ newProps.remove("transparency");
command->setText(i18n("Edit clips"));
for (int i = 0; i < cliplist.count(); i++) {
DocClipBase *clip = cliplist.at(i);
- new EditClipCommand(m_projectList, clip->getId(), clip->properties(), dia.properties(), true, command);
+ if (clip->clipType() == IMAGE)
+ new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newImageProps, true, command);
+ else
+ new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newProps, true, command);
}
m_activeDocument->commandStack()->push(command);
for (int i = 0; i < cliplist.count(); i++)
return;
}
playlistPath = scriptPath + ".mlt";
- m_projectMonitor->saveSceneList(playlistPath);
} else {
KTemporaryFile temp;
temp.setAutoRemove(false);
temp.setSuffix(".mlt");
temp.open();
playlistPath = temp.fileName();
- m_projectMonitor->saveSceneList(playlistPath);
}
-
+ QString playlistContent = m_projectMonitor->sceneList();
if (!chapterFile.isEmpty()) {
int in = 0;
int out;
if (m_renderWidget->automaticAudioExport()) {
exportAudio = m_activeTimeline->checkProjectAudio();
} else exportAudio = m_renderWidget->selectedAudioExport();
+
+ // Do we want proxy rendering
+ if (m_projectList->useProxy() && !m_renderWidget->proxyRendering()) {
+ // replace proxy clips with originals
+ QMap <QString, QString> proxies = m_projectList->getProxies();
+ QMapIterator<QString, QString> i(proxies);
+ while (i.hasNext()) {
+ i.next();
+ // Replace all keys with their values (proxy path with original path)
+ playlistContent.replace(i.key(), i.value());
+ }
+ }
+
+ // Do save scenelist
+ QFile file(playlistPath);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage);
+ return;
+ }
+ file.write(playlistContent.toUtf8());
+ if (file.error() != QFile::NoError) {
+ m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage);
+ file.close();
+ return;
+ }
+ file.close();
m_renderWidget->slotExport(scriptExport, m_activeTimeline->inPoint(), m_activeTimeline->outPoint(), playlistPath, scriptPath, exportAudio);
}
m_projectList->slotDeleteClip(id);
}
+void MainWindow::slotUpdateProxySettings()
+{
+ if (m_renderWidget) m_renderWidget->updateProxyConfig(m_projectList->useProxy());
+ if (KdenliveSettings::enableproxy())
+ KStandardDirs::makeDir(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "proxy/");
+ m_projectList->updateProxyConfig();
+}
+
#include "mainwindow.moc"
#ifdef DEBUG_MAINW