-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
38 lines (26 loc) · 1003 Bytes
/
main.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
#include "components/MainWindow.h"
#include <QApplication>
#include "utility.h"
#include "pc/producer.h"
#include "pc/consumer.h"
using namespace moodycamel;
using namespace std;
int main(int argc, char *argv[]) {
qRegisterMetaType<vector_double>("vector_double");
producer* producer_pointer = new producer(_SAMPLE_RATE_);
consumer* consumer_pointer = new consumer(producer_pointer, _SAMPLE_RATE_, _NUM_POINTS_);
consumer_pointer->run();
producer_pointer->run();
QApplication app(argc, argv);
MainWindow window;
window.resize(1200, 800);
window.show();
QObject::connect(consumer_pointer, SIGNAL(onNewSpectrum(vector_double)), &window, SLOT(onNewSpectrum(vector_double)));
QObject::connect(consumer_pointer, SIGNAL(onNewDecibel(vector_double)), &window, SLOT(onNewDecibel(vector_double)));
int r = app.exec();
consumer_pointer->stop();
producer_pointer->stop();
delete consumer_pointer;
delete producer_pointer;
return r;
}