cleanup envelope parameter mappings

This commit is contained in:
2025-12-26 18:42:14 -06:00
parent c5d0fe6091
commit cc11cfe63a
9 changed files with 51 additions and 8 deletions

View File

@@ -11,16 +11,16 @@ MainWindow::MainWindow(QWidget *parent) :
audio_(new AudioEngine()),
keyboard_(audio_->noteQueue()) {
// Initialize UI
// initialize ui
ui_->setupUi(this);
setFocusPolicy(Qt::StrongFocus);
// connect scope
ui_->scopeWidget->setScopeBuffer(&audioEngine_->scopeBuffer());
// Connect buttons to slots
connect(ui_->buttonReset, &QPushButton::clicked, this, &MainWindow::onResetClicked);
// synth business
audio_->start();
// connect envelopeGenerator
ui_->envelopeOsc1Volume->init(EnvelopeId::Osc1Volume);
connect(ui_->envelopeOsc1Volume, &EnvelopeGenerator::envelopeChanged,
@@ -28,6 +28,10 @@ MainWindow::MainWindow(QWidget *parent) :
audio_->parameters()->set(EnvelopeId::Osc1Volume, a, d, s, r);
});
// this should be easy enough to put into a for each envelopeGenerator loop
// synth business
audio_->start();
}
MainWindow::~MainWindow() {

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<height>800</height>
</rect>
</property>
<property name="windowTitle">
@@ -51,6 +51,19 @@
<bool>true</bool>
</property>
</widget>
<widget class="Scope" name="scope" native="true">
<property name="geometry">
<rect>
<x>200</x>
<y>540</y>
<width>400</width>
<height>200</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
<customwidgets>
@@ -60,6 +73,12 @@
<header>EnvelopeGenerator/EnvelopeGenerator.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Scope</class>
<extends>QWidget</extends>
<header>Scope/Scope.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@@ -16,6 +16,7 @@ public:
explicit EnvelopeGenerator(QWidget* parent = nullptr);
~EnvelopeGenerator();
// connects signals, sets parameters to the defaults defined in paramStore
void init(EnvelopeId id);
// setters