Logo Search packages:      
Sourcecode: kdenlive version File versions

QDomDocumentFragment ClipManager::producersList (  )  [slot]

returns an mlt list of producers for all the clips

Definition at line 594 of file clipmanager.cpp.

References DocClipAVFile::clipHeight(), DocClipAVFile::clipTtl(), DocClipAVFile::clipType(), DocClipAVFile::clipWidth(), DocClipAVFile::color(), DocClipTextFile::fileURL(), DocClipAVFile::fileURL(), m_clipList, and m_render.

Referenced by KdenliveDoc::generateProducersList().

{
    QDomDocument sceneList;
    QDomDocumentFragment list = sceneList.createDocumentFragment();
    sceneList.appendChild(list);

    QPtrListIterator < DocClipBase > itt(m_clipList);
    QDomElement producer = sceneList.createElement("producer");
    producer.setAttribute("id", "black");
    producer.setAttribute("mlt_service", "colour");
    list.appendChild(producer);
    
    while (itt.current()) {
        if (itt.current()->isDocClipAVFile())
        {
        DocClipAVFile *avClip = itt.current()->toDocClipAVFile();
        if (avClip && avClip->numReferences() > 0) {
          if (avClip->clipType() == DocClipBase::IMAGE || avClip->clipType() == DocClipBase::SLIDESHOW) {
            QDomElement producer = sceneList.createElement("producer");
            producer.setAttribute("id", avClip->getId());
                double ratio;
            if (KdenliveSettings::distortimages()) ratio = ((double) KdenliveSettings::defaultwidth()/KdenliveSettings::defaultheight())/((double)avClip->clipWidth()/avClip->clipHeight()) * m_render->consumerRatio();
            else ratio = KdenliveSettings::correctionratio();
                producer.setAttribute("aspect_ratio", QString::number(ratio));
            producer.setAttribute("resource", avClip->fileURL().path());
            producer.setAttribute("ttl", avClip->clipTtl());
            producer.setAttribute("hide", "audio");
            list.appendChild(producer);
          }

          else if (avClip->clipType() == DocClipBase::COLOR) {
            QDomElement producer = sceneList.createElement("producer");
            producer.setAttribute("id", avClip->getId());
            producer.setAttribute("mlt_service", "colour");
            double ratio = KdenliveSettings::renderratio();
            //ratio = ratio / ((double) KdenliveSettings::defaultwidth()/KdenliveSettings::defaultheight());
            // producer.setAttribute("aspect_ratio", QString::number(ratio));
            producer.setAttribute("aspect_ratio", QString::number(KdenliveSettings::renderratio()));
            producer.setAttribute("hide", "audio");
            producer.setAttribute("colour", avClip->color());
            list.appendChild(producer);
          }

          else if (avClip->clipType() == DocClipBase::AUDIO) {
            QDomElement producer = sceneList.createElement("producer");
            producer.setAttribute("id", avClip->getId());
            producer.setAttribute("resource",
                avClip->fileURL().path());
            producer.setAttribute("hide", "video");
            list.appendChild(producer);
          } else if (avClip->clipType() == DocClipBase::VIDEO) {
            QDomElement producer = sceneList.createElement("producer");
            producer.setAttribute("id", avClip->getId());
            producer.setAttribute("resource",
                avClip->fileURL().path());
            producer.setAttribute("hide", "audio");
            list.appendChild(producer);
          }
          else {
            QDomElement producer = sceneList.createElement("producer");
            producer.setAttribute("id", avClip->getId());
            producer.setAttribute("resource",
                avClip->fileURL().path());
            list.appendChild(producer);
          }
      }
        }
        else if (itt.current()->isDocClipTextFile())
        {
            DocClipTextFile *avClip = itt.current()->toDocClipTextFile();
            if (avClip)
            {
                QDomElement producer = sceneList.createElement("producer");
                producer.setAttribute("id", avClip->getId());
            producer.setAttribute("aspect_ratio", QString::number( KdenliveSettings::correctionratio()));
                producer.setAttribute("resource", avClip->fileURL().path());
                producer.setAttribute("hide", "audio");
                list.appendChild(producer);
            }
        }
      ++itt;
    }
    return list;
}


Generated by  Doxygen 1.6.0   Back to index