#include <KFileDialog>
#include <KIO/NetAccess>
#include <KIO/CopyJob>
+#include <KIO/JobUiDelegate>
#include <KApplication>
#include <KGlobal>
#include <KBookmarkManager>
#include <mlt++/Mlt.h>
-const double DOCUMENTVERSION = 0.86;
+#include "locale.h"
+
+
+const double DOCUMENTVERSION = 0.88;
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),
m_documentProperties[i.key()] = i.value();
}
+ if (QLocale() != QLocale::system()) {
+ setlocale(LC_NUMERIC, "");
+ QLocale::setDefault(QLocale::system());
+ // locale conversion might need to be redone
+ initEffects::parseEffectFiles();
+ }
+
*openBackup = false;
if (!url.isEmpty()) {
// Make sure that the necessary folders exist
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "titles/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/");
- KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "proxy/");
updateProjectFolderPlacesEntry();
// Creating new document
QDomDocument doc;
QDomElement mlt = doc.createElement("mlt");
+ mlt.setAttribute("LC_NUMERIC", "");
doc.appendChild(mlt);
// Create black producer
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);
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);
void KdenliveDoc::moveProjectData(KUrl url)
{
QList <DocClipBase*> list = m_clipManager->documentClipList();
- //TODO: Also move ladspa effects files
+ KUrl::List cacheUrls;
for (int i = 0; i < list.count(); i++) {
DocClipBase *clip = list.at(i);
if (clip->clipType() == TEXT) {
KUrl oldVideoThumbUrl = KUrl(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".png");
KUrl oldAudioThumbUrl = KUrl(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".thumb");
if (KIO::NetAccess::exists(oldVideoThumbUrl, KIO::NetAccess::SourceSide, 0)) {
- KUrl newUrl = KUrl(url.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".png");
- KIO::Job *job = KIO::copy(oldVideoThumbUrl, newUrl);
- KIO::NetAccess::synchronousRun(job, 0);
+ cacheUrls << oldVideoThumbUrl;
}
if (KIO::NetAccess::exists(oldAudioThumbUrl, KIO::NetAccess::SourceSide, 0)) {
- KUrl newUrl = KUrl(url.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".thumb");
- KIO::Job *job = KIO::copy(oldAudioThumbUrl, newUrl);
- if (KIO::NetAccess::synchronousRun(job, 0)) clip->refreshThumbUrl();
+ cacheUrls << oldAudioThumbUrl;
}
}
+ if (!cacheUrls.isEmpty()) {
+ KIO::Job *job = KIO::copy(cacheUrls, KUrl(url.path(KUrl::AddTrailingSlash) + "thumbs/"));
+ job->ui()->setWindow(kapp->activeWindow());
+ KIO::NetAccess::synchronousRun(job, 0);
+ }
}
const QString &KdenliveDoc::profilePath() const
pix.save(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + fileId + ".png");
}
-QString KdenliveDoc::getLadspaFile() const
-{
- int ct = 0;
- QString counter = QString::number(ct).rightJustified(5, '0', false);
- while (QFile::exists(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/" + counter + ".ladspa")) {
- ct++;
- counter = QString::number(ct).rightJustified(5, '0', false);
- }
- return m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/" + counter + ".ladspa";
-}
-
bool KdenliveDoc::checkDocumentClips(QDomNodeList infoproducers)
{
DocumentChecker d(infoproducers, m_document);
QDomElement e = params.item(i).toElement();
// Check if this effect has a variable parameter
- if (e.attribute("default").startsWith('%')) {
+ if (e.attribute("default").contains('%')) {
double evaluatedValue = ProfilesDialog::getStringEval(m_profile, e.attribute("default"));
e.setAttribute("default", evaluatedValue);
if (e.hasAttribute("value") && e.attribute("value").startsWith('%')) {