ladybird/Userland/Applications/SoundPlayer/BarsVisualizationWidget.h
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

38 lines
992 B
C++

/*
* Copyright (c) 2021, Cesar Torres <shortanemoia@protonmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "VisualizationBase.h"
#include <AK/Complex.h>
#include <LibAudio/Buffer.h>
#include <LibGUI/Frame.h>
class BarsVisualizationWidget final : public GUI::Frame
, public Visualization {
C_OBJECT(BarsVisualizationWidget)
public:
~BarsVisualizationWidget() override;
void set_buffer(RefPtr<Audio::Buffer> buffer) override;
void set_samplerate(int samplerate) override;
private:
BarsVisualizationWidget();
void set_buffer(RefPtr<Audio::Buffer> buffer, int samples_to_use);
void paint_event(GUI::PaintEvent&) override;
void mousedown_event(GUI::MouseEvent& event) override;
Vector<Complex<double>> m_sample_buffer;
Vector<int> 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<GUI::Menu> m_context_menu;
};