osci-render/Source/audio/LuaEffect.cpp

18 wiersze
551 B
C++
Czysty Zwykły widok Historia

2023-07-04 13:58:36 +00:00
#include "LuaEffect.h"
#include "../lua/LuaParser.h"
Vector2 LuaEffect::apply(int index, Vector2 input, const std::vector<double>& values, double sampleRate) {
2023-07-04 13:58:36 +00:00
int fileIndex = audioProcessor.getCurrentFileIndex();
if (fileIndex == -1) {
return input;
}
std::shared_ptr<LuaParser> parser = audioProcessor.getCurrentFileParser()->getLua();
if (parser != nullptr) {
parser->setVariable("slider_" + name.toLowerCase(), values[0]);
2023-07-04 13:58:36 +00:00
}
audioProcessor.perspectiveEffect->setVariable("slider_" + name.toLowerCase(), values[0]);
2023-07-04 13:58:36 +00:00
return input;
}