Fix sound test button

This commit is contained in:
Jeff 2015-09-09 16:47:09 -04:00
parent d6398477ae
commit badbcf2753
3 changed files with 8 additions and 1 deletions

View file

@ -766,7 +766,7 @@ SoundSettingsPage::SoundSettingsPage()
connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked())); connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked()));
QPushButton *soundPathButton = new QPushButton("..."); QPushButton *soundPathButton = new QPushButton("...");
connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked())); connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked()));
connect(&soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(playerJoined())); connect(&soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(testSound()));
masterVolumeSlider = new QSlider(Qt::Horizontal); masterVolumeSlider = new QSlider(Qt::Horizontal);
masterVolumeSlider->setMinimum(0); masterVolumeSlider->setMinimum(0);

View file

@ -122,4 +122,9 @@ void SoundEngine::playSound(QString fileName)
audioData[fileName]->setPosition(0); audioData[fileName]->setPosition(0);
audioData[fileName]->play(); audioData[fileName]->play();
#endif #endif
}
void SoundEngine::testSound()
{
playSound("player_join");
} }

View file

@ -30,6 +30,8 @@ private slots:
public: public:
SoundEngine(QObject *parent = 0); SoundEngine(QObject *parent = 0);
void playSound(QString fileName); void playSound(QString fileName);
public slots:
void testSound();
}; };
extern SoundEngine *soundEngine; extern SoundEngine *soundEngine;