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"
|
|
|
|
#include "../obj/Camera.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"
|
2023-04-04 15:17:37 +00:00
|
|
|
#include "../lua/LuaParser.h"
|
2023-01-15 17:01:27 +00:00
|
|
|
|
|
|
|
class FileParser : public FrameSource {
|
|
|
|
public:
|
|
|
|
FileParser();
|
|
|
|
|
2023-01-15 22:34:02 +00:00
|
|
|
void parse(juce::String extension, std::unique_ptr<juce::InputStream>) override;
|
2023-04-04 15:17:37 +00:00
|
|
|
std::vector<std::unique_ptr<Shape>> nextFrame() override;
|
2023-07-01 14:29:53 +00:00
|
|
|
Vector2 nextSample() override;
|
|
|
|
bool isSample() override;
|
2023-01-15 17:01:27 +00:00
|
|
|
bool isActive() override;
|
|
|
|
void disable() override;
|
|
|
|
void enable() override;
|
|
|
|
|
2023-07-04 13:58:36 +00:00
|
|
|
std::shared_ptr<WorldObject> getObject();
|
|
|
|
std::shared_ptr<Camera> getCamera();
|
|
|
|
std::shared_ptr<SvgParser> getSvg();
|
|
|
|
std::shared_ptr<TextParser> getText();
|
|
|
|
std::shared_ptr<LuaParser> getLua();
|
|
|
|
|
2023-01-15 17:01:27 +00:00
|
|
|
private:
|
|
|
|
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<Camera> camera;
|
|
|
|
std::shared_ptr<SvgParser> svg;
|
2023-02-05 20:36:51 +00:00
|
|
|
std::shared_ptr<TextParser> text;
|
2023-04-04 15:17:37 +00:00
|
|
|
std::shared_ptr<LuaParser> lua;
|
2023-01-15 17:01:27 +00:00
|
|
|
};
|