Logo Search packages:      
Sourcecode: kdenlive version File versions

double ProfilesDialog::getStringEval ( const MltVideoProfile profile,
QString  eval,
QPoint  frameSize = QPoint() 
) [static]

Returns an value from a string by replacing "%width" and "%height" with given profile values:

Parameters:
profileThe profile that gives width & height
evalThe string to be evaluated, for example: "%width / 2"
Returns:
the evaluated value

Definition at line 286 of file profilesdialog.cpp.

Referenced by ClipItem::addEffect(), CustomTrackView::getEffectArgs(), TrackView::slotAddProjectEffects(), and EffectStackEdit::transferParamDesc().

{
    QScriptEngine sEngine;
    sEngine.globalObject().setProperty("maxWidth", profile.width > frameSize.x() ? profile.width : frameSize.x());
    sEngine.globalObject().setProperty("maxHeight", profile.height > frameSize.y() ? profile.height : frameSize.y());
    sEngine.globalObject().setProperty("width", profile.width);
    sEngine.globalObject().setProperty("height", profile.height);
    return sEngine.evaluate(eval.remove('%')).toNumber();
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index