]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
* Fix aspect ratio of thumbnails to correctly use the project's arpect ratio
[kdenlive] / src / mainwindow.cpp
index ccda3a2c4495ec45048fc4eb5cea4dfd1d4c6b06..42bf7ac76be153586b9741b52c65c63ce6118e75 100644 (file)
@@ -87,7 +87,6 @@
 #include <KProcess>
 #include <KActionMenu>
 #include <KMenu>
-#include <locale.h>
 #include <ktogglefullscreenaction.h>
 #include <KFileItem>
 #include <KNotification>
@@ -148,13 +147,19 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
 #endif /* NO_JOGSHUTTLE */
     m_findActivated(false),
     m_stopmotion(NULL)
-{
+{   
     qRegisterMetaType<QVector<int16_t> > ();
+
+    // Init locale
+    QLocale systemLocale = QLocale();
+    systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
+    QLocale::setDefault(systemLocale);
+
     // Create DBus interface
     new MainWindowAdaptor(this);
     QDBusConnection dbus = QDBusConnection::sessionBus();
     dbus.registerObject("/MainWindow", this);
-    //setlocale(LC_NUMERIC, "POSIX");
+
     if (!KdenliveSettings::colortheme().isEmpty()) slotChangePalette(NULL, KdenliveSettings::colortheme());
     setFont(KGlobalSettings::toolBarFont());
     parseProfiles(MltPath);
@@ -2086,13 +2091,6 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
     m_clipMonitor->refreshMonitor(true);
 
     progressDialog.progressBar()->setValue(4);
-    bool readOnly = !doc->isReadOnly();
-    factory()->container("edit", this)->setEnabled(readOnly);
-    factory()->container("project", this)->setEnabled(readOnly);
-    factory()->container("tool", this)->setEnabled(readOnly);
-    factory()->container("clip", this)->setEnabled(readOnly);
-    factory()->container("timeline", this)->setEnabled(readOnly);
-    factory()->container("monitor", this)->setEnabled(readOnly);
     if (openBackup) slotOpenBackupDialog(url);
 }
 
@@ -2298,6 +2296,8 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile)
     if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
     m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
     if (updateFps) m_activeTimeline->updateProjectFps();
+    m_activeDocument->clipManager()->clearCache();
+    m_activeTimeline->updateProfile();
     m_activeDocument->setModified(true);
     m_commandStack->activeStack()->clear();
     //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
@@ -2373,7 +2373,7 @@ void MainWindow::slotUpdateMousePosition(int pos)
 
 void MainWindow::slotUpdateDocumentState(bool modified)
 {
-    if (!m_activeDocument || m_activeDocument->isReadOnly()) return;
+    if (!m_activeDocument) return;
     setCaption(m_activeDocument->description(), modified);
     m_saveAction->setEnabled(modified);
     if (modified) {
@@ -2495,7 +2495,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
 
     connect(doc, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
     connect(doc, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
-    connect(doc, SIGNAL(saveTimelinePreview(const QString)), trackView, SLOT(slotSaveTimelinePreview(const QString)));
+    connect(doc, SIGNAL(saveTimelinePreview(const QString &)), trackView, SLOT(slotSaveTimelinePreview(const QString)));
     
     connect(m_notesWidget, SIGNAL(textChanged()), doc, SLOT(setModified()));
 
@@ -2641,7 +2641,7 @@ void MainWindow::updateConfiguration()
     if (m_activeTimeline) {
         m_activeTimeline->refresh();
         m_activeTimeline->projectView()->checkAutoScroll();
-        m_activeTimeline->projectView()->checkTrackHeight();
+        m_activeTimeline->checkTrackHeight();
         if (m_activeDocument)
             m_activeDocument->clipManager()->checkAudioThumbs();
     }
@@ -3884,11 +3884,23 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
     if (m_renderWidget->automaticAudioExport()) {
         exportAudio = m_activeTimeline->checkProjectAudio();
     } else exportAudio = m_renderWidget->selectedAudioExport();
+
+    // Set playlist audio volume to 100%
+    QDomDocument doc;
+    doc.setContent(playlistContent);
+    QDomElement tractor = doc.documentElement().firstChildElement("tractor");
+    if (!tractor.isNull()) {
+        QDomNodeList props = tractor.elementsByTagName("property");
+        for (int i = 0; i < props.count(); i++) {
+            if (props.at(i).toElement().attribute("name") == "meta.volume") {
+                props.at(i).firstChild().setNodeValue("1");
+                break;
+            }
+        }
+    }
     
     // Do we want proxy rendering
     if (m_projectList->useProxy() && !m_renderWidget->proxyRendering()) {
-        QDomDocument doc;
-        doc.setContent(playlistContent);
         QString root = doc.documentElement().attribute("root");
 
         // replace proxy clips with originals
@@ -3932,8 +3944,8 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
                 playlistContent.replace(key, i.value());
             }
         }*/
-        playlistContent = doc.toString();
     }
+    playlistContent = doc.toString();
     
     // Do save scenelist
     QFile file(playlistPath);
@@ -4290,7 +4302,7 @@ void MainWindow::slotOpenStopmotion()
 {
     if (m_stopmotion == NULL) {
         m_stopmotion = new StopmotionWidget(m_monitorManager, m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this);
-        connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
+        connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString &)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
         //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;*/