#pragma once #include #include "TimelineLookAndFeel.h" #include "SvgButton.h" class TimelineComponent : public juce::Component, public juce::Timer { public: TimelineComponent(); ~TimelineComponent() override; void resized() override; // Callbacks that derived classes will implement std::function onValueChange; std::function onPlay; std::function onPause; std::function onStop; std::function onRepeatChanged; std::function isActive; // Public interface void setValue(double value, juce::NotificationType notification); double getValue() const; void setPlaying(bool shouldBePlaying); bool isPlaying() const; void setRepeat(bool shouldRepeat); bool getRepeat() const; void setRange(double start, double end); protected: void timerCallback() override; virtual void setup() {} TimelineLookAndFeel timelineLookAndFeel; juce::Slider slider; SvgButton playButton{"Play", BinaryData::play_svg, juce::Colours::white, juce::Colours::white}; SvgButton pauseButton{"Pause", BinaryData::pause_svg, juce::Colours::white, juce::Colours::white}; SvgButton stopButton{"Stop", BinaryData::stop_svg, juce::Colours::white, juce::Colours::white}; SvgButton repeatButton{"Repeat", BinaryData::repeat_svg, juce::Colours::white, Colours::accentColor}; private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(TimelineComponent) };