#pragma once #include #include "../parser/FileParser.h" #include "../parser/FrameProducer.h" #include "../parser/FrameConsumer.h" #include "../concurrency/BlockingQueue.h" class ShapeSound : public juce::SynthesiserSound, public FrameConsumer { public: ShapeSound(std::shared_ptr parser); ShapeSound(); ~ShapeSound() override; bool appliesToNote(int note) override; bool appliesToChannel(int channel) override; void addFrame(std::vector>& frame, bool force = true) override; double updateFrame(std::vector>& frame); std::shared_ptr parser; using Ptr = juce::ReferenceCountedObjectPtr; private: BlockingQueue frames{10}; std::unique_ptr producer; double frameLength = 0.0; };