Skip to content

Commit

Permalink
Increase maximum Max value of Condenser to 32
Browse files Browse the repository at this point in the history
  • Loading branch information
rollerozxa committed Aug 6, 2024
1 parent 466c59d commit c17bb97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/src/i2o1gate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,19 @@ float
condenser::get_slider_value(int s)
{
if (s == 0)
return (this->properties[0].v.f - 1.f) / 19.f;
else
return (this->properties[0].v.f - 1.f) / 31.f;
else // s == 1
return this->properties[1].v.f;
}

void
condenser::on_slider_change(int s, float value)
{
if (s == 0) {
float v = 1.f + (value * 19.f);
float v = 1.f + (value * 31.f);
this->properties[0].v.f = v;
G->show_numfeed(v);
} else {
} else { // s == 1
this->properties[1].v.f = value;
G->show_numfeed(value);
}
Expand Down
14 changes: 12 additions & 2 deletions src/src/i2o1gate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,18 @@ class condenser : public i2o1gate_empty
const char* get_name(){return "Condenser";}

void setup();
const char *get_slider_label(int s) { switch (s) { case 0: return "Max value"; case 1: return "Initial fraction"; } return ""; }
float get_slider_snap(int s) { return 1/19.f; }
const char *get_slider_label(int s) {
if (s == 0)
return "Max value";
else // s == 1
return "Initial fraction";
}
float get_slider_snap(int s) {
if (s == 0)
return 1/31.f;
else // s == 1
return 1/20.f;
}
float get_slider_value(int s);
void on_slider_change(int s, float value);

Expand Down

0 comments on commit c17bb97

Please sign in to comment.