- }
-
- if (xml.hasAttribute("force_aspect_ratio")) {
- double aspect = xml.attribute("force_aspect_ratio").toDouble();
- if (aspect > 0) producer->set("force_aspect_ratio", aspect);
- }
-
- if (xml.hasAttribute("force_aspect_num") && xml.hasAttribute("force_aspect_den")) {
- int width = xml.attribute("frame_size").section('x', 0, 0).toInt();
- int height = xml.attribute("frame_size").section('x', 1, 1).toInt();
- int aspectNumerator = xml.attribute("force_aspect_num").toInt();
- int aspectDenominator = xml.attribute("force_aspect_den").toInt();
- if (aspectDenominator != 0 && width != 0)
- producer->set("force_aspect_ratio", double(height) * aspectNumerator / aspectDenominator / width);
- }
-
- if (xml.hasAttribute("force_fps")) {
- double fps = xml.attribute("force_fps").toDouble();
- if (fps > 0) producer->set("force_fps", fps);
- }
-
- if (xml.hasAttribute("force_progressive")) {
- bool ok;
- int progressive = xml.attribute("force_progressive").toInt(&ok);
- if (ok) producer->set("force_progressive", progressive);
- }
- if (xml.hasAttribute("force_tff")) {
- bool ok;
- int fieldOrder = xml.attribute("force_tff").toInt(&ok);
- if (ok) producer->set("force_tff", fieldOrder);
- }
- if (xml.hasAttribute("threads")) {
- int threads = xml.attribute("threads").toInt();
- if (threads != 1) producer->set("threads", threads);
- }
- if (xml.hasAttribute("video_index")) {
- int vindex = xml.attribute("video_index").toInt();
- if (vindex != 0) producer->set("video_index", vindex);
- }
- if (xml.hasAttribute("audio_index")) {
- int aindex = xml.attribute("audio_index").toInt();
- if (aindex != 0) producer->set("audio_index", aindex);
- }
- if (xml.hasAttribute("force_colorspace")) {
- int colorspace = xml.attribute("force_colorspace").toInt();
- if (colorspace != 0) producer->set("force_colorspace", colorspace);
- }
- if (xml.hasAttribute("full_luma")) {
- int full_luma = xml.attribute("full_luma").toInt();
- if (full_luma != 0) producer->set("set.force_full_luma", full_luma);
- }
-
- int clipOut = 0;
- int duration = 0;
- if (xml.hasAttribute("out")) clipOut = xml.attribute("out").toInt();
-
- // setup length here as otherwise default length (currently 15000 frames in MLT) will be taken even if outpoint is larger
- if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW) {
- int length;
- if (xml.hasAttribute("length")) {
- if (clipOut > 0) duration = clipOut + 1;
- length = xml.attribute("length").toInt();
- clipOut = length - 1;
+ else {
+ path = info.xml.attribute("resource");
+ proxyProducer = false;
+ }
+ KUrl url(path);
+ Mlt::Producer *producer = NULL;
+ CLIPTYPE type = (CLIPTYPE)info.xml.attribute("type").toInt();
+
+ if (type == COLOR) {
+ producer = new Mlt::Producer(*m_mltProfile, 0, ("colour:" + info.xml.attribute("colour")).toUtf8().constData());
+ } else if (type == TEXT) {
+ producer = new Mlt::Producer(*m_mltProfile, 0, ("kdenlivetitle:" + info.xml.attribute("resource")).toUtf8().constData());
+ if (producer && producer->is_valid() && info.xml.hasAttribute("xmldata"))
+ producer->set("xmldata", info.xml.attribute("xmldata").toUtf8().constData());
+ } else if (url.isEmpty()) {
+ QDomDocument doc;
+ QDomElement mlt = doc.createElement("mlt");
+ QDomElement play = doc.createElement("playlist");
+ doc.appendChild(mlt);
+ mlt.appendChild(play);
+ play.appendChild(doc.importNode(info.xml, true));
+ producer = new Mlt::Producer(*m_mltProfile, "xml-string", doc.toString().toUtf8().constData());
+ } else {
+ producer = new Mlt::Producer(*m_mltProfile, path.toUtf8().constData());