#include "effectslistview.h"
#include "effectstack/effectstackview2.h"
#include "transitionsettings.h"
#include "effectslistview.h"
#include "effectstack/effectstackview2.h"
#include "transitionsettings.h"
#include "scopes/audioscopes/audiosignal.h"
#include "scopes/audioscopes/audiospectrum.h"
#include "scopes/audioscopes/spectrogram.h"
#include "scopes/audioscopes/audiosignal.h"
#include "scopes/audioscopes/audiospectrum.h"
#include "scopes/audioscopes/spectrogram.h"
MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & clipsToLoad, QWidget *parent) :
KXmlGuiWindow(parent),
MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & clipsToLoad, QWidget *parent) :
KXmlGuiWindow(parent),
setFont(KGlobalSettings::toolBarFont());
parseProfiles(MltPath);
KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
setFont(KGlobalSettings::toolBarFont());
parseProfiles(MltPath);
KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
m_commandStack = new QUndoGroup;
setDockNestingEnabled(true);
m_timelineArea = new KTabWidget(this);
m_commandStack = new QUndoGroup;
setDockNestingEnabled(true);
m_timelineArea = new KTabWidget(this);
m_projectListDock = new QDockWidget(i18n("Project Tree"), this);
m_projectListDock->setObjectName("project_tree");
m_projectListDock = new QDockWidget(i18n("Project Tree"), this);
m_projectListDock->setObjectName("project_tree");
m_projectListDock->setWidget(m_projectList);
addDockWidget(Qt::TopDockWidgetArea, m_projectListDock);
m_clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
m_clipMonitorDock->setObjectName("clip_monitor");
m_projectListDock->setWidget(m_projectList);
addDockWidget(Qt::TopDockWidgetArea, m_projectListDock);
m_clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
m_clipMonitorDock->setObjectName("clip_monitor");
- m_clipMonitor = new Monitor(Kdenlive::clipMonitor, m_monitorManager, QString(), m_timelineArea);
+ m_clipMonitor = new Monitor(Kdenlive::ClipMonitor, m_monitorManager, m_glContext, QString(), m_timelineArea);
m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
m_projectMonitorDock->setObjectName("project_monitor");
m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
m_projectMonitorDock->setObjectName("project_monitor");
- m_projectMonitor = new Monitor(Kdenlive::projectMonitor, m_monitorManager, QString());
+ m_projectMonitor = new Monitor(Kdenlive::ProjectMonitor, m_monitorManager, m_glContext, QString());
m_projectMonitorDock->setWidget(m_projectMonitor);
#ifndef Q_WS_MAC
m_recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
m_recMonitorDock->setObjectName("record_monitor");
m_projectMonitorDock->setWidget(m_projectMonitor);
#ifndef Q_WS_MAC
m_recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
m_recMonitorDock->setObjectName("record_monitor");
m_recMonitorDock->setWidget(m_recMonitor);
connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
connect(m_recMonitor, SIGNAL(addProjectClipList(KUrl::List)), this, SLOT(slotAddProjectClipList(KUrl::List)));
m_recMonitorDock->setWidget(m_recMonitor);
connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
connect(m_recMonitor, SIGNAL(addProjectClipList(KUrl::List)), this, SLOT(slotAddProjectClipList(KUrl::List)));
m_timelineContextClipMenu->addAction(actionCollection()->action("clip_in_project_tree"));
//m_timelineContextClipMenu->addAction(actionCollection()->action("clip_to_project_tree"));
m_timelineContextClipMenu->addAction(actionCollection()->action("clip_in_project_tree"));
//m_timelineContextClipMenu->addAction(actionCollection()->action("clip_to_project_tree"));
m_timelineContextClipMenu->addSeparator();
m_timelineContextClipMenu->addAction(actionCollection()->action("group_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("ungroup_clip"));
m_timelineContextClipMenu->addSeparator();
m_timelineContextClipMenu->addAction(actionCollection()->action("group_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("ungroup_clip"));
m_timelineContextClipMenu->addMenu(m_transitionsMenu);
m_timelineContextClipMenu->addMenu(m_effectsMenu);
m_timelineContextClipMenu->addMenu(m_transitionsMenu);
m_timelineContextClipMenu->addMenu(m_effectsMenu);
m_timelineContextTransitionMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Copy)));
m_timelineContextTransitionMenu->addAction(actionCollection()->action("auto_transition"));
m_timelineContextTransitionMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Copy)));
m_timelineContextTransitionMenu->addAction(actionCollection()->action("auto_transition"));
// warn the user to save if document is modified and we have clips in our project list
if (m_activeDocument && m_activeDocument->isModified() &&
((m_projectList->documentClipList().isEmpty() && !m_activeDocument->url().isEmpty()) ||
// warn the user to save if document is modified and we have clips in our project list
if (m_activeDocument && m_activeDocument->isModified() &&
((m_projectList->documentClipList().isEmpty() && !m_activeDocument->url().isEmpty()) ||
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
m_jogShuttle = new JogShuttleAction(m_jogProcess, JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons()));
connect(m_jogShuttle, SIGNAL(rewindOneFrame()), m_monitorManager, SLOT(slotRewindOneFrame()));
m_jogShuttle = new JogShuttleAction(m_jogProcess, JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons()));
connect(m_jogShuttle, SIGNAL(rewindOneFrame()), m_monitorManager, SLOT(slotRewindOneFrame()));
if (m_clipMonitor->activeClip() && m_clipMonitor->activeClip()->getId() == id) {
Mlt::Producer *monitorProducer = clip->getCloneProducer();
m_clipMonitor->updateClipProducer(monitorProducer);
if (m_clipMonitor->activeClip() && m_clipMonitor->activeClip()->getId() == id) {
Mlt::Producer *monitorProducer = clip->getCloneProducer();
m_clipMonitor->updateClipProducer(monitorProducer);
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layouts(config, "Layouts");
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii());
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layouts(config, "Layouts");
QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii());
int layoutId = originallayoutName.section('_', -1).toInt();
QString layoutName = QInputDialog::getText(this, i18n("Save Layout"), i18n("Layout name:"), QLineEdit::Normal, originallayoutName.section('_', 0, -2));
int layoutId = originallayoutName.section('_', -1).toInt();
QString layoutName = QInputDialog::getText(this, i18n("Save Layout"), i18n("Layout name:"), QLineEdit::Normal, originallayoutName.section('_', 0, -2));
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layouts(config, "Layouts");
layouts.deleteEntry(originallayoutName);
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layouts(config, "Layouts");
layouts.deleteEntry(originallayoutName);
QString path = QDir::homePath() + "/kdenlive";
if (KStandardDirs::makeDir(path) == false) {
kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
QString path = QDir::homePath() + "/kdenlive";
if (KStandardDirs::makeDir(path) == false) {
kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
if (!initialGroup.exists() || upgrade) {
// this is our first run, show Wizard
QPointer<Wizard> w = new Wizard(upgrade, this);
if (!initialGroup.exists() || upgrade) {
// this is our first run, show Wizard
QPointer<Wizard> w = new Wizard(upgrade, this);
KConfigGroup treecolumns(config, "Project Tree");
const QByteArray state = treecolumns.readEntry("columns", QByteArray());
KConfigGroup treecolumns(config, "Project Tree");
const QByteArray state = treecolumns.readEntry("columns", QByteArray());
m_fileRevert->setEnabled(false);
QString profileName = KdenliveSettings::default_profile();
KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
m_fileRevert->setEnabled(false);
QString profileName = KdenliveSettings::default_profile();
KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
QMap <QString, QString> documentMetadata;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
if (!showProjectSettings) {
QMap <QString, QString> documentMetadata;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
if (!showProjectSettings) {
} else {
QPointer<ProjectSettings> w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
if (w->exec() != QDialog::Accepted) {
delete w;
return;
}
} else {
QPointer<ProjectSettings> w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
if (w->exec() != QDialog::Accepted) {
delete w;
return;
}
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
projectTracks = w->tracks();
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
projectTracks = w->tracks();
- KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, documentMetadata, projectTracks, m_projectMonitor->render, m_notesWidget, &openBackup, this);
+ KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, documentMetadata, projectTracks, m_projectMonitor->render, m_notesWidget, &openBackup, m_glContext, this);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
bool ok;
TrackView *trackView = new TrackView(doc, m_tracksActionCollection->actions(), &ok, this);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
bool ok;
TrackView *trackView = new TrackView(doc, m_tracksActionCollection->actions(), &ok, this);
if (m_timelineArea->count() == 1) {
connectDocumentInfo(doc);
connectDocument(trackView, doc);
if (m_timelineArea->count() == 1) {
connectDocumentInfo(doc);
connectDocument(trackView, doc);
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
bool MainWindow::closeCurrentDocument(bool saveChanges)
{
QWidget *w = m_timelineArea->currentWidget();
bool MainWindow::closeCurrentDocument(bool saveChanges)
{
QWidget *w = m_timelineArea->currentWidget();
m_timelineArea->setCurrentIndex(ix);
TrackView *tabToClose = (TrackView *) w;
KdenliveDoc *docToClose = tabToClose->document();
if (docToClose && docToClose->isModified() && saveChanges) {
QString message;
m_timelineArea->setCurrentIndex(ix);
TrackView *tabToClose = (TrackView *) w;
KdenliveDoc *docToClose = tabToClose->document();
if (docToClose && docToClose->isModified() && saveChanges) {
QString message;
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
slotTimelineClipSelected(NULL, false);
m_clipMonitor->slotSetClipProducer(NULL);
m_projectList->slotResetProjectList();
slotTimelineClipSelected(NULL, false);
m_clipMonitor->slotSetClipProducer(NULL);
m_projectList->slotResetProjectList();
- if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList(), m_projectList->expandedFolders()) == false)
+ if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList(), m_projectList->expandedFolders()) == false) {
QByteArray hash = QCryptographicHash::hash(KUrl(outputFileName).encodedPath(), QCryptographicHash::Md5).toHex();
if (m_activeDocument->m_autosave == NULL) {
m_activeDocument->m_autosave = new KAutoSaveFile(KUrl(hash), this);
QByteArray hash = QCryptographicHash::hash(KUrl(outputFileName).encodedPath(), QCryptographicHash::Md5).toHex();
if (m_activeDocument->m_autosave == NULL) {
m_activeDocument->m_autosave = new KAutoSaveFile(KUrl(hash), this);
setCaption(m_activeDocument->description());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), m_activeDocument->url().path());
setCaption(m_activeDocument->description());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), m_activeDocument->url().path());
m_fileOpenRecent->addUrl(KUrl(outputFileName));
m_fileRevert->setEnabled(true);
m_undoView->stack()->setClean();
m_fileOpenRecent->addUrl(KUrl(outputFileName));
m_fileRevert->setEnabled(true);
m_undoView->stack()->setClean();
if (QFile::exists(outputFile)) {
// Show the file dialog again if the user does not want to overwrite the file
if (QFile::exists(outputFile)) {
// Show the file dialog again if the user does not want to overwrite the file
- if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", outputFile)) == KMessageBox::No)
+ if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", outputFile)) == KMessageBox::No) {
if (!url.fileName().endsWith(".kdenlive")) {
// This is not a Kdenlive project file, abort loading
KMessageBox::sorry(this, i18n("File %1 is not a Kdenlive project file", url.path()));
if (!url.fileName().endsWith(".kdenlive")) {
// This is not a Kdenlive project file, abort loading
KMessageBox::sorry(this, i18n("File %1 is not a Kdenlive project file", url.path()));
- KdenliveDoc *doc = new KdenliveDoc(stale ? KUrl(stale->fileName()) : url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap <QString, QString> (), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, &openBackup, this, &progressDialog);
+ KdenliveDoc *doc = new KdenliveDoc(stale ? KUrl(stale->fileName()) : url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap <QString, QString> (), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, &openBackup, m_glContext, this, &progressDialog);
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
trackView->setDuration(trackView->duration());
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
trackView->setDuration(trackView->duration());
slotGotProgressInfo(QString(), -1);
m_projectMonitor->adjustRulerSize(trackView->duration());
m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
progressDialog.progressBar()->setValue(4);
slotGotProgressInfo(QString(), -1);
m_projectMonitor->adjustRulerSize(trackView->duration());
m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
progressDialog.progressBar()->setValue(4);
{
foreach(KAutoSaveFile * stale, staleFiles) {
/*if (!stale->open(QIODevice::QIODevice::ReadOnly)) {
{
foreach(KAutoSaveFile * stale, staleFiles) {
/*if (!stale->open(QIODevice::QIODevice::ReadOnly)) {
}*/
kDebug() << "// OPENING RECOVERY: " << stale->fileName() << "\nMANAGED: " << stale->managedFile().path();
// the stalefiles also contain ".lock" files so we must ignore them... bug in KAutoSaveFile?
}*/
kDebug() << "// OPENING RECOVERY: " << stale->fileName() << "\nMANAGED: " << stale->managedFile().path();
// the stalefiles also contain ".lock" files so we must ignore them... bug in KAutoSaveFile?
- if (!stale->fileName().endsWith(".lock")) doOpenFile(originUrl, stale);
- else KIO::NetAccess::del(KUrl(stale->fileName()), this);
+ if (!stale->fileName().endsWith(".lock")) {
+ doOpenFile(originUrl, stale);
+ } else {
+ KIO::NetAccess::del(KUrl(stale->fileName()), this);
+ }
if (KdenliveSettings::rendererpath().isEmpty() || KdenliveSettings::rendererpath().endsWith("inigo")) {
QString meltPath = QString(MLT_PREFIX) + QString("/bin/melt");
if (KdenliveSettings::rendererpath().isEmpty() || KdenliveSettings::rendererpath().endsWith("inigo")) {
QString meltPath = QString(MLT_PREFIX) + QString("/bin/melt");
kDebug() << "RESULTING MLT PATH: " << KdenliveSettings::mltpath();
// Parse again MLT profiles to build a list of available video formats
kDebug() << "RESULTING MLT PATH: " << KdenliveSettings::mltpath();
// Parse again MLT profiles to build a list of available video formats
ProfilesDialog *w = new ProfilesDialog;
if (w->exec() == QDialog::Accepted) {
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
ProfilesDialog *w = new ProfilesDialog;
if (w->exec() == QDialog::Accepted) {
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
- if (m_renderWidget) m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
- if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
- if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
- if (m_activeDocument->profilePath() != profile) slotUpdateProjectProfile(profile);
+ if (m_renderWidget) {
+ m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
+ }
+ if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) {
+ slotSwitchVideoThumbs();
+ }
+ if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) {
+ slotSwitchAudioThumbs();
+ }
+ if (m_activeDocument->profilePath() != profile) {
+ slotUpdateProjectProfile(profile);
+ }
if (m_activeDocument->getDocumentProperty("proxyparams") != w->proxyParams()) {
m_activeDocument->setModified();
m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
if (m_activeDocument->getDocumentProperty("proxyparams") != w->proxyParams()) {
m_activeDocument->setModified();
m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
m_projectList->updateProjectFormat(m_activeDocument->timecode());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
m_projectList->updateProjectFormat(m_activeDocument->timecode());
m_activeDocument->clipManager()->clearCache();
m_activeTimeline->updateProfile();
m_activeDocument->setModified(true);
m_activeDocument->clipManager()->clearCache();
m_activeTimeline->updateProfile();
m_activeDocument->setModified(true);
m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), profile, this);
connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap<QString,QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap<QString,QString>)));
m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), profile, this);
connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap<QString,QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap<QString,QString>)));
switch (m_timeFormatButton->currentItem()) {
case 0:
m_timeFormatButton->setText(m_activeDocument->timecode().getTimecodeFromFrames(pos) + " / " + m_activeDocument->timecode().getTimecodeFromFrames(m_activeTimeline->duration()));
switch (m_timeFormatButton->currentItem()) {
case 0:
m_timeFormatButton->setText(m_activeDocument->timecode().getTimecodeFromFrames(pos) + " / " + m_activeDocument->timecode().getTimecodeFromFrames(m_activeTimeline->duration()));
m_closeAction->setEnabled(m_timelineArea->count() > 1);
kDebug() << "/////////////////// CONNECTING DOC TO PROJECT VIEW ////////////////";
if (m_activeDocument) {
m_closeAction->setEnabled(m_timelineArea->count() > 1);
kDebug() << "/////////////////// CONNECTING DOC TO PROJECT VIEW ////////////////";
if (m_activeDocument) {
if (m_activeTimeline) {
disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
disconnect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), m_activeTimeline, SLOT(slotSetZone(QPoint)));
if (m_activeTimeline) {
disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
disconnect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), m_activeTimeline, SLOT(slotSetZone(QPoint)));
disconnect(m_effectStack, SIGNAL(displayMessage(QString,int)), this, SLOT(slotGotProgressInfo(QString,int)));
disconnect(m_transitionConfig, SIGNAL(transitionUpdated(Transition*,QDomElement)), m_activeTimeline->projectView() , SLOT(slotTransitionUpdated(Transition*,QDomElement)));
disconnect(m_transitionConfig, SIGNAL(seekTimeline(int)), m_activeTimeline->projectView() , SLOT(setCursorPos(int)));
disconnect(m_effectStack, SIGNAL(displayMessage(QString,int)), this, SLOT(slotGotProgressInfo(QString,int)));
disconnect(m_transitionConfig, SIGNAL(transitionUpdated(Transition*,QDomElement)), m_activeTimeline->projectView() , SLOT(slotTransitionUpdated(Transition*,QDomElement)));
disconnect(m_transitionConfig, SIGNAL(seekTimeline(int)), m_activeTimeline->projectView() , SLOT(setCursorPos(int)));
- disconnect(m_transitionConfig, SIGNAL(importClipKeyframes(GRAPHICSRECTITEM)), m_activeTimeline->projectView() , SLOT(slotImportClipKeyframes(GRAPHICSRECTITEM)));
+ disconnect(m_transitionConfig, SIGNAL(importClipKeyframes(GraphicsRectItem)), m_activeTimeline->projectView() , SLOT(slotImportClipKeyframes(GraphicsRectItem)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int,int)), this, SLOT(slotZoneMoved(int,int)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int,int)), this, SLOT(slotZoneMoved(int,int)));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(trackView->projectView(), SIGNAL(forceClipProcessing(QString)), m_projectList, SLOT(slotForceProcessing(QString)));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(trackView->projectView(), SIGNAL(forceClipProcessing(QString)), m_projectList, SLOT(slotForceProcessing(QString)));
- connect(trackView->projectView(), SIGNAL(importKeyframes(GRAPHICSRECTITEM,QString,int)), this, SLOT(slotProcessImportKeyframes(GRAPHICSRECTITEM,QString,int)));
+ connect(trackView->projectView(), SIGNAL(importKeyframes(GraphicsRectItem,QString,int)), this, SLOT(slotProcessImportKeyframes(GraphicsRectItem,QString,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(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView(), SLOT(seekCursorPos(int)));
connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView(), SLOT(seekCursorPos(int)));
- connect(m_effectStack, SIGNAL(importClipKeyframes(GRAPHICSRECTITEM)), trackView->projectView(), SLOT(slotImportClipKeyframes(GRAPHICSRECTITEM)));
+ connect(m_effectStack, SIGNAL(importClipKeyframes(GraphicsRectItem)), trackView->projectView(), SLOT(slotImportClipKeyframes(GraphicsRectItem)));
connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
connect(m_effectStack, SIGNAL(displayMessage(QString,int)), this, SLOT(slotGotProgressInfo(QString,int)));
// Transition config signals
connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition*,QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition*,QDomElement)));
connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
connect(m_effectStack, SIGNAL(displayMessage(QString,int)), this, SLOT(slotGotProgressInfo(QString,int)));
// Transition config signals
connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition*,QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition*,QDomElement)));
- connect(m_transitionConfig, SIGNAL(importClipKeyframes(GRAPHICSRECTITEM)), trackView->projectView() , SLOT(slotImportClipKeyframes(GRAPHICSRECTITEM)));
+ connect(m_transitionConfig, SIGNAL(importClipKeyframes(GraphicsRectItem)), trackView->projectView() , SLOT(slotImportClipKeyframes(GraphicsRectItem)));
connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(seekCursorPos(int)));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(seekCursorPos(int)));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
* cached, in which case you want to display the cached dialog
* instead of creating another one
*/
* cached, in which case you want to display the cached dialog
* instead of creating another one
*/
if (KConfigDialog::showDialog("settings")) {
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
if (page != -1) d->showPage(page, option);
if (KConfigDialog::showDialog("settings")) {
KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
if (page != -1) d->showPage(page, option);
connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
#endif
dialog->show();
connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
#endif
dialog->show();
void MainWindow::slotSwitchVideoThumbs()
{
KdenliveSettings::setVideothumbnails(!KdenliveSettings::videothumbnails());
void MainWindow::slotSwitchVideoThumbs()
{
KdenliveSettings::setVideothumbnails(!KdenliveSettings::videothumbnails());
void MainWindow::slotSwitchMarkersComments()
{
KdenliveSettings::setShowmarkers(!KdenliveSettings::showmarkers());
void MainWindow::slotSwitchMarkersComments()
{
KdenliveSettings::setShowmarkers(!KdenliveSettings::showmarkers());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
- if (!effect.isNull()) slotAddEffect(effect);
- else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2", info.at(0), info.at(1)), ErrorMessage);
+ }
+
+ if (!effect.isNull()) {
+ slotAddEffect(effect);
+ } else {
+ m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2", info.at(0), info.at(1)), ErrorMessage);
+ }
value = qMax(m_zoomSlider->minimum(), value);
value = qMin(m_zoomSlider->maximum(), value);
value = qMax(m_zoomSlider->minimum(), value);
value = qMin(m_zoomSlider->maximum(), value);
m_zoomOut->setEnabled(value < m_zoomSlider->maximum());
m_zoomIn->setEnabled(value > m_zoomSlider->minimum());
m_zoomOut->setEnabled(value < m_zoomSlider->maximum());
m_zoomIn->setEnabled(value > m_zoomSlider->minimum());
QString titlepath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
if (!clip->getProperty("resource").isEmpty() && clip->getProperty("xmldata").isEmpty()) {
// template text clip
QString titlepath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
if (!clip->getProperty("resource").isEmpty() && clip->getProperty("xmldata").isEmpty()) {
// template text clip
dia_ui.description->setText(clip->getProperty("description"));
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
dia_ui.description->setText(clip->getProperty("description"));
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
- if (description.isEmpty()) description = clip->getProperty("description");
- else newprops.insert("templatetext", description);
+ if (description.isEmpty()) {
+ description = clip->getProperty("description");
+ } else {
+ newprops.insert("templatetext", description);
+ }
+
//newprops.insert("xmldata", m_projectList->generateTemplateXml(newtemplate, description).toString());
if (!newprops.isEmpty()) {
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newprops), newprops, true);
//newprops.insert("xmldata", m_projectList->generateTemplateXml(newtemplate, description).toString());
if (!newprops.isEmpty()) {
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newprops), newprops, true);
// duration changed, we need to update duration
newprops.insert("out", QString::number(dia_ui->duration() - 1));
int currentLength = QString(clip->producerProperty("length")).toInt();
// duration changed, we need to update duration
newprops.insert("out", QString::number(dia_ui->duration() - 1));
int currentLength = QString(clip->producerProperty("length")).toInt();
// any type of clip but a title
ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
// any type of clip but a title
ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
// request clip thumbnails
connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(QString,QImage)), dia, SLOT(slotGotThumbnail(QString,QImage)));
connect(dia, SIGNAL(requestThumb(QString,QList<int>)), m_activeDocument->clipManager(), SLOT(slotRequestThumbs(QString,QList<int>)));
// request clip thumbnails
connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(QString,QImage)), dia, SLOT(slotGotThumbnail(QString,QImage)));
connect(dia, SIGNAL(requestThumb(QString,QList<int>)), m_activeDocument->clipManager(), SLOT(slotRequestThumbs(QString,QList<int>)));
-void MainWindow::slotApplyNewClipProperties(const QString id, QMap <QString, QString> props, QMap <QString, QString> newprops, bool refresh, bool reload)
+void MainWindow::slotApplyNewClipProperties(const QString &id, const QMap <QString, QString> &props, const QMap <QString, QString> &newprops, bool refresh, bool reload)
EditClipCommand *command = new EditClipCommand(m_projectList, id, props, newprops, true);
m_activeDocument->commandStack()->push(command);
m_activeDocument->setModified();
EditClipCommand *command = new EditClipCommand(m_projectList, id, props, newprops, true);
m_activeDocument->commandStack()->push(command);
m_activeDocument->setModified();
new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newImageProps), newImageProps, true, command);
else
new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newProps), newProps, true, command);
}
m_activeDocument->commandStack()->push(command);
new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newImageProps), newImageProps, true, command);
else
new EditClipCommand(m_projectList, clip->getId(), clip->currentProperties(newProps), newProps, true, command);
}
m_activeDocument->commandStack()->push(command);
void MainWindow::slotTimelineClipSelected(ClipItem* item, bool raise)
{
if (item != m_mainClip) {
void MainWindow::slotTimelineClipSelected(ClipItem* item, bool raise)
{
if (item != m_mainClip) {
}
void MainWindow::slotTrackSelected(int index, const TrackInfo &info, bool raise)
{
m_effectStack->slotTrackItemSelected(index, info);
}
void MainWindow::slotTrackSelected(int index, const TrackInfo &info, bool raise)
{
m_effectStack->slotTrackItemSelected(index, info);
m_transitionConfig->raiseWindow(m_transitionConfigDock);
}
void MainWindow::slotSnapRewind()
{
if (m_projectMonitor->isActive()) {
m_transitionConfig->raiseWindow(m_transitionConfigDock);
}
void MainWindow::slotSnapRewind()
{
if (m_projectMonitor->isActive()) {
- if (m_mainClip) clipIds << m_mainClip->clipProducer();
- else clipIds = m_activeTimeline->projectView()->selectedClips();
- if (clipIds.isEmpty())
+ if (m_mainClip) {
+ clipIds << m_mainClip->clipProducer();
+ } else {
+ clipIds = m_activeTimeline->projectView()->selectedClips();
+ }
+ if (clipIds.isEmpty()) {
QLabel *label1 = new QLabel(i18n("Save clip zone as:"), this);
if (path.isEmpty()) {
QString tmppath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash);
QLabel *label1 = new QLabel(i18n("Save clip zone as:"), this);
if (path.isEmpty()) {
QString tmppath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash);
KNS3::Entry::List entries;
#if KDE_IS_VERSION(4,3,80)
QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog(configFile);
KNS3::Entry::List entries;
#if KDE_IS_VERSION(4,3,80)
QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog(configFile);
foreach(const KNS3::Entry & entry, entries) {
if (entry.status() == KNS3::Entry::Installed)
kDebug() << "// Installed files: " << entry.installedFiles();
foreach(const KNS3::Entry & entry, entries) {
if (entry.status() == KNS3::Entry::Installed)
kDebug() << "// Installed files: " << entry.installedFiles();
void MainWindow::slotDvdWizard(const QString &url)
{
// We must stop the monitors since we create a new on in the dvd wizard
void MainWindow::slotDvdWizard(const QString &url)
{
// We must stop the monitors since we create a new on in the dvd wizard
QAction *action = qobject_cast<QAction *>(sender());
QStringList data = action->data().toStringList();
params = data.at(0);
QAction *action = qobject_cast<QAction *>(sender());
QStringList data = action->data().toStringList();
params = data.at(0);
QList <DocClipBase*> list = m_projectList->documentClipList();
QDomDocument doc = m_activeDocument->xmlSceneList(m_projectMonitor->sceneList(), m_projectList->expandedFolders());
ArchiveWidget *d = new ArchiveWidget(m_activeDocument->url().fileName(), doc, list, m_activeTimeline->projectView()->extractTransitionsLumas(), this);
QList <DocClipBase*> list = m_projectList->documentClipList();
QDomDocument doc = m_activeDocument->xmlSceneList(m_projectMonitor->sceneList(), m_projectList->expandedFolders());
ArchiveWidget *d = new ArchiveWidget(m_activeDocument->url().fileName(), doc, list, m_activeTimeline->projectView()->extractTransitionsLumas(), this);
-void MainWindow::slotProcessImportKeyframes(GRAPHICSRECTITEM type, const QString& data, int maximum)
+void MainWindow::slotProcessImportKeyframes(GraphicsRectItem type, const QString& data, int maximum)
// This data should be sent to the effect stack
m_effectStack->setKeyframes(data, maximum);
}
// This data should be sent to the effect stack
m_effectStack->setKeyframes(data, maximum);
}
// This data should be sent to the transition stack
m_transitionConfig->setKeyframes(data, maximum);
}
// This data should be sent to the transition stack
m_transitionConfig->setKeyframes(data, maximum);
}