audio checkpoint

This commit is contained in:
2025-12-21 22:49:10 -06:00
parent 9ac5eaaba8
commit 783330990e
8 changed files with 241 additions and 6 deletions

View File

@@ -2,10 +2,8 @@
#include "MainWindow.h"
#include "ui_MainWindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
ui(new Ui::MainWindow)
{
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
// Initialize UI
@@ -22,6 +20,13 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->inputStep, &QLineEdit::editingFinished, this, &MainWindow::onStepChanged);
connect(ui->inputValue, &QLineEdit::editingFinished, this, &MainWindow::onValueChanged);
// synth business
synth_ = new Synth(this);
audioStream_ = new AudioStream(synth_, this);
audioStream_->start();
synth_->audioSink()->start(audioStream_);
}
MainWindow::~MainWindow() {
@@ -46,6 +51,8 @@ void MainWindow::updateCounterLabel() {
void MainWindow::onSliderValueChanged(int value) {
QSignalBlocker blocker(ui->inputValue);
ui->inputValue->setText(QString::number(value));
synth_->setFrequency(static_cast<float>(value));
}
// allows only values within the min, max to be set by the text field