Compare commits

..

No commits in common. "5d07c39170b89ab3d9cdb867bc532c83f2e8453f" and "67cddf552be91d74fdd50ad27648976383b9f773" have entirely different histories.

3 changed files with 263 additions and 295 deletions

View File

@ -211,10 +211,6 @@ static struct {
{{~}} {{~}}
}; };
{{?it.product.parameters.find(x => x.direction == "output" && x.isCpumeter)}}
# define PARAM_OUT_CPU_INDEX {{=it.product.parameters.indexOf(it.product.parameters.find(x => x.direction == "output" && x.isCpumeter))}}
{{?}}
# endif # endif
#endif #endif

View File

@ -64,10 +64,6 @@ typedef struct {
#include <pmmintrin.h> #include <pmmintrin.h>
#endif #endif
#ifdef PARAM_OUT_CPU_INDEX
# include "fatica.h"
#endif
// COM in C doc: // COM in C doc:
// https://github.com/rubberduck-vba/Rubberduck/wiki/COM-in-plain-C // https://github.com/rubberduck-vba/Rubberduck/wiki/COM-in-plain-C
// https://devblogs.microsoft.com/oldnewthing/20040205-00/?p=40733 // https://devblogs.microsoft.com/oldnewthing/20040205-00/?p=40733
@ -226,9 +222,6 @@ typedef struct pluginInstance {
char midiOutputsActive[DATA_PRODUCT_BUSES_MIDI_OUTPUT_N]; char midiOutputsActive[DATA_PRODUCT_BUSES_MIDI_OUTPUT_N];
#endif #endif
void * mem; void * mem;
#ifdef PARAM_OUT_CPU_INDEX
float cpu_meter;
#endif
} pluginInstance; } pluginInstance;
static Steinberg_Vst_IComponentVtbl pluginVtblIComponent; static Steinberg_Vst_IComponentVtbl pluginVtblIComponent;
@ -327,9 +320,6 @@ static Steinberg_tresult pluginInitialize(void *thisInterface, struct Steinberg_
p->midiOutputsActive[i] = 0; p->midiOutputsActive[i] = 0;
#endif #endif
p->mem = NULL; p->mem = NULL;
#ifdef PARAM_OUT_CPU_INDEX
p->cpu_meter = 0.f;
#endif
return Steinberg_kResultOk; return Steinberg_kResultOk;
} }
@ -748,10 +738,6 @@ static void processParams(pluginInstance *p, struct Steinberg_Vst_ProcessData *d
static Steinberg_tresult pluginProcess(void* thisInterface, struct Steinberg_Vst_ProcessData* data) { static Steinberg_tresult pluginProcess(void* thisInterface, struct Steinberg_Vst_ProcessData* data) {
TRACE("plugin IAudioProcessor process\n"); TRACE("plugin IAudioProcessor process\n");
#ifdef PARAM_OUT_CPU_INDEX
const unsigned long long processTimeStart = fatica_time_process();
#endif
#if defined(__aarch64__) #if defined(__aarch64__)
uint64_t fpcr; uint64_t fpcr;
__asm__ __volatile__ ("mrs %0, fpcr" : "=r"(fpcr)); __asm__ __volatile__ ("mrs %0, fpcr" : "=r"(fpcr));
@ -827,13 +813,7 @@ static Steinberg_tresult pluginProcess(void* thisInterface, struct Steinberg_Vst
for (Steinberg_int32 i = 0; i < DATA_PRODUCT_PARAMETERS_N; i++) { for (Steinberg_int32 i = 0; i < DATA_PRODUCT_PARAMETERS_N; i++) {
if (!(parameterInfo[i].flags & Steinberg_Vst_ParameterInfo_ParameterFlags_kIsReadOnly)) if (!(parameterInfo[i].flags & Steinberg_Vst_ParameterInfo_ParameterFlags_kIsReadOnly))
continue; continue;
float v; float v = plugin_get_parameter(&p->p, parameterData[i].index);
# ifdef PARAM_OUT_CPU_INDEX
if (i == PARAM_OUT_CPU_INDEX)
v = p->cpu_meter;
else
# endif
v = plugin_get_parameter(&p->p, parameterData[i].index);
if (v == p->parameters[i]) if (v == p->parameters[i])
continue; continue;
p->parameters[i] = v; p->parameters[i] = v;
@ -857,13 +837,6 @@ static Steinberg_tresult pluginProcess(void* thisInterface, struct Steinberg_Vst
_MM_SET_DENORMALS_ZERO_MODE(denormals_zero_mode); _MM_SET_DENORMALS_ZERO_MODE(denormals_zero_mode);
#endif #endif
#ifdef PARAM_OUT_CPU_INDEX
const unsigned long long processTimeEnd = fatica_time_process();
const unsigned long long processTime100n = processTimeEnd - processTimeStart;
const double processTimeS = ((double) processTime100n) * 1.0e-7;
p->cpu_meter = p->cpu_meter * 0.9f + ((float) (processTimeS * p->sampleRate)) * 0.1f;
#endif
return Steinberg_kResultOk; return Steinberg_kResultOk;
} }

View File

@ -3,7 +3,6 @@
dir=`dirname $0` dir=`dirname $0`
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3 $dir/../out/vst3 $dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3 $dir/../out/vst3
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json,$dir/vst3-make.json $dir/../templates/vst3-make $dir/../out/vst3 $dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json,$dir/vst3-make.json $dir/../templates/vst3-make $dir/../out/vst3
cp $dir/../templates/common/* $dir/../out/vst3/src/
cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/vst3/src cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/vst3/src
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2 $dir/../out/lv2 $dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2 $dir/../out/lv2