- // Creating new document
- QDomElement westley = m_document.createElement("westley");
- m_document.appendChild(westley);
-
- QDomElement tractor = m_document.createElement("tractor");
- tractor.setAttribute("id", "maintractor");
- QDomElement multitrack = m_document.createElement("multitrack");
- QDomElement playlist = m_document.createElement("playlist");
- playlist.setAttribute("id", "black_track");
- westley.appendChild(playlist);
-
-
- // create playlists
- int audiotracks = 2;
- int videotracks = 3;
- int total = audiotracks + videotracks + 1;
-
- for (int i = 1; i < total; i++) {
- QDomElement playlist = m_document.createElement("playlist");
- playlist.setAttribute("id", "playlist" + QString::number(i));
- westley.appendChild(playlist);
- }
-
- QDomElement track0 = m_document.createElement("track");
- track0.setAttribute("producer", "black_track");
- tractor.appendChild(track0);
-
- // create audio tracks
- for (int i = 1; i < audiotracks + 1; i++) {
- QDomElement track = m_document.createElement("track");
- track.setAttribute("producer", "playlist" + QString::number(i));
- track.setAttribute("hide", "video");
- tractor.appendChild(track);
- }
-
- // create video tracks
- for (int i = audiotracks + 1; i < total; i++) {
- QDomElement track = m_document.createElement("track");
- track.setAttribute("producer", "playlist" + QString::number(i));
- tractor.appendChild(track);
- }
-
- for (uint i = 2; i < total ; i++) {
- QDomElement transition = m_document.createElement("transition");
- transition.setAttribute("always_active", "1");
-
- QDomElement property = m_document.createElement("property");
- property.setAttribute("name", "a_track");
- QDomText value = m_document.createTextNode(QString::number(1));
- property.appendChild(value);
- transition.appendChild(property);
-
- property = m_document.createElement("property");
- property.setAttribute("name", "b_track");
- value = m_document.createTextNode(QString::number(i));
- property.appendChild(value);
- transition.appendChild(property);
-
- property = m_document.createElement("property");
- property.setAttribute("name", "mlt_service");
- value = m_document.createTextNode("mix");
- property.appendChild(value);
- transition.appendChild(property);
-
- property = m_document.createElement("property");
- property.setAttribute("name", "combine");
- value = m_document.createTextNode("1");
- property.appendChild(value);
- transition.appendChild(property);
-
- property = m_document.createElement("property");
- property.setAttribute("name", "internal_added");
- value = m_document.createTextNode("237");
- property.appendChild(value);
- transition.appendChild(property);
- tractor.appendChild(transition);
- }
- westley.appendChild(tractor);