diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-12 18:16:50 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-05-02 15:37:23 +0200 |
commit | d9c671d14dacf3d7c02305df9b7d5fba67357a55 (patch) | |
tree | 5cc26dbfa910a4a7b6357157bea439d6330b0532 /plugingui/resamplingframecontent.cc | |
parent | 2c395c676ebe4c821ac7126323ab0c15febb9bfe (diff) |
Add setting and knob for controlling resampling quality.
Diffstat (limited to 'plugingui/resamplingframecontent.cc')
-rw-r--r-- | plugingui/resamplingframecontent.cc | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/plugingui/resamplingframecontent.cc b/plugingui/resamplingframecontent.cc index 6026154..717df0f 100644 --- a/plugingui/resamplingframecontent.cc +++ b/plugingui/resamplingframecontent.cc @@ -31,9 +31,11 @@ namespace GUI { -ResamplingframeContent::ResamplingframeContent( - Widget* parent, SettingsNotifier& settings_notifier) - : Widget(parent) +ResamplingframeContent::ResamplingframeContent(Widget* parent, + Settings& settings, + SettingsNotifier& settings_notifier) + : Widget(parent) + , settings(settings) , settings_notifier(settings_notifier) { CONNECT(this, settings_notifier.drumkit_samplerate, @@ -42,10 +44,23 @@ ResamplingframeContent::ResamplingframeContent( this, &ResamplingframeContent::updateSessionSamplerate); CONNECT(this, settings_notifier.resampling_recommended, this, &ResamplingframeContent::updateResamplingRecommended); + CONNECT(this, settings_notifier.resampling_quality, + this, &ResamplingframeContent::updateResamplingQuality); text_field.move(0, 0); text_field.setReadOnly(true); + quality_knob.resize(30, 30); + quality_knob.setDefaultValue(0.7f); + quality_knob.showValue(false); + + quality_label.setText("Quality"); + quality_label.setAlignment(TextAlignment::center); + quality_label.resize(40, 16); + + CONNECT(&quality_knob, valueChangedNotifier, + this, &ResamplingframeContent::valueChangedNotifier); + updateContent(); text_field.show(); } @@ -53,7 +68,9 @@ ResamplingframeContent::ResamplingframeContent( void ResamplingframeContent::resize(std::size_t width, std::size_t height) { Widget::resize(width, height); - text_field.resize(width, height); + text_field.resize(width - 50, height); + quality_knob.move(width - 36, 20); + quality_label.move(width - 40, 0); } void ResamplingframeContent::updateContent() @@ -88,4 +105,14 @@ void ResamplingframeContent::updateResamplingRecommended(bool resampling_recomme updateContent(); } +void ResamplingframeContent::updateResamplingQuality(float resampling_quality) +{ + quality_knob.setValue(resampling_quality); +} + +void ResamplingframeContent::valueChangedNotifier(float value) +{ + settings.resampling_quality.store(value); +} + } // GUI:: |