LibDSP: Remove Track volume getters and setters

This commit is contained in:
kleines Filmröllchen 2022-07-23 15:50:25 +02:00 committed by Andreas Kling
parent a0b2e8608b
commit ab2d8edcbb
Notes: sideshowbarker 2024-07-17 20:33:50 +09:00
3 changed files with 1 additions and 25 deletions

View file

@ -34,7 +34,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
m_values_container->set_layout<GUI::HorizontalBoxLayout>();
m_values_container->set_fixed_height(10);
m_volume_value = m_values_container->add<GUI::Label>(String::number(m_track_manager.current_track()->volume()));
m_volume_value = m_values_container->add<GUI::Label>(String::number(0));
m_octave_value = m_values_container->add<GUI::Label>(String::number(m_track_manager.keyboard()->virtual_keyboard_octave()));
m_knobs_container = add<GUI::Widget>();
@ -44,15 +44,7 @@ KnobsWidget::KnobsWidget(TrackManager& track_manager, MainWidget& main_widget)
m_volume_knob = m_knobs_container->add<GUI::VerticalSlider>();
m_volume_knob->set_range(0, volume_max);
m_volume_knob->set_value(volume_max - m_track_manager.current_track()->volume());
m_volume_knob->set_step(10);
m_volume_knob->on_change = [this](int value) {
int new_volume = volume_max - value;
if (m_change_underlying)
m_track_manager.current_track()->set_volume(new_volume);
VERIFY(new_volume == m_track_manager.current_track()->volume());
m_volume_value->set_text(String::number(new_volume));
};
m_octave_knob = m_knobs_container->add<GUI::VerticalSlider>();
m_octave_knob->set_tooltip("Z: octave down, X: octave up");
@ -111,7 +103,6 @@ void KnobsWidget::update_knobs()
// need to change the slider without changing the underlying value.
m_change_underlying = false;
m_volume_knob->set_value(volume_max - m_track_manager.current_track()->volume());
m_octave_knob->set_value(octave_max - m_track_manager.keyboard()->virtual_keyboard_octave());
m_change_underlying = true;

View file

@ -43,18 +43,6 @@ bool Track::check_processor_chain_valid_with_initial_type(SignalType initial_typ
return true;
}
float Track::volume() const
{
// FIXME: This is a hack until we have a Master processor
return 1.0f;
}
void Track::set_volume(float volume) const
{
// FIXME: This is a hack until we have a Master processor
(void)volume;
}
NonnullRefPtr<Synthesizers::Classic> Track::synth()
{
return static_ptr_cast<Synthesizers::Classic>(m_processor_chain.ptr_at(0));

View file

@ -36,9 +36,6 @@ public:
NonnullRefPtrVector<Processor> const& processor_chain() const { return m_processor_chain; }
NonnullRefPtr<Transport const> transport() const { return m_transport; }
float volume() const;
void set_volume(float volume) const;
// FIXME: These two getters are temporary until we have dynamic processor UI
NonnullRefPtr<Synthesizers::Classic> synth();
NonnullRefPtr<Effects::Delay> delay();