Skip to content
Snippets Groups Projects
Commit e541c44e authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Scale waveform when volume is changed

If the volume control is changed the waveform changes as well

Changelog: feature
parent e70ff28f
No related branches found
No related tags found
No related merge requests found
......@@ -426,7 +426,7 @@ void loop() {
switch (ui.fx_mode) {
case FX_MODE_ALL:
if (!isnan(p5)) { lfo_amount = p5; }
if (!isnan(p6)) { ui.activeLooper()->volume = p6 * 4.0f; }
if (!isnan(p6)) { ui.activeLooper()->volume = p6 * 4.0f; ui.recalculateWaveform(); }
if (!isnan(p7)) { reverbmix = p7; }
break;
case FX_MODE_REVERB:
......
......@@ -873,6 +873,10 @@ class Ui {
activeLooper()->SetLoop(start, length);
}
void recalculateWaveform() {
this->waveform_cache_dirty = true;
}
private:
double last_render = 0.0;
uint16_t waveform_cache[128] = {0};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment