mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-26 19:22:30 -05:00
Piano: Set step property for ADSR sliders
This commit is contained in:
parent
c7f549ba19
commit
1176167944
Notes:
sideshowbarker
2024-07-19 09:16:20 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/11761679449 Pull-request: https://github.com/SerenityOS/serenity/pull/1229
1 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
|||
m_attack_knob = GUI::VerticalSlider::construct(m_knobs_container);
|
||||
m_attack_knob->set_range(0, max_attack);
|
||||
m_attack_knob->set_value(max_attack - m_audio_engine.attack());
|
||||
m_attack_knob->set_step(100);
|
||||
m_attack_knob->on_value_changed = [this](int value) {
|
||||
int new_attack = max_attack - value;
|
||||
m_audio_engine.set_attack(new_attack);
|
||||
|
@ -112,6 +113,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
|||
m_decay_knob = GUI::VerticalSlider::construct(m_knobs_container);
|
||||
m_decay_knob->set_range(0, max_decay);
|
||||
m_decay_knob->set_value(max_decay - m_audio_engine.decay());
|
||||
m_decay_knob->set_step(100);
|
||||
m_decay_knob->on_value_changed = [this](int value) {
|
||||
int new_decay = max_decay - value;
|
||||
m_audio_engine.set_decay(new_decay);
|
||||
|
@ -123,6 +125,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
|||
m_sustain_knob = GUI::VerticalSlider::construct(m_knobs_container);
|
||||
m_sustain_knob->set_range(0, max_sustain);
|
||||
m_sustain_knob->set_value(max_sustain - m_audio_engine.sustain());
|
||||
m_sustain_knob->set_step(100);
|
||||
m_sustain_knob->on_value_changed = [this](int value) {
|
||||
int new_sustain = max_sustain - value;
|
||||
m_audio_engine.set_sustain(new_sustain);
|
||||
|
@ -134,6 +137,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
|||
m_release_knob = GUI::VerticalSlider::construct(m_knobs_container);
|
||||
m_release_knob->set_range(0, max_release);
|
||||
m_release_knob->set_value(max_release - m_audio_engine.release());
|
||||
m_release_knob->set_step(100);
|
||||
m_release_knob->on_value_changed = [this](int value) {
|
||||
int new_release = max_release - value;
|
||||
m_audio_engine.set_release(new_release);
|
||||
|
|
Loading…
Add table
Reference in a new issue