Express qmlvideofx effect parameters declaratively

Each effect item now exposes a ListModel property which describes the
set of user-controllable parameters.  This model is used by the
ParameterPanel component to generate a ListView whose delegate displays
the parameter name and a slider.

Change-Id: Ib26877fe434d8b746ef621e0b4adbcbe1ed9aaa8
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Gareth Stockwell
2011-12-20 13:51:34 +00:00
committed by Qt by Nokia
parent febe398400
commit 9092b1ae46
29 changed files with 225 additions and 222 deletions

View File

@@ -42,16 +42,20 @@
import QtQuick 2.0
Effect {
// Constant properties which must be supported by every effect
property int numParameters: 2
property bool supportsDivider: true
parameters: ListModel {
ListElement {
name: "hue"
value: 0.5
}
ListElement {
name: "width"
value: 0.5
}
}
property real param1Value: 0.5
property real param2Value: 0.5
property real dividerValue: 0.5
property real targetHue: 360.0 * param1Value
property real windowWidth: 60.0 * param2Value
// Transform slider values, and bind result to shader uniforms
property real targetHue: parameters.get(0).value * 360
property real windowWidth: parameters.get(1).value * 60
fragmentShaderFilename: "shaders/isolate.fsh"
}