if (type->name().startsWith("image/")) {
prod.setAttribute("type", (int) IMAGE);
prod.setAttribute("in", 0);
- prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()));
+ prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
if (KdenliveSettings::autoimagetransparency()) prod.setAttribute("transparency", 1);
// Read EXIF metadata for JPEG
if (type->is("image/jpeg")) {
if (out > 0)
prod.setAttribute("out", out);
else
- prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()));
+ prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
} else
txtfile.close();
}
uint id = m_clipIdCounter++;
prod.setAttribute("id", QString::number(id));
prod.setAttribute("in", "0");
- prod.setAttribute("out", m_doc->getFramePos(duration));
+ prod.setAttribute("out", m_doc->getFramePos(duration) - 1);
prod.setAttribute("name", name);
if (!group.isEmpty()) {
prod.setAttribute("groupname", group);
} else {
int out = xml.attribute("out").toInt();
int in = xml.attribute("in").toInt();
- setDuration(GenTime(out - in, KdenliveSettings::project_fps()));
+ setDuration(GenTime(out - in + 1, KdenliveSettings::project_fps()));
}
if (!m_properties.contains("name")) m_properties.insert("name", url.fileName());
if (key == "resource") {
getFileHash(value);
if (m_thumbProd) m_thumbProd->updateClipUrl(KUrl(value), m_properties.value("file_hash"));
- } else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
//else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
+ } else if (key == "out") {
+ setDuration(GenTime(value.toInt() + 1, KdenliveSettings::project_fps()));
+ }
else if (key == "colour") {
setProducerProperty("colour", value.toUtf8().data());
} else if (key == "templatetext") {
if (offset == 0) return data;
Mlt::Profile *profile = m_baseTrackProducers.at(0)->profile();
Mlt::Geometry geometry(data.toUtf8().data(), m_properties.value("duration").toInt(), profile->width(), profile->height());
- Mlt::Geometry newgeometry("", m_properties.value("duration").toInt(), profile->width(), profile->height());
+ Mlt::Geometry newgeometry(NULL, m_properties.value("duration").toInt(), profile->width(), profile->height());
Mlt::GeometryItem item;
int pos = 0;
while (!geometry.next_key(&item, pos)) {
default:
setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(pixmapSize));
}
+ if (m_clipType != UNKNOWN) slotSetToolTip();
setText(0, name);
setText(1, m_clip->description());
QDomElement e = item->toXml();
// Make sure we get the correct producer length if it was adjusted in timeline
if (t == COLOR || t == IMAGE || t == SLIDESHOW || t == TEXT) {
- int length = QString(clip->producerProperty("length")).toInt();
- if (length > 0 && !e.hasAttribute("length")) {
- e.setAttribute("length", length);
- }
+ int length = QString(clip->producerProperty("length")).toInt();
+ if (length > 0 && !e.hasAttribute("length")) {
+ e.setAttribute("length", length);
+ }
+ e.setAttribute("duration", clip->getProperty("duration"));
}
resetThumbsProducer(clip);
m_render->getFileProperties(e, item->clipId(), m_listView->iconSize().height(), true);
length = info.xml.attribute("length").toInt();
clipOut = length - 1;
}
- else length = info.xml.attribute("out").toInt() - info.xml.attribute("in").toInt();
- producer->set("length", length);
- duration = length;
+ else length = info.xml.attribute("out").toInt() - info.xml.attribute("in").toInt() + 1;
+ // Pass duration if it was forced
+ if (info.xml.hasAttribute("duration")) {
+ duration = info.xml.attribute("duration").toInt();
+ if (length < duration) {
+ length = duration;
+ if (clipOut > 0) clipOut = length - 1;
+ }
+ }
+ if (duration == 0) duration = length;
+ producer->set("length", length);
}
if (clipOut > 0) producer->set_in_and_out(info.xml.attribute("in").toInt(), clipOut);
} else if (!play) {
m_paused = true;
m_mltProducer->set_speed(0.0);
- //m_mltProducer->pause();
}
}