#include "kthumb.h"
#include "clipmanager.h"
-DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, uint id):
+DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QString &id):
m_id(id), m_description(QString()), m_refcount(0), m_audioThumbCreated(false), m_duration(GenTime()), m_thumbProd(NULL), m_audioTimer(NULL), m_clipProducer(NULL) {
int type = xml.attribute("type").toInt();
m_clipType = (CLIPTYPE) type;
m_name = xml.attribute("name");
- m_id = id;
QDomNamedNodeMap attributes = xml.attributes();
for (unsigned int i = 0; i < attributes.count(); i++) {
}
if (m_name.isEmpty()) m_name = url.fileName();
- if (!url.isEmpty() && QFile::exists(url.path())) {
+ //if (!url.isEmpty() && QFile::exists(url.path()))
+ {
m_thumbProd = new KThumb(clipManager, url);
if (m_clipType == AV || m_clipType == AUDIO) slotCreateAudioTimer();
}
return m_name;
}
-uint DocClipBase::getId() const {
+const QString &DocClipBase::getId() const {
return m_id;
}
-void DocClipBase::setId(const uint &newId) {
+void DocClipBase::setId(const QString &newId) {
m_id = newId;
}
return m_properties.value("description");
}
+bool DocClipBase::isTransparent() const {
+ return (m_properties.value("transparency") == "1");
+}
+
const QString DocClipBase::getProperty(const QString prop) const {
return m_properties.value(prop);
}
}
void DocClipBase::setProducer(Mlt::Producer *producer) {
+ if (producer == NULL) return;
m_clipProducer = producer;
+ m_clipProducer->set("transparency", m_properties.value("transparency").toInt());
if (m_thumbProd) m_thumbProd->setProducer(producer);
}
if (i.key() == "resource") m_thumbProd->updateClipUrl(KUrl(i.value()));
else if (i.key() == "out") setDuration(GenTime(i.value().toInt(), KdenliveSettings::project_fps()));
else if (m_clipType == SLIDESHOW && keys.contains(i.key())) refreshProducer = true;
+ else if (i.key() == "transparency") m_clipProducer->set("transparency", i.value().toInt());
+ else if (i.key() == "colour") {
+ char *tmp = (char *) qstrdup(i.value().toUtf8().data());
+ m_clipProducer->set("colour", tmp);
+ delete[] tmp;
+ } else if (i.key() == "xmldata") {
+ m_clipProducer->set("force_reload", 1);
+ }
}
if (refreshProducer) slotRefreshProducer();
}
m_properties.insert(key, value);
if (key == "resource") m_thumbProd->updateClipUrl(KUrl(value));
else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
+ else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
+ else if (key == "colour") {
+ char *tmp = (char *) qstrdup(value.toUtf8().data());
+ m_clipProducer->set("colour", tmp);
+ delete[] tmp;
+ } else if (key == "xmldata") {
+ m_clipProducer->set("force_reload", 1);
+ }
}
QMap <QString, QString> DocClipBase::properties() const {