osci-render/Source/parser/FileParser.h

57 wiersze
1.6 KiB
C
Czysty Zwykły widok Historia

#pragma once
#include "FrameSource.h"
#include "../shape/Shape.h"
#include "../obj/WorldObject.h"
#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"
#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"
2024-05-11 22:10:54 +00:00
class OscirenderAudioProcessor;
2023-08-27 18:33:42 +00:00
class FileParser {
public:
2024-05-11 22:10:54 +00:00
FileParser(OscirenderAudioProcessor &p, std::function<void(int, juce::String, juce::String)> errorCallback = nullptr);
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();
Point nextSample(lua_State*& L, LuaVariables& vars);
void closeLua(lua_State*& L);
2023-08-27 18:33:42 +00:00
bool isSample();
bool isActive();
void disable();
void enable();
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;
private:
2024-05-11 22:10:54 +00:00
OscirenderAudioProcessor& audioProcessor;
bool active = true;
bool sampleSource = false;
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;
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;
juce::String fallbackLuaScript = "return { 0.0, 0.0 }";
2023-12-20 17:13:38 +00:00
std::function<void(int, juce::String, juce::String)> errorCallback;
};