Exemplo n.º 1
0
ClipController::ClipController(BinController *bincontroller, Mlt::Producer& producer) : QObject()
    , selectedEffectIndex(1)
    , audioThumbCreated(false)
    , m_properties(new Mlt::Properties(producer.get_properties()))
    , m_usesProxy(false)
    , m_audioInfo(NULL)
    , m_audioIndex(0)
    , m_videoIndex(0)
    , m_clipType(Unknown)
    , m_hasLimitedDuration(true)
    , m_binController(bincontroller)
    , m_snapMarkers(QList < CommentedTime >())
{
    m_masterProducer = &producer;
    if (!m_masterProducer->is_valid()) {
        qDebug()<<"// WARNING, USING INVALID PRODUCER";
        return;
    }
    else {
        QString proxy = m_properties->get("kdenlive:proxy");
        if (proxy.length() > 2) {
            // This is a proxy producer, read original url from kdenlive property
            QString path = m_properties->get("kdenlive:originalurl");
            if (!path.startsWith(QLatin1String("/"))) {
                path.prepend(bincontroller->documentRoot());
            }
            m_url = QUrl::fromLocalFile(path);
            m_usesProxy = true;
        }
        else m_url = QUrl::fromLocalFile(m_properties->get("resource"));
        m_service = m_properties->get("mlt_service");
        getInfoForProducer();
    }
}
Exemplo n.º 2
0
void ClipController::addMasterProducer(Mlt::Producer &producer)
{
    m_properties = new Mlt::Properties(producer.get_properties());
    m_masterProducer = &producer;
    if (!m_masterProducer->is_valid()) qDebug()<<"// WARNING, USING INVALID PRODUCER";
    else {
        QString proxy = m_properties->get("kdenlive:proxy");
        if (proxy.length() > 2) {
            // This is a proxy producer, read original url from kdenlive property
            m_url = QUrl::fromLocalFile(m_properties->get("kdenlive:originalurl"));
            m_usesProxy = true;
        }
        else {
            m_url = QUrl::fromLocalFile(m_properties->get("resource"));
            m_usesProxy = false;
        }
        m_service = m_properties->get("mlt_service");
        getInfoForProducer();
    }
}