summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorTibor Nagy <xnagytibor@gmail.com>2020-02-16 15:13:22 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-16 21:58:01 +0100
commit1176167944940ab7f4511e66fc94e4913a0f1e05 (patch)
treeb744862ba5a2c0e05d7d1db6973d341cb3888e02 /Applications
parentc7f549ba19f546944958c11d0ac96e63063062ab (diff)
downloadserenity-1176167944940ab7f4511e66fc94e4913a0f1e05.zip
Piano: Set step property for ADSR sliders
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Piano/KnobsWidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Applications/Piano/KnobsWidget.cpp b/Applications/Piano/KnobsWidget.cpp
index ecec376fb6..f817b58db3 100644
--- a/Applications/Piano/KnobsWidget.cpp
+++ b/Applications/Piano/KnobsWidget.cpp
@@ -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);