]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Double click on monitor overlay info to edit a marker
[kdenlive] / src / mainwindow.cpp
index fe5a3dc987d6eacc46e4448b2194103c4ae613ae..5c36eb9ada3da9d9fc16bd7253f33cbc0cbf6e54 100644 (file)
 
 #include <stdlib.h>
 
+// Uncomment for deeper debugging
+//#define DEBUG_MAINW
+
+#ifdef DEBUG_MAINW
+#include <QDebug>
+#endif
+
 static const char version[] = VERSION;
 
 static const int ID_TIMELINE_POS = 0;
@@ -149,6 +156,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     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);
@@ -242,9 +250,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_vectorscopeDock->setWidget(m_vectorscope);
     addDockWidget(Qt::TopDockWidgetArea, m_vectorscopeDock);
     connect(m_vectorscopeDock, SIGNAL(visibilityChanged(bool)), m_vectorscope, SLOT(forceUpdate(bool)));
-    connect(m_vectorscopeDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    connect(m_vectorscope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    m_scopesList.append(m_vectorscopeDock);
+    connect(m_vectorscopeDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    connect(m_vectorscope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    m_gfxScopesList.append(m_vectorscopeDock);
 
     m_waveform = new Waveform(m_projectMonitor, m_clipMonitor);
     m_waveformDock = new QDockWidget(i18n("Waveform"), this);
@@ -252,9 +260,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_waveformDock->setWidget(m_waveform);
     addDockWidget(Qt::TopDockWidgetArea, m_waveformDock);
     connect(m_waveformDock, SIGNAL(visibilityChanged(bool)), m_waveform, SLOT(forceUpdate(bool)));
-    connect(m_waveformDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    connect(m_waveform, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    m_scopesList.append(m_waveformDock);
+    connect(m_waveformDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    connect(m_waveform, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    m_gfxScopesList.append(m_waveformDock);
 
     m_RGBParade = new RGBParade(m_projectMonitor, m_clipMonitor);
     m_RGBParadeDock = new QDockWidget(i18n("RGB Parade"), this);
@@ -262,9 +270,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_RGBParadeDock->setWidget(m_RGBParade);
     addDockWidget(Qt::TopDockWidgetArea, m_RGBParadeDock);
     connect(m_RGBParadeDock, SIGNAL(visibilityChanged(bool)), m_RGBParade, SLOT(forceUpdate(bool)));
-    connect(m_RGBParadeDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    connect(m_RGBParade, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    m_scopesList.append(m_RGBParadeDock);
+    connect(m_RGBParadeDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    connect(m_RGBParade, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    m_gfxScopesList.append(m_RGBParadeDock);
 
     m_histogram = new Histogram(m_projectMonitor, m_clipMonitor);
     m_histogramDock = new QDockWidget(i18n("Histogram"), this);
@@ -272,9 +280,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_histogramDock->setWidget(m_histogram);
     addDockWidget(Qt::TopDockWidgetArea, m_histogramDock);
     connect(m_histogramDock, SIGNAL(visibilityChanged(bool)), m_histogram, SLOT(forceUpdate(bool)));
-    connect(m_histogramDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    connect(m_histogram, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
-    m_scopesList.append(m_histogramDock);
+    connect(m_histogramDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    connect(m_histogram, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest()));
+    m_gfxScopesList.append(m_histogramDock);
 
 
     m_audiosignal = new AudioSignal;
@@ -282,25 +290,27 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_audiosignalDock->setObjectName("audiosignal");
     m_audiosignalDock->setWidget(m_audiosignal);
     addDockWidget(Qt::TopDockWidgetArea, m_audiosignalDock);
-    connect(m_audiosignal, SIGNAL(updateAudioMonitoring()), m_monitorManager, SLOT(slotUpdateAudioMonitoring()));
-    /*if (m_projectMonitor) {
-        connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
-    }
-    if (m_clipMonitor) {
-        connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
-    }*/
+//    connect(m_audiosignal, SIGNAL(updateAudioMonitoring()), m_monitorManager, SLOT(slotUpdateAudioMonitoring()));
+    connect(m_audiosignalDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
+    connect(m_audiosignal, SIGNAL(updateAudioMonitoring()), this, SLOT(slotUpdateAudioScopeFrameRequest()));
 
     m_audioSpectrum = new AudioSpectrum();
     m_audioSpectrumDock = new QDockWidget(i18n("AudioSpectrum"), this);
     m_audioSpectrumDock->setObjectName(m_audioSpectrum->widgetName());
     m_audioSpectrumDock->setWidget(m_audioSpectrum);
     addDockWidget(Qt::TopDockWidgetArea, m_audioSpectrumDock);
+    m_audioScopesList.append(m_audioSpectrum);
+    connect(m_audioSpectrumDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
+    connect(m_audioSpectrum, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
 
     m_spectrogram = new Spectrogram();
     m_spectrogramDock = new QDockWidget(i18n("Spectrogram"), this);
     m_spectrogramDock->setObjectName(m_spectrogram->widgetName());
     m_spectrogramDock->setWidget(m_spectrogram);
     addDockWidget(Qt::TopDockWidgetArea, m_spectrogramDock);
+    m_audioScopesList.append(m_spectrogram);
+    connect(m_audioSpectrumDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
+    connect(m_audioSpectrum, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
 
     // Connect the audio signal to the audio scope slots
     bool b = true;
@@ -364,7 +374,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     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());
@@ -372,20 +381,23 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
 
     // 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);
@@ -408,10 +420,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     /*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*)));
@@ -609,13 +617,6 @@ MainWindow::~MainWindow()
     Mlt::Factory::close();
 }
 
-void MainWindow::queryQuit()
-{
-    if (queryClose()) {
-        close();
-    }
-}
-
 //virtual
 bool MainWindow::queryClose()
 {
@@ -854,13 +855,14 @@ void MainWindow::slotConnectMonitors()
     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_projectMonitor->render, SIGNAL(removeInvalidProxy(const QString &)), m_projectList, SLOT(slotRemoveInvalidProxy(const QString &)));
 
-    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()));
@@ -1420,6 +1422,7 @@ void MainWindow::setupActions()
     connect(deleteAllClipMarkers, SIGNAL(triggered(bool)), this, SLOT(slotDeleteAllClipMarkers()));
 
     KAction* editClipMarker = new KAction(KIcon("document-properties"), i18n("Edit Marker"), this);
+    editClipMarker->setData(QString("edit_marker"));
     collection.addAction("edit_clip_marker", editClipMarker);
     connect(editClipMarker, SIGNAL(triggered(bool)), this, SLOT(slotEditClipMarker()));
 
@@ -1518,7 +1521,7 @@ void MainWindow::setupActions()
     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);
@@ -1667,12 +1670,11 @@ void MainWindow::slotDisplayActionMessage(QAction *a)
 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
@@ -1689,7 +1691,7 @@ void MainWindow::loadLayouts()
                 }
                 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;
                     }
@@ -1795,8 +1797,17 @@ void MainWindow::newFile(bool showProjectSettings, bool force)
     m_fileRevert->setEnabled(false);
     QString profileName = KdenliveSettings::default_profile();
     KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
+    QMap <QString, QString> documentProperties;
     QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
     if (!showProjectSettings) {
+        // set up default properties
+        documentProperties.insert("enableproxy", QString::number((int) KdenliveSettings::enableproxy()));
+        documentProperties.insert("generateproxy", QString::number((int) KdenliveSettings::generateproxy()));
+        documentProperties.insert("proxyminsize", QString::number(KdenliveSettings::proxyminsize()));
+        documentProperties.insert("proxyparams", KdenliveSettings::proxyparams());
+        documentProperties.insert("proxyextension", KdenliveSettings::proxyextension());
+        documentProperties.insert("generateimageproxy", QString::number((int) KdenliveSettings::generateimageproxy()));
+        documentProperties.insert("proxyimageminsize", QString::number(KdenliveSettings::proxyimageminsize()));
         if (!KdenliveSettings::activatetabs())
             if (!closeCurrentDocument())
                 return;
@@ -1814,11 +1825,19 @@ void MainWindow::newFile(bool showProjectSettings, bool force)
         profileName = w->selectedProfile();
         projectFolder = w->selectedFolder();
         projectTracks = w->tracks();
+        documentProperties.insert("enableproxy", QString::number((int) w->useProxy()));
+        documentProperties.insert("generateproxy", QString::number((int) w->generateProxy()));
+        documentProperties.insert("proxyminsize", QString::number(w->proxyMinSize()));
+        documentProperties.insert("proxyparams", w->proxyParams());
+        documentProperties.insert("proxyextension", w->proxyExtension());
+        documentProperties.insert("generateimageproxy", QString::number((int) w->generateImageProxy()));
+        documentProperties.insert("proxyimageminsize", QString::number(w->proxyImageMinSize()));
         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);
+    
+    KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, projectTracks, m_projectMonitor->render, m_notesWidget, this);
     doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
     bool ok;
     TrackView *trackView = new TrackView(doc, &ok, this);
@@ -2031,7 +2050,7 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
     progressDialog.progressBar()->setValue(0);
     qApp->processEvents();
 
-    KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog);
+    KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog);
 
     progressDialog.progressBar()->setValue(1);
     progressDialog.progressBar()->setMaximum(4);
@@ -2212,6 +2231,39 @@ void MainWindow::slotEditProjectSettings()
         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->clipManager()->clipsCount() > 0 && KMessageBox::questionYesNo(this, i18n("You have changed the proxy parameters. Do you want to recreate all proxy clips for this project?")) == KMessageBox::Yes) {
+                //TODO: rebuild all proxies
+                //m_activeDocument->rebuildAllProxies();
+            }
+        }
+        if (m_activeDocument->getDocumentProperty("proxyextension") != w->proxyExtension()) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyextension", w->proxyExtension());
+        }
+        if (m_activeDocument->getDocumentProperty("generateproxy") != QString::number((int) w->generateProxy())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("generateproxy", QString::number((int) w->generateProxy()));
+        }
+        if (m_activeDocument->getDocumentProperty("proxyminsize") != QString::number(w->proxyMinSize())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyminsize", QString::number(w->proxyMinSize()));
+        }
+        if (m_activeDocument->getDocumentProperty("generateimageproxy") != QString::number((int) w->generateImageProxy())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("generateimageproxy", QString::number((int) w->generateImageProxy()));
+        }
+        if (m_activeDocument->getDocumentProperty("proxyimageminsize") != QString::number(w->proxyImageMinSize())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyimageminsize", QString::number(w->proxyImageMinSize()));
+        }
+        if (QString::number((int) w->useProxy()) != m_activeDocument->getDocumentProperty("enableproxy")) {
+            m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) w->useProxy()));
+            m_activeDocument->setModified();
+            slotUpdateProxySettings();
+        }
     }
     delete w;
 }
@@ -2258,7 +2310,7 @@ void MainWindow::slotRenderProject()
 {
     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&)));
@@ -2396,11 +2448,12 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             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());
@@ -2410,7 +2463,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     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()));
@@ -2564,7 +2618,6 @@ void MainWindow::slotPreferences(int page, int option)
     
     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()));
@@ -3126,6 +3179,10 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
             if (dia_ui->outPoint() != clip->duration().frames(m_activeDocument->fps()) - 1) {
                 // duration changed, we need to update duration
                 newprops.insert("out", QString::number(dia_ui->outPoint()));
+                int currentLength = QString(clip->producerProperty("length")).toInt();
+                if (currentLength <= dia_ui->outPoint())
+                        newprops.insert("length", QString::number(dia_ui->outPoint() + 1));
+                else newprops.insert("length", clip->producerProperty("length"));
             }
             if (!path.isEmpty()) {
                 // we are editing an external file, asked if we want to detach from that file or save the result to that title file.
@@ -3173,9 +3230,17 @@ void MainWindow::slotShowClipProperties(QList <DocClipBase *> cliplist, QMap<QSt
     if (dia.exec() == QDialog::Accepted) {
         QUndoCommand *command = new QUndoCommand();
         command->setText(i18n("Edit clips"));
+        QMap <QString, QString> newImageProps = dia.properties();
+        // Transparency setting applies only for images
+        QMap <QString, QString> newProps = newImageProps;
+        newProps.remove("transparency");
+
         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++)
@@ -3732,16 +3797,14 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
                 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;
@@ -3796,6 +3859,32 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
     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);
 }
 
@@ -3996,38 +4085,42 @@ void MainWindow::slotMonitorRequestRenderFrame(bool request)
         m_projectMonitor->render->sendFrameForAnalysis = true;
         return;
     } else {
-        for (int i = 0; i < m_scopesList.count(); i++) {
-            if (m_scopesList.at(i)->isVisible() && tabifiedDockWidgets(m_scopesList.at(i)).isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
+        for (int i = 0; i < m_gfxScopesList.count(); i++) {
+            if (m_gfxScopesList.at(i)->isVisible() && tabifiedDockWidgets(m_gfxScopesList.at(i)).isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->autoRefreshEnabled()) {
                 request = true;
                 break;
             }
         }
     }
+#ifdef DEBUG_MAINW
+    qDebug() << "Any scope accepting new frames? " << request;
+#endif
     if (!request) {
         m_projectMonitor->render->sendFrameForAnalysis = false;
     }
 }
 
-void MainWindow::slotUpdateScopeFrameRequest()
+void MainWindow::slotUpdateGfxScopeFrameRequest()
 {
     // We need a delay to make sure widgets are hidden after a close event for example
-    QTimer::singleShot(500, this, SLOT(slotDoUpdateScopeFrameRequest()));
+    QTimer::singleShot(500, this, SLOT(slotDoUpdateGfxScopeFrameRequest()));
 }
 
-void MainWindow::slotDoUpdateScopeFrameRequest()
+void MainWindow::slotDoUpdateGfxScopeFrameRequest()
 {
     // Check scopes
     bool request = false;
-    for (int i = 0; i < m_scopesList.count(); i++) {
-        if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
-            kDebug() << "SCOPE VISIBLE: " << static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->widgetName();
+    for (int i = 0; i < m_gfxScopesList.count(); i++) {
+        if (!m_gfxScopesList.at(i)->widget()->visibleRegion().isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->autoRefreshEnabled()) {
+            kDebug() << "SCOPE VISIBLE: " << static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->widgetName();
             request = true;
             break;
         }
     }
     if (!request) {
-        if (!m_projectMonitor->effectSceneDisplayed())
+        if (!m_projectMonitor->effectSceneDisplayed()) {
             m_projectMonitor->render->sendFrameForAnalysis = false;
+        }
         m_clipMonitor->render->sendFrameForAnalysis = false;
     } else {
         m_projectMonitor->render->sendFrameForAnalysis = true;
@@ -4035,13 +4128,40 @@ void MainWindow::slotDoUpdateScopeFrameRequest()
     }
 }
 
+void MainWindow::slotUpdateAudioScopeFrameRequest()
+{
+    QTimer::singleShot(500, this, SLOT(slotDoUpdateAudioScopeFrameRequest()));
+}
+
+void MainWindow::slotDoUpdateAudioScopeFrameRequest()
+{
+    bool request = false;
+    for (int i = 0; i < m_audioScopesList.count(); i++) {
+        if (!m_audioScopesList.at(i)->visibleRegion().isEmpty() && m_audioScopesList.at(i)->autoRefreshEnabled()) {
+            kDebug() << "AUDIO SCOPE VISIBLE: " << m_audioScopesList.at(i)->widgetName();
+            request = true;
+            break;
+        }
+    }
+    // Handle audio signal separately (no common interface)
+    if (!m_audiosignal->visibleRegion().isEmpty() && m_audiosignal->monitoringEnabled()) {
+        kDebug() << "AUDIO SCOPE VISIBLE: " << "audiosignal";
+        request = true;
+    }
+#ifdef DEBUG_MAINW
+    qDebug() << "Scopes Requesting Audio data: " << request;
+#endif
+    KdenliveSettings::setMonitor_audio(request);
+    m_monitorManager->slotUpdateAudioMonitoring();
+}
+
 void MainWindow::slotUpdateColorScopes()
 {
     bool request = false;
-    for (int i = 0; i < m_scopesList.count(); i++) {
+    for (int i = 0; i < m_gfxScopesList.count(); i++) {
         // Check if we need the renderer to send a new frame for update
-        if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
-        static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive());
+        if (!m_gfxScopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
+        static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive());
     }
     if (request) {
         if (m_clipMonitor->isActive()) m_clipMonitor->render->sendFrameUpdate();
@@ -4054,10 +4174,10 @@ void MainWindow::slotOpenStopmotion()
     if (m_stopmotion == NULL) {
         m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this);
         connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
-        for (int i = 0; i < m_scopesList.count(); i++) {
+        for (int i = 0; i < m_gfxScopesList.count(); i++) {
             // Check if we need the renderer to send a new frame for update
             /*if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/
-            connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
+            connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
             //static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotMonitorCapture();
         }
     }
@@ -4073,5 +4193,16 @@ void MainWindow::slotDeleteClip(const QString &id)
     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
+#undef DEBUG_MAINW
+#endif