-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
53 lines (37 loc) · 1.53 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
/*
* File: main.cpp
* Author: astral
*
* Created on 11 Июль 2012 г., 17:39
*/
#include <QtGui/QApplication>
#include "AudioIO.h"
#include "Mixer.h"
#include "SingleToneAnalyzer.h"
#include "ChordAnalyzer.h"
#include "Scholar.h"
#include "Tutor.h"
#include "LessonFile.pb.h"
int main(int argc, char *argv[]) {
GOOGLE_PROTOBUF_VERIFY_VERSION;
// initialize resources, if needed
// Q_INIT_RESOURCE(resfile);
QApplication app(argc, argv);
// create and show your widgets here
AudioIO *audio = new AudioIO();
Mixer *mixer = new Mixer(audio); mixer->startProcess();
//Test
//Metronome *metronome = new Metronome(mixer);
SingleToneAnalyzer *sAna = new SingleToneAnalyzer(BUF_SIZE, SAMPLE_RATE, audio);
//sAna->start(); // TODO started by Tuner and Scholar
ChordAnalyzer *chAna = new ChordAnalyzer(BUF_SIZE, SAMPLE_RATE, audio);
Scholar *scholar = new Scholar(audio, mixer, sAna, chAna);
scholar->show(); // TODO started by Scholar
Tutor *tutor = new Tutor(audio);
//tutor->show();
QObject::connect( scholar, SIGNAL(PassToTutor(Lesson*)), tutor, SLOT(FetchFromScholar(Lesson*)) );
QObject::connect( tutor, SIGNAL(PassToScholar(Lesson*)), scholar, SLOT(FetchFromTutor(Lesson*)) );
QObject::connect( &app, SIGNAL(lastWindowClosed()), audio, SLOT(Destroy()) ); // TODO same for sAna and chAna (?)
QObject::connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
return app.exec();
}