Suggestion from Tiy. Use a random hi. Could maybe be shorter sounds, using the 4 shortest voicepacks already
authornemo
Tue, 09 Feb 2010 14:24:25 +0000
changeset 2779 e1ae0019d43f
parent 2778 d106ea17b3f9
child 2780 11e5e6335b17
Suggestion from Tiy. Use a random hi. Could maybe be shorter sounds, using the 4 shortest voicepacks already
QTfrontend/chatwidget.cpp
QTfrontend/chatwidget.h
--- a/QTfrontend/chatwidget.cpp	Tue Feb 09 14:21:25 2010 +0000
+++ b/QTfrontend/chatwidget.cpp	Tue Feb 09 14:24:25 2010 +0000
@@ -41,9 +41,12 @@
        QDir tmpdir;
 
        tmpdir.cd(datadir->absolutePath());
-       tmpdir.cd("Sounds/");
+       tmpdir.cd("Sounds/voices");
        sdli->SDLMusicInit();
-       sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/switchhog.ogg").toLocal8Bit().constData());
+       sound[0] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Classic/Hello.ogg").toLocal8Bit().constData());
+       sound[1] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Default/Hello.ogg").toLocal8Bit().constData());
+       sound[2] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Mobster/Hello.ogg").toLocal8Bit().constData());
+       sound[3] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Russian/Hello.ogg").toLocal8Bit().constData());
     }
 
 	mainLayout.setSpacing(1);
@@ -133,7 +136,7 @@
 	chatNicks->addItem(item);
 
     if(notifyNick && notify && gameSettings->value("audio/frontendsound", true).toBool()) {
-       Mix_PlayChannel(-1, sound, 0);
+       Mix_PlayChannel(-1, sound[rand()%4], 0);
     }
 }
 
--- a/QTfrontend/chatwidget.h	Tue Feb 09 14:21:25 2010 +0000
+++ b/QTfrontend/chatwidget.h	Tue Feb 09 14:24:25 2010 +0000
@@ -67,7 +67,7 @@
   QAction * acFollow;
   QSettings * gameSettings;
   SDLInteraction * sdli;
-  Mix_Chunk *sound;
+  Mix_Chunk *sound[4];
   bool notify;
 
  private slots: