#pragma once #include "FrameSource.h" #include "../shape/Shape.h" #include "../obj/WorldObject.h" #include "../svg/SvgParser.h" #include "../txt/TextParser.h" #include "../gpla/LineArtParser.h" #include "../lua/LuaParser.h" #include "../img/ImageParser.h" #include "../wav/WavParser.h" class OscirenderAudioProcessor; class FileParser { public: FileParser(OscirenderAudioProcessor &p, std::function errorCallback = nullptr); void parse(juce::String fileName, juce::String extension, std::unique_ptr stream, juce::Font font); std::vector> nextFrame(); Point nextSample(lua_State*& L, LuaVariables& vars); void closeLua(lua_State*& L); bool isSample(); bool isActive(); void disable(); void enable(); std::shared_ptr getObject(); std::shared_ptr getSvg(); std::shared_ptr getText(); std::shared_ptr getLineArt(); std::shared_ptr getLua(); std::shared_ptr getImg(); std::shared_ptr getWav(); bool isAnimatable = false; private: OscirenderAudioProcessor& audioProcessor; bool active = true; bool sampleSource = false; juce::SpinLock lock; std::shared_ptr object; std::shared_ptr svg; std::shared_ptr text; std::shared_ptr gpla; std::shared_ptr lua; std::shared_ptr img; std::shared_ptr wav; juce::String fallbackLuaScript = "return { 0.0, 0.0 }"; std::function errorCallback; };