- if (pitching) {
-
- float cents = current_timefx->pitch_octave_adjustment.get_value() * 1200.0;
- float pitch_fraction;
- cents += current_timefx->pitch_semitone_adjustment.get_value() * 100.0;
- cents += current_timefx->pitch_cent_adjustment.get_value();
-
- if (cents == 0.0) {
- // user didn't change anything
- current_timefx->hide ();
- return 0;
- }
-
- // one octave == 1200 cents
- // adding one octave doubles the frequency
- // ratio is 2^^octaves
-
- pitch_fraction = pow(2, cents/1200);
-
- current_timefx->request.time_fraction = 1.0;
- current_timefx->request.pitch_fraction = pitch_fraction;
-
- } else {
-
- current_timefx->request.time_fraction = val;
- current_timefx->request.pitch_fraction = 1.0;
-
+ if (current_timefx->request.time_fraction == 1.0 &&
+ current_timefx->request.pitch_fraction == 1.0) {
+ /* nothing to do */
+ current_timefx->hide ();
+ return 0;