2023-04-04 15:17:37 +00:00
|
|
|
#pragma once
|
|
|
|
#include "../shape/Vector2.h"
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "../shape/Shape.h"
|
|
|
|
|
|
|
|
struct lua_State;
|
|
|
|
class LuaParser {
|
|
|
|
public:
|
|
|
|
LuaParser(juce::String script);
|
|
|
|
~LuaParser();
|
|
|
|
|
2023-07-01 14:29:53 +00:00
|
|
|
Vector2 draw();
|
2023-07-04 19:47:54 +00:00
|
|
|
void setVariable(juce::String variableName, double value);
|
2023-07-04 13:58:36 +00:00
|
|
|
|
2023-04-04 15:17:37 +00:00
|
|
|
private:
|
2023-07-01 14:29:53 +00:00
|
|
|
void parse();
|
2023-07-04 13:58:36 +00:00
|
|
|
|
2023-07-01 14:29:53 +00:00
|
|
|
int functionRef = -1;
|
2023-04-04 15:17:37 +00:00
|
|
|
long step = 1;
|
|
|
|
lua_State* L;
|
|
|
|
juce::String script;
|
2023-07-04 13:58:36 +00:00
|
|
|
std::atomic<bool> updateVariables = false;
|
2023-07-04 19:47:54 +00:00
|
|
|
juce::SpinLock variableLock;
|
2023-07-04 13:58:36 +00:00
|
|
|
std::vector<juce::String> variableNames;
|
|
|
|
std::vector<double> variables;
|
2023-04-04 15:17:37 +00:00
|
|
|
};
|