99 lines
2.8 KiB
Plaintext
99 lines
2.8 KiB
Plaintext
import { Button, VerticalBox, Slider, HorizontalBox, GroupBox } from "std-widgets.slint";
|
|
|
|
export component ShockerConfig inherits Window {
|
|
in-out property <int> min_shock: 10;
|
|
in-out property <int> max_shock: 50;
|
|
in-out property <int> min_time: 300;
|
|
in-out property <int> max_time: 3000;
|
|
in-out property <int> cooldown: 5000;
|
|
width: 400px;
|
|
height: 400px;
|
|
title: "ShockOSC-rs";
|
|
callback update();
|
|
VerticalBox {
|
|
GroupBox {
|
|
title: "Shock Time";
|
|
VerticalBox {
|
|
Text {
|
|
text: min_time + " ms";
|
|
}
|
|
Slider {
|
|
minimum: 300;
|
|
value: min_time;
|
|
maximum: max_time;
|
|
step: 100;
|
|
changed => {
|
|
min_time = round(self.value / 100) * 100;
|
|
root.update();
|
|
}
|
|
}
|
|
}
|
|
VerticalBox {
|
|
Text {
|
|
text: max_time + " ms";
|
|
}
|
|
Slider {
|
|
minimum: min_time;
|
|
value: max_time;
|
|
maximum: 30000;
|
|
step: 100;
|
|
changed => {
|
|
max_time = round(self.value / 100) * 100;
|
|
root.update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
GroupBox {
|
|
title: "Shock Intensity";
|
|
VerticalBox {
|
|
Text {
|
|
text: min_shock + " %";
|
|
}
|
|
Slider {
|
|
minimum: 1;
|
|
value: min_shock;
|
|
maximum: max_shock;
|
|
step: 1;
|
|
changed => {
|
|
min_shock = round(self.value);
|
|
root.update();
|
|
}
|
|
}
|
|
}
|
|
VerticalBox {
|
|
Text {
|
|
text: max_shock + " %";
|
|
}
|
|
Slider {
|
|
minimum: min_shock;
|
|
value: max_shock;
|
|
maximum: 100;
|
|
step: 1;
|
|
changed => {
|
|
max_shock = round(self.value);
|
|
root.update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
GroupBox {
|
|
title: "Cooldown";
|
|
VerticalBox {
|
|
Text {
|
|
text: cooldown + " ms";
|
|
}
|
|
Slider {
|
|
minimum: 1;
|
|
value: cooldown;
|
|
maximum: 30000;
|
|
step: 1;
|
|
changed => {
|
|
cooldown = round(self.value / 100)*100;
|
|
root.update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |