]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Reorganise (again) the build system
[kdenlive] / src / mainwindow.cpp
index 946af2724fe3721b1232bec02bfc5c6d39d7d31d..f41a7fb1ac1502f819a5bd0457c94869eebd2af3 100644 (file)
 #include "renderwidget.h"
 #include "renderer.h"
 #include "audiosignal.h"
-#ifndef NO_JOGSHUTTLE
+#ifdef USE_JOGSHUTTLE
 #include "jogshuttle.h"
 #include "jogaction.h"
 #include "jogshuttleconfig.h"
-#endif /* NO_JOGSHUTTLE */
+#endif
 #include "clipproperties.h"
 #include "wizard.h"
-#include "editclipcommand.h"
+#include "commands/editclipcommand.h"
 #include "titlewidget.h"
 #include "markerdialog.h"
 #include "clipitem.h"
@@ -59,8 +59,8 @@
 #include "colorscopes/waveform.h"
 #include "colorscopes/rgbparade.h"
 #include "colorscopes/histogram.h"
-#include "audiospectrum.h"
-#include "spectrogram.h"
+#include "audioscopes/audiospectrum.h"
+#include "audioscopes/spectrogram.h"
 #include "archivewidget.h"
 #include "databackup/backupwidget.h"
 
 #include <KFileItem>
 #include <KNotification>
 #include <KNotifyConfigWidget>
-#if KDE_IS_VERSION(4,3,80)
 #include <knewstuff3/downloaddialog.h>
 #include <knewstuff3/knewstuffaction.h>
-#else
-#include <knewstuff2/engine.h>
-#include <knewstuff2/ui/knewstuffaction.h>
-#define KNS3 KNS
-#endif /* KDE_IS_VERSION(4,3,80) */
 #include <KToolBar>
 #include <KColorScheme>
 #include <KProgressDialog>
@@ -143,10 +137,10 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_activeTimeline(NULL),
     m_recMonitor(NULL),
     m_renderWidget(NULL),
-#ifndef NO_JOGSHUTTLE
+#ifdef USE_JOGSHUTTLE
     m_jogProcess(NULL),
     m_jogShuttle(NULL),
-#endif /* NO_JOGSHUTTLE */
+#endif
     m_findActivated(false),
     m_stopmotion(NULL)
 {   
@@ -182,7 +176,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     closeTabButton->adjustSize();
     closeTabButton->setToolTip(i18n("Close the current tab"));
     m_timelineArea->setCornerWidget(closeTabButton);
-    connect(m_timelineArea, SIGNAL(currentChanged(int)), this, SLOT(activateDocument()));
+    //connect(m_timelineArea, SIGNAL(currentChanged(int)), this, SLOT(activateDocument()));
 
     connect(&m_findTimer, SIGNAL(timeout()), this, SLOT(findTimeout()));
     m_findTimer.setSingleShot(true);
@@ -225,7 +219,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
     connect(m_recMonitor, SIGNAL(addProjectClipList(KUrl::List)), this, SLOT(slotAddProjectClipList(KUrl::List)));
     connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int)));
-#endif
+#endif /* ! Q_WS_MAC */
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor, m_recMonitor);
 
     m_notesDock = new QDockWidget(i18n("Project Notes"), this);
@@ -235,9 +229,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     connect(m_notesWidget, SIGNAL(seekProject(int)), m_projectMonitor->render, SLOT(seekToFrame(int)));
     
     m_notesWidget->setTabChangesFocus(true);
-#if KDE_IS_VERSION(4,4,0)
     m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
-#endif
     m_notesDock->setWidget(m_notesWidget);
     addDockWidget(Qt::TopDockWidgetArea, m_notesDock);
 
@@ -606,9 +598,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
         m_projectList->slotAddClip(urls);
     }
 
-#ifndef NO_JOGSHUTTLE
+#ifdef USE_JOGSHUTTLE
     activateShuttleDevice();
-#endif /* NO_JOGSHUTTLE */
+#endif
     m_projectListDock->raise();
 
     actionCollection()->addAssociatedWidget(m_clipMonitor->container());
@@ -622,7 +614,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
         QMapIterator<QString, QString> i(values);
         if (i.hasNext()) {
             i.next();
-            KdenliveSettings::setProxy_profile(i.key());
             QString data = i.value();
             KdenliveSettings::setProxyparams(data.section(';', 0, 0));
             KdenliveSettings::setProxyextension(data.section(';', 1, 1));
@@ -634,7 +625,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
         QMapIterator<QString, QString> i(values);
         if (i.hasNext()) {
             i.next();
-            KdenliveSettings::setV4l_profile(i.key());
             QString data = i.value();
             KdenliveSettings::setV4l_parameters(data.section(';', 0, 0));
             KdenliveSettings::setV4l_extension(data.section(';', 1, 1));
@@ -646,7 +636,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
         QMapIterator<QString, QString> i(values);
         if (i.hasNext()) {
             i.next();
-            KdenliveSettings::setDecklink_profile(i.key());
             QString data = i.value();
             KdenliveSettings::setDecklink_parameters(data.section(';', 0, 0));
             KdenliveSettings::setDecklink_extension(data.section(';', 1, 1));
@@ -823,7 +812,7 @@ void MainWindow::slotReloadEffects()
     m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
 }
 
-#ifndef NO_JOGSHUTTLE
+#ifdef USE_JOGSHUTTLE
 void MainWindow::activateShuttleDevice()
 {
     delete m_jogShuttle;
@@ -841,7 +830,7 @@ void MainWindow::activateShuttleDevice()
     connect(m_jogShuttle, SIGNAL(forward(double)), m_monitorManager, SLOT(slotForward(double)));
     connect(m_jogShuttle, SIGNAL(action(const QString&)), this, SLOT(slotDoAction(const QString&)));
 }
-#endif /* NO_JOGSHUTTLE */
+#endif /* USE_JOGSHUTTLE */
 
 void MainWindow::slotDoAction(const QString& action_name)
 {
@@ -1906,6 +1895,7 @@ bool MainWindow::closeCurrentDocument(bool saveChanges)
         }
     }
     m_clipMonitor->slotSetClipProducer(NULL);
+    m_projectList->slotResetProjectList();
     m_timelineArea->removeTab(m_timelineArea->indexOf(w));
     if (m_timelineArea->count() == 1) {
         m_timelineArea->setTabBarHidden(true);
@@ -2102,7 +2092,7 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
 
     bool ok;
     TrackView *trackView = new TrackView(doc, &ok, this);
-
+    connectDocument(trackView, doc);
     progressDialog.progressBar()->setValue(3);
     qApp->processEvents();
 
@@ -2253,7 +2243,7 @@ void MainWindow::slotEditProjectSettings()
     if (w->exec() == QDialog::Accepted) {
         QString profile = w->selectedProfile();
         m_activeDocument->setProjectFolder(w->selectedFolder());
-#ifndef   Q_WS_MAC
+#ifndef Q_WS_MAC
         m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
 #endif
         if (m_renderWidget) m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
@@ -2597,7 +2587,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_activeDocument = doc;
     m_activeTimeline->updateProjectFps();
     m_activeDocument->checkProjectClips();
-#ifndef   Q_WS_MAC
+#ifndef Q_WS_MAC
     m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
 #endif
     //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
@@ -2664,7 +2654,7 @@ void MainWindow::slotPreferences(int page, int option)
 void MainWindow::slotUpdateCaptureFolder()
 {
 
-#ifndef   Q_WS_MAC
+#ifndef Q_WS_MAC
     if (m_activeDocument) m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
     else m_recMonitor->slotUpdateCaptureFolder(KdenliveSettings::defaultprojectfolder());
 #endif
@@ -2687,9 +2677,9 @@ void MainWindow::updateConfiguration()
 
     // Update list of transcoding profiles
     loadTranscoders();
-#ifndef NO_JOGSHUTTLE
+#ifdef USE_JOGSHUTTLE
     activateShuttleDevice();
-#endif /* NO_JOGSHUTTLE */
+#endif
 
 }
 
@@ -3677,7 +3667,6 @@ void MainWindow::slotResizeItemEnd()
 int MainWindow::getNewStuff(const QString &configFile)
 {
     KNS3::Entry::List entries;
-#if KDE_IS_VERSION(4,3,80)
     KNS3::DownloadDialog dialog(configFile);
     dialog.exec();
     entries = dialog.changedEntries();
@@ -3685,15 +3674,6 @@ int MainWindow::getNewStuff(const QString &configFile)
         if (entry.status() == KNS3::Entry::Installed)
             kDebug() << "// Installed files: " << entry.installedFiles();
     }
-#else
-    KNS::Engine engine(0);
-    if (engine.init(configFile))
-        entries = engine.downloadDialogModal(this);
-    foreach(KNS::Entry * entry, entries) {
-        if (entry->status() == KNS::Entry::Installed)
-            kDebug() << "// Installed files: " << entry->installedFiles();
-    }
-#endif /* KDE_IS_VERSION(4,3,80) */
     return entries.size();
 }
 
@@ -3969,6 +3949,7 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
                     // We need to delete the "aspect_ratio" property because proxy clips
                     // sometimes have different ratio than original clips
                     EffectsList::removeProperty(e, "aspect_ratio");
+                    EffectsList::removeMetaProperties(e);
                 }
             }
         }