2023-01-15 17:01:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "FrameSource.h"
|
|
|
|
#include "../shape/Shape.h"
|
2023-01-15 22:34:02 +00:00
|
|
|
#include "../obj/WorldObject.h"
|
2023-02-05 00:43:57 +00:00
|
|
|
#include "../svg/SvgParser.h"
|
2023-02-05 20:36:51 +00:00
|
|
|
#include "../txt/TextParser.h"
|
2024-04-15 19:54:25 +00:00
|
|
|
#include "../gpla/LineArtParser.h"
|
2023-04-04 15:17:37 +00:00
|
|
|
#include "../lua/LuaParser.h"
|
2024-05-11 22:10:54 +00:00
|
|
|
#include "../img/ImageParser.h"
|
2024-08-22 15:59:21 +00:00
|
|
|
#include "../wav/WavParser.h"
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2024-05-11 22:10:54 +00:00
|
|
|
class OscirenderAudioProcessor;
|
2023-08-27 18:33:42 +00:00
|
|
|
class FileParser {
|
2023-01-15 17:01:27 +00:00
|
|
|
public:
|
2024-05-11 22:10:54 +00:00
|
|
|
FileParser(OscirenderAudioProcessor &p, std::function<void(int, juce::String, juce::String)> errorCallback = nullptr);
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2024-04-15 19:54:25 +00:00
|
|
|
void parse(juce::String fileName, juce::String extension, std::unique_ptr<juce::InputStream> stream, juce::Font font);
|
2023-08-27 18:33:42 +00:00
|
|
|
std::vector<std::unique_ptr<Shape>> nextFrame();
|
2024-02-26 22:11:37 +00:00
|
|
|
Point nextSample(lua_State*& L, LuaVariables& vars);
|
2023-12-20 23:30:20 +00:00
|
|
|
void closeLua(lua_State*& L);
|
2023-08-27 18:33:42 +00:00
|
|
|
bool isSample();
|
|
|
|
bool isActive();
|
|
|
|
void disable();
|
|
|
|
void enable();
|
2023-01-15 17:01:27 +00:00
|
|
|
|
2023-07-04 13:58:36 +00:00
|
|
|
std::shared_ptr<WorldObject> getObject();
|
|
|
|
std::shared_ptr<SvgParser> getSvg();
|
|
|
|
std::shared_ptr<TextParser> getText();
|
2024-04-15 19:54:25 +00:00
|
|
|
std::shared_ptr<LineArtParser> getLineArt();
|
2023-07-04 13:58:36 +00:00
|
|
|
std::shared_ptr<LuaParser> getLua();
|
2024-05-11 22:10:54 +00:00
|
|
|
std::shared_ptr<ImageParser> getImg();
|
2024-08-22 15:59:21 +00:00
|
|
|
std::shared_ptr<WavParser> getWav();
|
2023-07-04 13:58:36 +00:00
|
|
|
|
2024-04-15 19:54:25 +00:00
|
|
|
bool isAnimatable = false;
|
|
|
|
|
2023-01-15 17:01:27 +00:00
|
|
|
private:
|
2024-05-11 22:10:54 +00:00
|
|
|
OscirenderAudioProcessor& audioProcessor;
|
|
|
|
|
2023-01-15 17:01:27 +00:00
|
|
|
bool active = true;
|
2023-07-01 14:29:53 +00:00
|
|
|
bool sampleSource = false;
|
2023-01-15 22:34:02 +00:00
|
|
|
|
2023-07-11 21:28:54 +00:00
|
|
|
juce::SpinLock lock;
|
|
|
|
|
2023-02-05 19:36:50 +00:00
|
|
|
std::shared_ptr<WorldObject> object;
|
|
|
|
std::shared_ptr<SvgParser> svg;
|
2023-02-05 20:36:51 +00:00
|
|
|
std::shared_ptr<TextParser> text;
|
2024-04-15 19:54:25 +00:00
|
|
|
std::shared_ptr<LineArtParser> gpla;
|
2023-04-04 15:17:37 +00:00
|
|
|
std::shared_ptr<LuaParser> lua;
|
2024-05-11 22:10:54 +00:00
|
|
|
std::shared_ptr<ImageParser> img;
|
2024-08-22 15:59:21 +00:00
|
|
|
std::shared_ptr<WavParser> wav;
|
2023-09-14 19:21:08 +00:00
|
|
|
|
|
|
|
juce::String fallbackLuaScript = "return { 0.0, 0.0 }";
|
2023-12-20 17:13:38 +00:00
|
|
|
|
2023-12-20 17:47:58 +00:00
|
|
|
std::function<void(int, juce::String, juce::String)> errorCallback;
|
2023-09-05 21:57:29 +00:00
|
|
|
};
|