QTfrontend/pages.cpp
changeset 2191 20c62f787a4d
parent 2155 d897222d3339
child 2194 1597710c6118
--- a/QTfrontend/pages.cpp	Mon Jun 22 13:49:16 2009 +0000
+++ b/QTfrontend/pages.cpp	Wed Jun 24 15:59:32 2009 +0000
@@ -37,7 +37,6 @@
 #include <QTableWidget>
 #include <QAction>
 #include <QMenu>
-#include <QSound>
 #include <QDataWidgetMapper>
 
 
@@ -61,6 +60,7 @@
 #include "misc.h"
 #include "togglebutton.h"
 #include "hwform.h"
+#include "SDLs.h"
 
 PageMain::PageMain(QWidget* parent) : 
   AbstractPage(parent)
@@ -290,9 +290,14 @@
 	tmpdir.cd(datadir->absolutePath());
 	tmpdir.cd("Sounds/voices");
 	tmpdir.cd(CBVoicepack->currentText());
-	QStringList list = tmpdir.entryList(QStringList() << "*.wav", QDir::Files);
-	if (list.size())
-		QSound::play(tmpdir.absolutePath() + "/" + list[rand() % list.size()]);
+	QStringList list = tmpdir.entryList(QStringList() << "Illgetyou.ogg" << "Incoming.ogg" << "Stupid.ogg" << "Coward.ogg" << "Firstblood.ogg", QDir::Files);
+	if (list.size()) {
+	//	printf("%s\n", QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
+		int tmp =openal_loadfile(QString(tmpdir.absolutePath() + "/" + list[rand() % list.size()]).toLocal8Bit().constData());
+		openal_playsound(tmp);										   
+	}
+		
+		//QSound::play(tmpdir.absolutePath() + "/" + list[rand() % list.size()]);
 }
 
 PageMultiplayer::PageMultiplayer(QWidget* parent) :