ladybird/Userland/Applications/Piano/TrackControlsWidget.cpp
kleines Filmröllchen 7b3b743f88 Piano: Move octave controls into main widget
This is not related to the track controls and it may move into another
separate widget in the future. The move also allows to simplify the
octave slider callback logic.
2023-02-25 20:49:41 -07:00

35 lines
1.3 KiB
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2019-2020, William McPherson <willmcpherson2@gmail.com>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "TrackControlsWidget.h"
#include "MainWidget.h"
#include "ProcessorParameterWidget/ParameterWidget.h"
#include "TrackManager.h"
#include <LibDSP/ProcessorParameter.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Label.h>
#include <LibGfx/Orientation.h>
TrackControlsWidget::TrackControlsWidget(TrackManager& track_manager, MainWidget& main_widget)
: m_track_manager(track_manager)
, m_main_widget(main_widget)
{
set_layout<GUI::HorizontalBoxLayout>();
set_preferred_width(GUI::SpecialDimension::Grow);
set_fill_with_background_color(true);
for (auto& parameter : m_track_manager.current_track()->track_mastering()->parameters())
m_parameter_widgets.append(add<ProcessorParameterWidget>(parameter));
for (auto& parameter : m_track_manager.current_track()->synth()->parameters())
m_parameter_widgets.append(add<ProcessorParameterWidget>(parameter));
for (auto& parameter : m_track_manager.current_track()->delay()->parameters())
m_parameter_widgets.append(add<ProcessorParameterWidget>(parameter));
}