1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 12:05:07 +00:00
serenity/Userland/Applications/Piano/KnobsWidget.h
kleines Filmröllchen b14a64b3c8 Piano: Move to LibDSP's Classic synthesizer
Almost all synthesizer code in Piano is removed in favor of the LibDSP
reimplementation.

This causes some issues that mainly have to do with the way Piano
currently handles talking to LibDSP. Additionally, the sampler is gone
for now and will be reintroduced with future work.
2021-11-22 22:26:17 +01:00

56 lines
1.6 KiB
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2019-2020, William McPherson <willmcpherson2@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "ProcessorParameterWidget/Dropdown.h"
#include "ProcessorParameterWidget/Slider.h"
#include <AK/NonnullRefPtrVector.h>
#include <LibDSP/ProcessorParameter.h>
#include <LibDSP/Synthesizers.h>
#include <LibGUI/Frame.h>
#include <LibGUI/Label.h>
#include <LibGUI/Widget.h>
class TrackManager;
class MainWidget;
class KnobsWidget final : public GUI::Frame {
C_OBJECT(KnobsWidget)
public:
virtual ~KnobsWidget() override;
void update_knobs();
void cycle_waveform();
private:
KnobsWidget(TrackManager&, MainWidget&);
TrackManager& m_track_manager;
MainWidget& m_main_widget;
RefPtr<GUI::Widget> m_labels_container;
RefPtr<GUI::Label> m_volume_label;
RefPtr<GUI::Label> m_octave_label;
NonnullRefPtrVector<GUI::Label> m_synth_labels;
NonnullRefPtrVector<GUI::Label> m_delay_labels;
RefPtr<GUI::Widget> m_values_container;
RefPtr<GUI::Label> m_volume_value;
RefPtr<GUI::Label> m_octave_value;
NonnullRefPtrVector<GUI::Label> m_synth_values;
NonnullRefPtrVector<GUI::Label> m_delay_values;
RefPtr<GUI::Widget> m_knobs_container;
RefPtr<GUI::Slider> m_volume_knob;
RefPtr<GUI::Slider> m_octave_knob;
RefPtr<ProcessorParameterDropdown<LibDSP::Synthesizers::Waveform>> m_synth_waveform;
NonnullRefPtrVector<GUI::Widget> m_synth_knobs;
NonnullRefPtrVector<ProcessorParameterSlider> m_delay_knobs;
bool m_change_underlying { true };
};