#pragma once #include "widget.h" #include "bpmslider.h" #include #include #include class BPMCalculator; class BPMCalculatorWidget : public Widget { public: explicit BPMCalculatorWidget(const std::shared_ptr& bpm_calculator, const std::shared_ptr &font); virtual void input(const sf::Event& event) override; virtual void update(const sf::Time& dt) override; virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override; virtual void setRect(const sf::FloatRect& rect) override; virtual void setPosition(const sf::Vector2f& position) override; virtual bool isUnderMouse(int mouse_x, int mouse_y) const override; private: std::shared_ptr _bpm_calculator; std::shared_ptr _slider; sf::RectangleShape _widget_window; std::function _on_click_callback; };