]> git.sesse.net Git - kdenlive/blobdiff - src/kdenlivedoc.cpp
Preview monitor volume should not affect rendering:
[kdenlive] / src / kdenlivedoc.cpp
index c4ca548dba24db61b5cc4ea1372e9c0296a7d2f7..8fb4b3761c5b9a4c9a0d22654504063216fb04f3 100644 (file)
@@ -52,7 +52,7 @@
 
 #include <mlt++/Mlt.h>
 
-const double DOCUMENTVERSION = 0.86;
+const double DOCUMENTVERSION = 0.87;
 
 KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, QString profileName, QMap <QString, QString> properties, const QPoint tracks, Render *render, KTextEdit *notes, bool *openBackup, MainWindow *parent, KProgressDialog *progressDialog) :
     QObject(parent),
@@ -371,6 +371,7 @@ QDomDocument KdenliveDoc::createEmptyDocument(QList <TrackInfo> tracks)
     // Creating new document
     QDomDocument doc;
     QDomElement mlt = doc.createElement("mlt");
+    mlt.setAttribute("LC_NUMERIC", "");
     doc.appendChild(mlt);
     
     // Create black producer
@@ -389,7 +390,7 @@ QDomDocument KdenliveDoc::createEmptyDocument(QList <TrackInfo> tracks)
 
     property = doc.createElement("property");
     property.setAttribute("name", "aspect_ratio");
-    value = doc.createTextNode(QString::number(0.0));
+    value = doc.createTextNode(QString::number(0));
     property.appendChild(value);
     blk.appendChild(property);
 
@@ -565,6 +566,18 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList e
         return sceneList;
     }
 
+    // Set playlist audio volume to 100%
+    QDomElement tractor = mlt.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;
+            }
+        }
+    }
+
     QDomElement addedXml = sceneList.createElement("kdenlivedoc");
     mlt.appendChild(addedXml);
 
@@ -961,6 +974,7 @@ void KdenliveDoc::setUrl(KUrl url)
 
 void KdenliveDoc::setModified(bool mod)
 {
+    if (isReadOnly()) return;
     if (!m_url.isEmpty() && mod && KdenliveSettings::crashrecovery()) {
         m_autoSaveTimer->start(3000);
     }
@@ -1636,6 +1650,11 @@ void KdenliveDoc::backupLastSavedVersion(const QString &path)
     }    
 }
 
+bool KdenliveDoc::isReadOnly() const
+{
+    return m_documentProperties.contains("readonly");
+}
+
 void KdenliveDoc::cleanupBackupFiles()
 {
     KUrl backupFile = m_projectFolder;