コード例 #1
0
QMimeData *PlaylistModel::mimeData(const QModelIndexList &indexes) const
{
    QMimeData *mimeData = new QMimeData;
    Mlt::ClipInfo* info = m_playlist->clip_info(indexes.first().row());
    if (info) {
        Mlt::Producer* producer = info->producer;
        producer->set_in_and_out(info->frame_in, info->frame_out);
        mimeData->setData(Mlt::XmlMimeType, MLT.saveXML("string", producer).toUtf8());
        producer->set_in_and_out(0, -1);
        delete info;
    }
    return mimeData;
}
コード例 #2
0
ファイル: timelinedock.cpp プロジェクト: EdKeith/shotcut
void TimelineDock::openClip(int trackIndex, int clipIndex)
{
    Q_ASSERT(trackIndex >= 0 && clipIndex >= 0);
    QScopedPointer<Mlt::ClipInfo> info(getClipInfo(trackIndex, clipIndex));
    if (info) {
        QString xml = MLT.XML(info->producer);
        Mlt::Producer* p = new Mlt::Producer(MLT.profile(), "xml-string", xml.toUtf8().constData());
        p->set_in_and_out(info->frame_in, info->frame_out);
        emit clipOpened(p);
    }
}