Skip to content

Commit

Permalink
switch ui to main/mod
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Dec 17, 2024
1 parent 52e29bf commit 31167b3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 108 deletions.
158 changes: 52 additions & 106 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ fn full_parameters(cx: &mut Context) {
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "cutoff mod").class("slider-label");
Label::new(cx, "cutoff mode").class("slider-label");
ParamSlider::new(cx, Data::params, |params| {
&params.taps.cutoff_modulation_type
})
Expand All @@ -302,63 +302,60 @@ fn full_parameters(cx: &mut Context) {
.class("row");
})
.class("param-group");
filter_parameters(cx);
})
.class("parameters-right");
})
.class("parameters-all");
}

HStack::new(cx, |cx| {
Label::new(cx, "low velocity").class("column-title");
Label::new(cx, "high velocity").class("column-title");
})
.class("column-title-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "cutoff").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "cutoff mod").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_mod)
.class("widget");
})
.class("row");
})
.class("param-group");
fn filter_parameters(cx: &mut Context) {
HStack::new(cx, |cx| {
Label::new(cx, "main").class("column-title").class("left");
Label::new(cx, "modulation").class("column-title");
})
.class("column-title-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "cutoff").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_main).class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "velocity").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_mod).class("widget");
})
.class("row");
})
.class("param-group");

HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "res").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "res mod").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_mod)
.class("widget");
})
.class("row");
})
.class("param-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "res").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_main).class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "velocity").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_mod).class("widget");
})
.class("row");
})
.class("param-group");

HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "drive").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "drive mod").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_mod)
.class("widget");
})
.class("row");
})
.class("param-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "drive").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_main).class("widget");
})
.class("parameters-right");
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "velocity").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_mod).class("widget");
})
.class("row");
})
.class("parameters-all");
.class("param-group");
}

fn minimal_parameters(cx: &mut Context) {
Expand Down Expand Up @@ -473,7 +470,7 @@ fn minimal_parameters(cx: &mut Context) {
.class("row");

HStack::new(cx, |cx| {
Label::new(cx, "cutoff mod").class("slider-label");
Label::new(cx, "cutoff mode").class("slider-label");
ParamSlider::new(cx, Data::params, |params| {
&params.taps.cutoff_modulation_type
})
Expand All @@ -484,58 +481,7 @@ fn minimal_parameters(cx: &mut Context) {
})
.class("param-group");

HStack::new(cx, |_cx| {}); // spacer
HStack::new(cx, |cx| {
Label::new(cx, "low velocity").class("column-title");
Label::new(cx, "high velocity").class("column-title");
})
.class("column-title-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "cutoff").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "cutoff").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.cutoff_mod)
.class("widget");
})
.class("row");
})
.class("param-group");

HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "res").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "res").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.res_mod)
.class("widget");
})
.class("row");
})
.class("param-group");
HStack::new(cx, |cx| {
HStack::new(cx, |cx| {
Label::new(cx, "drive").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_main)
.class("widget");
})
.class("row");
HStack::new(cx, |cx| {
Label::new(cx, "drive").class("slider-label");
ParamSlider::new(cx, Data::params, |params| &params.taps.drive_mod)
.class("widget");
})
.class("row");
})
.class("param-group");
filter_parameters(cx);
})
.class("parameters-right");
})
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl TapsParams {
})),

cutoff_modulation_type: EnumParam::new(
format!("cutoff modultation"),
format!("cutoff mode"),
CutoffModulation::velocity,
) // Use the passed default value
.with_callback(Arc::new({
Expand Down
5 changes: 4 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,14 @@ param-slider .value-entry .selection {

.column-title {
font-size: 23;
left: 1s;
right: 0px;
shadow: 0px 0px 13px #e0ce9109;
background-color: #e0ce9106;
}
/* TODO: this should not be needed: */
.left {
left: 258px;
}
.column-title-group-minimal {
/* height: auto; */
background-color: #fabdf00a;
Expand Down

0 comments on commit 31167b3

Please sign in to comment.