#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++) {
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) {
m_clipProducer = producer;
+ m_clipProducer->set("transparency", m_properties.value("transparency").toInt());
if (m_thumbProd) m_thumbProd->setProducer(producer);
}
char *tmp = (char *) qstrdup(resource.toUtf8().data());
filter->set("luma.resource", tmp);
delete[] tmp;
- if (getProperty("softness") != QString()) {
- int soft = getProperty("softness").toInt();
- filter->set("luma.softness", (double) soft / 100.0);
- }
+ if (getProperty("softness") != QString()) {
+ int soft = getProperty("softness").toInt();
+ filter->set("luma.softness", (double) soft / 100.0);
+ }
} else {
// filter does not exist, create it...
Mlt::Filter *filter = new Mlt::Filter(*(m_clipProducer->profile()), "luma");
char *tmp = (char *) qstrdup(resource.toUtf8().data());
filter->set("luma.resource", tmp);
delete[] tmp;
- if (getProperty("softness") != QString()) {
- int soft = getProperty("softness").toInt();
- filter->set("luma.softness", (double) soft / 100.0);
- }
+ if (getProperty("softness") != QString()) {
+ int soft = getProperty("softness").toInt();
+ filter->set("luma.softness", (double) soft / 100.0);
+ }
clipService.attach(*filter);
}
} else {
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());
}
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());
}
QMap <QString, QString> DocClipBase::properties() const {