Skip to content

Commit 6758592

Browse files
fix ds playbutton
1 parent 7dd9bca commit 6758592

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

slider.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ class RangedSlider extends Slider {
3131
// should be overridden to set up the slider
3232
}
3333

34+
postUpdateValue(p) {}
35+
3436
updateValue(p){
3537
this.settings[this.propName] = this.slider.value();
3638
this.displayVal = this.calcDisplayVal();
3739
this.textBox.value(this.displayVal);
3840
this.textLabel.html(this.name+': ');
41+
this.postUpdateValue();
3942
}
4043

4144
makeSlider(p){
@@ -302,8 +305,23 @@ class AntialiasingSlider extends RangedSlider {
302305
this.max = 200;
303306
this.initial = 0;
304307
this.step = 2;
308+
this.setMaxBasedOnFilterType();
305309
this.makeSlider(p);
306310
}
311+
312+
setMaxBasedOnFilterType() {
313+
if (this.settings.filterType === "FIR") {
314+
this.max = 200;
315+
} else if (this.settings.filterType === "Butterworth") {
316+
this.max = 12;
317+
} else if (this.settings.filterType === "Chebyshev") {
318+
this.max = 4;
319+
}
320+
}
321+
322+
postUpdateValue(p) {
323+
this.setMaxBasedOnFilterType();
324+
}
307325
}
308326

309327
class ReconstructionOrderSlider extends RangedSlider {

widget.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ function createWidgets() {
212212
playButton.onclick = () => { buttonPlayFunction(settings.buffers.quantNoise.playback); };
213213
} else if (id === "play-reconstructed") {
214214
playButton.onclick = () => { buttonPlayFunction(settings.buffers.reconstructed.playback); };
215+
} else if (id === "play-delta-sigma") {
216+
playButton.onclick = () => {buttonPlayFunction(settings.buffers.deltaSigma.playback)};
215217
}
216218
}
217219

0 commit comments

Comments
 (0)