-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justdance.cpp
executable file
·99 lines (76 loc) · 2.29 KB
/
Justdance.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/videoio/videoio_c.h>
#include <opencv2/videoio.hpp>
#include <iostream>
#include <unistd.h>
#include <stdlib.h>
#include <thread>
#include "IdentificadorObjetoIndicador.hpp"
#include "Coreografia.hpp"
#include "Justdance.hpp"
int op = 0;
using namespace cv;
using namespace std;
VideoCapture capture = VideoCapture(0);
Mat frame;
int passosMus1[] = {0,8,2,6,3,5,3,5,1,7,0,8,0,8,2,6,3,5,3,5,1,7,0,8,0,8,2,6,3,5,3,5,1,7,0,8,0,8,2,6,3,5,3,5,1,7,0,8,4,4}; //Quantidade par e terminar em 44
void musica() {
while(op==0){
}
switch (op)
{
case 1:
system("/home/mirele/Documentos/Projetos/Justdance/play.txt");
break;
case 2:
system("/home/mirele/Documentos/Projetos/Justdance/play2.txt");
break;
default:
break;
}
}
void exibeMenu(){
printf("\n\n\t\t________________________Escolha sua música: ____________________\n"
"\t\t|\t\t\t\t\t\t\t\t|\n"
"\t\t|\t\t\t1 - Bad Romance - Lady Gaga\t\t\t|\n"
"\t\t|\t\t\t2 - Just Dance - Lady Gaga\t\t\t\t|\n"
"\t\t|\t\t\t\t\t\t\t\t|\n"
"\n\n\t\t________________________Sair do programa: ____________________\n"
"\t\t|\t\t\t\t\t\t\t\t|\n"
"\t\t|\t\t\t3 - Ranking \t\t\t\t|\n"
"\t\t|\t\t\t4 - Fechar \t\t\t\t|\n"
"\t\t|\t\t\t\t\t\t\t\t|\n"
"\t\t-----------------------------------------------------------------\n\n");
}
int main( int argc, char** argv ) {
//Testando classes
IdentificadorObjetoIndicador id = IdentificadorObjetoIndicador(capture);
Coreografia co = Coreografia("caminhoMusica",passosMus1);
Justdance jus = Justdance(co,id);
thread first = thread(musica);
while(1){
exibeMenu();
cout << "\t >>> Digite uma opcao: ";
cin >> op;
if(op==4){
break;
}
if(op == 1 || op == 2){
cout << "\nComecou!\n---------------------------------------------------------" << endl;
if (!id.capture.isOpened()) // Caso falhe em iniciar webcam
{
return 1;
}
//inicia o justdance
jus.play();
cout << "\tSua pontuação foi " << jus.pontos << endl;
jus.ranking();
first.join();
}else if(op == 3){
cout << "\tMaior pontuação: " << jus.ranking() << endl;
}
}
return 0;
}