DeutscheSoft / aux-widgets

A web components library for audio applications.
GNU General Public License v3.0
14 stars 5 forks source link

Crash with version 1.3.5 #7

Open MatthiasMann opened 2 months ago

MatthiasMann commented 2 months ago

I upgraded to version 1.3.5 and get this error:

function set_range_y()
 threw TypeError: range is undefined
    calculateGrid https://localhost/amixer/aux/src/widgets/frequencyresponse.js:24
    set_range_y https://localhost/amixer/aux/src/widgets/frequencyresponse.js:129
    callHandler https://localhost/amixer/aux/src/implements/base.js:33
    dispatchEvents https://localhost/amixer/aux/src/implements/base.js:45
    emit https://localhost/amixer/aux/src/implements/base.js:644
    set https://localhost/amixer/aux/src/implements/base.js:406
    set https://localhost/amixer/aux/src/widgets/widget.js:849
    set https://localhost/amixer/aux/src/widgets/equalizer.js:438
    defineRange https://localhost/amixer/aux/src/utils/define_range.js:74
    initialize https://localhost/amixer/aux/src/widgets/chart.js:322
    initialize https://localhost/amixer/aux/src/widgets/frequencyresponse.js:135
    initialize https://localhost/amixer/aux/src/widgets/equalizer.js:283
    Base https://localhost/amixer/aux/src/implements/base.js:256
    Widget https://localhost/amixer/aux/src/widgets/widget.js:499
    Chart https://localhost/amixer/aux/src/widgets/chart.js:124
    FrequencyResponse https://localhost/amixer/aux/src/widgets/frequencyresponse.js:69
    Equalizer https://localhost/amixer/aux/src/widgets/equalizer.js:253
    component https://localhost/amixer/aux/src/component_helpers.js:493
arneg commented 2 months ago

What arguments to you pass to Equalizer? Is it possible that range_y is undefined?

MatthiasMann commented 2 months ago

I'm doing this:

  let eq = document.createElement('aux-equalizer');
  eq.auxWidget.set("range_x", {
    min: 50,
    max: 20000,
    scale: 'frequency'
  });
  eq.auxWidget.set("range_y", {
    min: -30,
    max: 30
  });
  eq.auxWidget.set("range_z", {
    min: 0.025,
    max: 40,
    step: 0.1,
    reverse: true
  });

I think it is a race condition where range_y has not yet been set