Sono stati inseriti dei suoni wav quando si cliccano i bottoni
TODO:linkare i wave in file qrc
PS: Sotto Windows copiare la cartella dei suoni in Release/debug
altrimenti viene eseguito il suono di sistema
13 files changed:
public slots:
void changeColor();
public slots:
void changeColor();
+ bool getStateColor(){return col;}
protected:
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
protected:
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QDebug>
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
+ if(ui->pushButton->getStateColor())
+ QSound::play("sounds/dog.wav");
ui->pushButton->changeColor();
break;
case 1:
ui->pushButton->changeColor();
break;
case 1:
+ if(ui->pushButton_2->getStateColor())
+ QSound::play("sounds/cat.wav");
ui->pushButton_2->changeColor();
break;
case 2:
ui->pushButton_2->changeColor();
break;
case 2:
+ if(ui->pushButton_3->getStateColor())
+ QSound::play("sounds/cow.wav");
ui->pushButton_3->changeColor();
break;
case 3:
ui->pushButton_3->changeColor();
break;
case 3:
+ if(ui->pushButton_4->getStateColor())
+ QSound::play("sounds/duck.wav");
ui->pushButton_4->changeColor();
break;
case 4:
ui->pushButton_4->changeColor();
break;
case 4:
+ if(ui->pushButton_5->getStateColor())
+ QSound::play("sounds/goat.wav");
ui->pushButton_5->changeColor();
break;
case 5:
ui->pushButton_5->changeColor();
break;
case 5:
+ if(ui->pushButton_6->getStateColor())
+ QSound::play("sounds/donkey.wav");
ui->pushButton_6->changeColor();
break;
case 6:
ui->pushButton_6->changeColor();
break;
case 6:
+ if(ui->pushButton_7->getStateColor())
+ QSound::play("sounds/crow.wav");
ui->pushButton_7->changeColor();
break;
case 7:
ui->pushButton_7->changeColor();
break;
case 7:
+ if(ui->pushButton_8->getStateColor())
+ QSound::play("sounds/rosteer.wav");
ui->pushButton_8->changeColor();
break;
case 8:
ui->pushButton_8->changeColor();
break;
case 8:
+ if(ui->pushButton_9->getStateColor())
+ QSound::play("sounds/bleeeh.wav");
ui->pushButton_9->changeColor();
break;
}
ui->pushButton_9->changeColor();
break;
}
delete ui;
}
void MainWindow::clickA(){
delete ui;
}
void MainWindow::clickA(){
+ QSound::play("sounds/dog.wav");
emit cliccatoIlBottone(0);
}
void MainWindow::clickB(){
emit cliccatoIlBottone(0);
}
void MainWindow::clickB(){
+ QSound::play("sounds/cat.wav");
emit cliccatoIlBottone(1);
}
void MainWindow::clickC(){
emit cliccatoIlBottone(1);
}
void MainWindow::clickC(){
+ QSound::play("sounds/cow.wav");
emit cliccatoIlBottone(2);
}
void MainWindow::clickD(){
emit cliccatoIlBottone(2);
}
void MainWindow::clickD(){
+ QSound::play("sounds/duck.wav");
emit cliccatoIlBottone(3);
}
void MainWindow::clickE(){
emit cliccatoIlBottone(3);
}
void MainWindow::clickE(){
+ QSound::play("sounds/goat.wav");
emit cliccatoIlBottone(4);
}
void MainWindow::clickF(){
emit cliccatoIlBottone(4);
}
void MainWindow::clickF(){
+ QSound::play("sounds/donkey.wav");
emit cliccatoIlBottone(5);
}
void MainWindow::clickG(){
emit cliccatoIlBottone(5);
}
void MainWindow::clickG(){
+ QSound::play("sounds/crow.wav");
emit cliccatoIlBottone(6);
}
void MainWindow::clickH(){
emit cliccatoIlBottone(6);
}
void MainWindow::clickH(){
+ QSound::play("sounds/rosteer.wav");
emit cliccatoIlBottone(7);
}
void MainWindow::clickI(){
emit cliccatoIlBottone(7);
}
void MainWindow::clickI(){
+ QSound::play("sounds/bleeeh.wav");
emit cliccatoIlBottone(8);
}
emit cliccatoIlBottone(8);
}
}
void TestThread::run(){
}
void TestThread::run(){
while(true){
qsrand(QDateTime::currentDateTime().toTime_t());
while(true){
qsrand(QDateTime::currentDateTime().toTime_t());
{
emit generate(sequenza.at(i));
qDebug()<<sequenza.at(i);
{
emit generate(sequenza.at(i));
qDebug()<<sequenza.at(i);
- msleep(500 - (_score*5));
+ msleep(500 - (_score*2));
emit generate(sequenza.at(i));
emit generate(sequenza.at(i));
- msleep(500 - (_score*5));
+ msleep(500 - (_score*2));
_score++;
emit score(_score);
if(index==sequenza.size()){
_score++;
emit score(_score);
if(index==sequenza.size()){
attendiInputUtente=false;
index=0;
}
attendiInputUtente=false;
index=0;
}
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
-** Created: Sat 27. Feb 10:40:53 2010
+** Created: Sat 27. Feb 14:00:09 2010
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!