WP: add default values

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-03-17 22:17:15 +03:00
parent a5e5128740
commit 5e5cf793db
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582

View file

@ -12,12 +12,13 @@ namespace PipeTap.Logic.WirePlumber {
public int value { get { return _value; } set { _value = value; send_value(value); } } public int value { get { return _value; } set { _value = value; send_value(value); } }
public CtrlType ctrl_type { get; } public CtrlType ctrl_type { get; }
public Ctrl(CtrlType pt_type, Wp.Node node, uint id, string type, float min, float max) { public Ctrl(CtrlType pt_type, Wp.Node node, uint id, string type, float min, float max, float typ) {
this.node = node; this.node = node;
this.min = min; this.min = min;
this.max = max; this.max = max;
this.wp_type = type; this.wp_type = type;
this.id = id; this.id = id;
_value = (int) ((typ - min) / (max - min) * 1000);
_ctrl_type = pt_type; _ctrl_type = pt_type;
} }
@ -123,7 +124,7 @@ namespace PipeTap.Logic.WirePlumber {
break; break;
} }
message("Found EXPOSURE"); message("Found EXPOSURE");
var ctrl = new Ctrl(Logic.Ctrl.CtrlType.Exposure, node, id, type, 0, 2); var ctrl = new Ctrl(Logic.Ctrl.CtrlType.Exposure, node, id, type, 0, 2, 1);
found_ctrls.append(ctrl); found_ctrls.append(ctrl);
break; break;
case "LensPosition": case "LensPosition":
@ -132,7 +133,7 @@ namespace PipeTap.Logic.WirePlumber {
break; break;
} }
message("Found FOCUS"); message("Found FOCUS");
var ctrl = new Ctrl(Logic.Ctrl.CtrlType.Focus, node, id, type, 0, 100); var ctrl = new Ctrl(Logic.Ctrl.CtrlType.Focus, node, id, type, 0, 100, 50);
found_ctrls.append(ctrl); found_ctrls.append(ctrl);
break; break;
case "AeEnable": case "AeEnable":
@ -141,7 +142,7 @@ namespace PipeTap.Logic.WirePlumber {
break; break;
} }
message("Found AE enable"); message("Found AE enable");
var ctrl = new Ctrl(Logic.Ctrl.CtrlType.ExposureEnable, node, id, type, 0, 1); var ctrl = new Ctrl(Logic.Ctrl.CtrlType.ExposureEnable, node, id, type, 0, 1, 1);
found_ctrls.append(ctrl); found_ctrls.append(ctrl);
break; break;
default: default: