-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.cpp
46 lines (33 loc) · 1 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "voiceprintview.h"
#include <QDebug>
#include <QPainter>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
audioReader = new AudioReader(this);
//vpv = new VoicePrintView(this);
//setCentralWidget(vpv);
vpv = ui->viewArea;
connect(audioReader, SIGNAL(incoming(std::int16_t const*,std::size_t)),
vpv, SLOT(deliverSamples(std::int16_t const*,std::size_t)));
connect(audioReader, SIGNAL(inputLevel(int)),
ui->inputLevel, SLOT(setValue(int)));
connect(ui->inputGain, SIGNAL(valueChanged(int)),
audioReader, SLOT(setGain(int)));
connect(ui->speedSlider, SIGNAL(valueChanged(int)),
audioReader, SLOT(setBatchRate(int)));
startTimer(8, Qt::PreciseTimer);
audioReader->start();
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::timerEvent(QTimerEvent *event)
{
ui->viewArea->repaint();
}