]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
On-Monitor effects:
[kdenlive] / src / mainwindow.cpp
index e66e0b4882a8683c5d581a8c85f74c4806e8da3e..2d26459dfae583f9b50b30c307a1886245b9f921 100644 (file)
@@ -176,18 +176,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
     m_projectListDock->setWidget(m_projectList);
     addDockWidget(Qt::TopDockWidgetArea, m_projectListDock);
 
-    m_effectStackDock = new QDockWidget(i18n("Effect Stack"), this);
-    m_effectStackDock->setObjectName("effect_stack");
-    m_effectStack = new EffectStackView(this);
-    m_effectStackDock->setWidget(m_effectStack);
-    addDockWidget(Qt::TopDockWidgetArea, m_effectStackDock);
-
-    m_transitionConfigDock = new QDockWidget(i18n("Transition"), this);
-    m_transitionConfigDock->setObjectName("transition");
-    m_transitionConfig = new TransitionSettings(this);
-    m_transitionConfigDock->setWidget(m_transitionConfig);
-    addDockWidget(Qt::TopDockWidgetArea, m_transitionConfigDock);
-
     m_clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
     m_clipMonitorDock->setObjectName("clip_monitor");
     m_clipMonitor = new Monitor("clip", m_monitorManager, QString(), this);
@@ -210,6 +198,18 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
     connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int)));
 #endif
 
+    m_effectStackDock = new QDockWidget(i18n("Effect Stack"), this);
+    m_effectStackDock->setObjectName("effect_stack");
+    m_effectStack = new EffectStackView(m_projectMonitor, this);
+    m_effectStackDock->setWidget(m_effectStack);
+    addDockWidget(Qt::TopDockWidgetArea, m_effectStackDock);
+
+    m_transitionConfigDock = new QDockWidget(i18n("Transition"), this);
+    m_transitionConfigDock->setObjectName("transition");
+    m_transitionConfig = new TransitionSettings(m_projectMonitor, this);
+    m_transitionConfigDock->setWidget(m_transitionConfig);
+    addDockWidget(Qt::TopDockWidgetArea, m_transitionConfigDock);
+
     m_effectListDock = new QDockWidget(i18n("Effect List"), this);
     m_effectListDock->setObjectName("effect_list");
     m_effectList = new EffectsListView();
@@ -467,13 +467,13 @@ void MainWindow::queryQuit()
     if (queryClose()) {
         if (m_projectMonitor) m_projectMonitor->stop();
         if (m_clipMonitor) m_clipMonitor->stop();
-        delete m_effectStack;
         delete m_activeTimeline;
 #ifndef Q_WS_MAC
         // This sometimes causes crash on exit on OS X for some reason.
         delete m_projectMonitor;
         delete m_clipMonitor;
 #endif
+        delete m_effectStack;
         delete m_activeDocument;
         delete m_shortcutRemoveFocus;
         Mlt::Factory::close();
@@ -1977,7 +1977,7 @@ void MainWindow::slotRenderProject()
         QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
         m_renderWidget = new RenderWidget(projectfolder, this);
         connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
-        connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &, const QString &, const QString&, bool, bool, int, int)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &, const QString &, const QString&, bool, bool, int, int)));
+        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&)));
         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 &)));
@@ -1985,7 +1985,7 @@ void MainWindow::slotRenderProject()
             m_renderWidget->setProfile(m_activeDocument->mltProfile());
             m_renderWidget->setGuides(m_activeDocument->guidesXml(), m_activeDocument->projectDuration());
             m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
-            m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("rendercategory"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"), m_activeDocument->getDocumentProperty("renderzone") == "1", m_activeDocument->getDocumentProperty("renderguide") == "1", m_activeDocument->getDocumentProperty("startguide").toInt(), m_activeDocument->getDocumentProperty("endguide").toInt());
+            m_renderWidget->setRenderProfile(m_activeDocument->getRenderProperties());
         }
     }
     slotCheckRenderStatus();
@@ -2099,6 +2099,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int)));
             disconnect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
             disconnect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
+            disconnect(m_effectStack, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const 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_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
@@ -2136,6 +2137,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView, SIGNAL(configTrack(int)), this, SLOT(slotConfigTrack(int)));
     connect(trackView, SIGNAL(updateTracksInfo()), this, SLOT(slotUpdateTrackInfo()));
     connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
+    connect(trackView->projectView(), SIGNAL(forceClipProcessing(const QString &)), m_projectList, SLOT(slotForceProcessing(const QString &)));
     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
     connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));
@@ -2181,6 +2183,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
     connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
     connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
+    connect(m_effectStack, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
 
     connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
     connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
@@ -2196,7 +2199,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
         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("rendercategory"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"), doc->getDocumentProperty("renderzone") == "1", doc->getDocumentProperty("renderguide") == "1", doc->getDocumentProperty("startguide").toInt(), doc->getDocumentProperty("endguide").toInt());
+        m_renderWidget->setRenderProfile(doc->getRenderProperties());
     }
     //doc->setRenderer(m_projectMonitor->render);
     m_commandStack->setActiveStack(doc->commandStack());
@@ -2286,6 +2289,7 @@ void MainWindow::updateConfiguration()
     }
     m_buttonAudioThumbs->setChecked(KdenliveSettings::audiothumbnails());
     m_buttonVideoThumbs->setChecked(KdenliveSettings::videothumbnails());
+    m_buttonShowMarkers->setChecked(KdenliveSettings::showmarkers());
     m_buttonAutomaticSplitAudio->setChecked(KdenliveSettings::splitaudio());
 
     // Update list of transcoding profiles
@@ -3358,17 +3362,14 @@ void MainWindow::slotTranscodeClip()
     slotTranscode(urls);
 }
 
-void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file, bool renderZone, bool renderGuide, int startGuide, int endGuide)
+void MainWindow::slotSetDocumentRenderProfile(QMap <QString, QString> props)
 {
     if (m_activeDocument == NULL) return;
-    m_activeDocument->setDocumentProperty("renderdestination", dest);
-    m_activeDocument->setDocumentProperty("rendercategory", group);
-    m_activeDocument->setDocumentProperty("renderprofile", name);
-    m_activeDocument->setDocumentProperty("renderurl", file);
-    m_activeDocument->setDocumentProperty("renderzone", QString::number(renderZone));
-    m_activeDocument->setDocumentProperty("renderguide", QString::number(renderGuide));
-    m_activeDocument->setDocumentProperty("startguide", QString::number(startGuide));
-    m_activeDocument->setDocumentProperty("endguide", QString::number(endGuide));
+    QMapIterator<QString, QString> i(props);
+    while (i.hasNext()) {
+        i.next();
+        m_activeDocument->setDocumentProperty(i.key(), i.value());
+    }
     m_activeDocument->setModified(true);
 }