2023-07-04 13:58:36 +00:00
|
|
|
#include "LuaEffect.h"
|
|
|
|
#include "../lua/LuaParser.h"
|
|
|
|
|
2023-07-14 14:34:24 +00:00
|
|
|
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) {
|
2023-07-14 14:34:24 +00:00
|
|
|
parser->setVariable("slider_" + name.toLowerCase(), values[0]);
|
2023-07-04 13:58:36 +00:00
|
|
|
}
|
2023-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
audioProcessor.perspectiveEffect->setVariable("slider_" + name.toLowerCase(), values[0]);
|
|
|
|
|
2023-07-04 13:58:36 +00:00
|
|
|
return input;
|
|
|
|
}
|