-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
54 lines (43 loc) · 1.38 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*===============================================================================================
Pitch detection example code copyright (c), Firelight Technologies Pty, Ltd 2004-2011.
This example combines recording with spectrum analysis to determine the pitch of the sound
being recorded.
===============================================================================================*/
#include "mappingsinterface.h"
#include "pitch_detector.h"
#include "feedbackwindow.h"
#include "indicator.h"
#include <QtGui/QApplication>
#include <pthread.h>
using namespace std;
pthread_t pitchDetectorThread;
pthread_t feedbackWindowThread;
void *PitchThreadFn (void *_detector)
{
PitchDetector *detector = (PitchDetector *)_detector;
detector->DetectPitch();
return NULL;
}
void *FeedbackWindowThreadFn (void *UNUSED)
{
return NULL;
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//Configuration window
MappingsInterface mapWindow;
mapWindow.show();
//Feedback window
//pthread_create(&feedbackWindowThread, NULL,
// FeedbackWindowThreadFn, NULL);
FeedbackWindow feedbackWindow;
feedbackWindow.show();
QWidget* centralWidget = feedbackWindow.findChild<QWidget*>("centralWidget");
Indicator indicator(centralWidget);
PitchDetector detector(mapWindow, indicator);
pthread_create(&pitchDetectorThread, NULL,
PitchThreadFn, &detector);
a.exec();
return 0;
}