Пример #1
0
bool TupCommandExecutor::addLipSync(TupLayerResponse *response)
{
    #ifdef K_DEBUG
        QString msg = "TupCommandExecutor::addLipSync() - Adding lipsync...";
        #ifdef Q_OS_WIN32
            qWarning() << msg;
        #else
            tWarning() << msg;
        #endif
    #endif

    int scenePos = response->sceneIndex();
    int position = response->layerIndex();
    QString xml = response->arg().toString();

    TupScene *scene = m_project->scene(scenePos);

    if (!scene)
        return false;

    TupLayer *layer = scene->layer(position);

    if (layer) {
        TupLipSync *lipsync = new TupLipSync();
        lipsync->fromXml(xml);
        layer->addLipSync(lipsync);

        emit responsed(response);
        return true;
    }

    return false;
}