Esempio n. 1
0
void MovieRecorderImpl::restore(const Mapping& archive)
{
    string symbol;
    if(archive.read("target", symbol)){
        setTargetView(symbol);
    }
    if(archive.read("recordingMode", symbol)){
        setRecordingMode(symbol);
    }
    dialog->restore(archive);
}
Esempio n. 2
0
bool AbstractSeq::checkSeqContent(const Mapping& archive, const std::string contentName, bool throwEx)
{
    string content_;
    if(!archive.read("content", content_)){
        archive.read("purpose", content_); // old version
    }
    bool result = (content_ == contentName);

    if(!result){
        string message;

        if(content_.empty()){
            message =
                str(format("Content of %1% should be \"%2%\" but it is not specified.")
                    % seqType() % contentName);
        } else {
            message =
                str(format("Content \"%1%\" of %2% is different from the required content \"%3%\".")
                    % content_ % seqType() % contentName);
        }
        if(throwEx){
            archive.throwException(message);
        } else {
            addSeqMessage(message);
        }
    }
    return result;
}
Esempio n. 3
0
bool AbstractSeq::readSeq(const Mapping& archive)
{
    try {
        if(content.empty()){
            if(!archive.read("content", content)){
                archive.read("purpose", content); // old version
            }
        }
        setFrameRate(archive["frameRate"].toDouble());

        return doReadSeq(archive);

    } catch (ValueNode::Exception& ex) {
        addSeqMessage(ex.message());
        return false;
    }
}