/* * Copyright (c) 2021, Cesar Torres * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "VisualizationBase.h" #include #include #include class BarsVisualizationWidget final : public GUI::Frame , public Visualization { C_OBJECT(BarsVisualizationWidget) public: ~BarsVisualizationWidget() override; void set_buffer(RefPtr buffer) override; void set_samplerate(int samplerate) override; private: BarsVisualizationWidget(); void set_buffer(RefPtr buffer, int samples_to_use); void paint_event(GUI::PaintEvent&) override; void context_menu_event(GUI::ContextMenuEvent& event) override; Vector> m_sample_buffer; Vector m_gfx_falling_bars; int m_last_id; int m_sample_count; int m_samplerate; bool m_is_using_last; bool m_adjust_frequencies; RefPtr m_context_menu; };