Compare commits
No commits in common. "992eebc8a28aafa7ed79a8d17580e35a8ea8e440" and "5d07c39170b89ab3d9cdb867bc532c83f2e8453f" have entirely different histories.
992eebc8a2
...
5d07c39170
@ -22,10 +22,10 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void *handle;
|
||||
const char *format;
|
||||
const char *(*get_bindir)(void *handle);
|
||||
const char *(*get_datadir)(void *handle);
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
@ -36,15 +36,15 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
plugin p;
|
||||
void *mem;
|
||||
void * mem;
|
||||
#if DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N > 0
|
||||
float x_buf[DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N * 128];
|
||||
const float *x[DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N];
|
||||
const float * x[DATA_PRODUCT_AUDIO_INPUT_CHANNELS_N];
|
||||
float zero_buf[128];
|
||||
#endif
|
||||
#if DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N > 0
|
||||
float y_buf[DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N * 128];
|
||||
float *y[DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N];
|
||||
float * y[DATA_PRODUCT_AUDIO_OUTPUT_CHANNELS_N];
|
||||
#endif
|
||||
#if DATA_PRODUCT_PARAMETERS_OUTPUT_N > 0
|
||||
float out_params[DATA_PRODUCT_PARAMETERS_OUTPUT_N];
|
||||
|
@ -27,9 +27,6 @@ var busesOut = buses.filter(x => x.type == "audio" && x.direction == "output")
|
||||
var nChansIn = busesIn.reduce((a, x) => a + (x.channels == "mono" ? 1 : 2), 0);
|
||||
var nChansOut = busesOut.reduce((a, x) => a + (x.channels == "mono" ? 1 : 2), 0);
|
||||
|
||||
var cpu_meter = 0.0;
|
||||
var sampleRate = 1.0;
|
||||
|
||||
class Processor extends AudioWorkletProcessor {
|
||||
constructor(options) {
|
||||
super();
|
||||
@ -74,8 +71,6 @@ class Processor extends AudioWorkletProcessor {
|
||||
}
|
||||
|
||||
process(inputs, outputs, params) {
|
||||
const processTimeStart = performance.now();
|
||||
|
||||
for (var i = 0; i < this.parametersIn.length; i++) {
|
||||
var index = this.parametersIn[i].index;
|
||||
var parameter = parameters[index];
|
||||
@ -146,11 +141,7 @@ class Processor extends AudioWorkletProcessor {
|
||||
|
||||
for (var i = 0; i < this.parametersOut.length; i++) {
|
||||
var index = this.parametersOut[i].index;
|
||||
var value;
|
||||
if (parameters[index].isCpumeter)
|
||||
value = cpu_meter;
|
||||
else
|
||||
value = this.parametersOutValues[i];
|
||||
var value = this.parametersOutValues[i];
|
||||
if (value != this.parametersOut[i].value) {
|
||||
this.paramOutChangeMsg.index = index;
|
||||
this.paramOutChangeMsg.value = value;
|
||||
@ -158,10 +149,6 @@ class Processor extends AudioWorkletProcessor {
|
||||
this.parametersOut[i].value = value;
|
||||
}
|
||||
}
|
||||
const processTimeEnd = performance.now();
|
||||
const processTimeMs = processTimeEnd - processTimeStart;
|
||||
const processTimeS = processTimeMs * 0.001;
|
||||
cpu_meter = cpu_meter * 0.9 + (processTimeS * sampleRate) * 0.1;
|
||||
|
||||
return true; // because Chrome sucks: https://bugs.chromium.org/p/chromium/issues/detail?id=921354
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user