summaryrefslogtreecommitdiff
path: root/plugingui/resamplingframecontent.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/resamplingframecontent.cc')
-rw-r--r--plugingui/resamplingframecontent.cc35
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::