For people's consideration. Restore the .11 behaviour of not initialising sound if music is turned off. Reason. I still get 100% CPU useage in frontend due to sucky sound daemon setups *cough*pulseaudio*cough* so this offers an easy workaround for people (turn off music). Disadvantage, this removes Smaxx' code to disable sound-related buttons on failure to init sound.
authornemo
Sun, 02 Aug 2009 17:37:45 +0000
changeset 2294 2e6ffb3ef304
parent 2293 f8d488636828
child 2295 2fff3e4ce52f
For people's consideration. Restore the .11 behaviour of not initialising sound if music is turned off. Reason. I still get 100% CPU useage in frontend due to sucky sound daemon setups *cough*pulseaudio*cough* so this offers an easy workaround for people (turn off music). Disadvantage, this removes Smaxx' code to disable sound-related buttons on failure to init sound.
QTfrontend/SDLs.cpp
QTfrontend/pages.cpp
--- a/QTfrontend/SDLs.cpp	Sat Aug 01 14:03:25 2009 +0000
+++ b/QTfrontend/SDLs.cpp	Sun Aug 02 17:37:45 2009 +0000
@@ -26,7 +26,6 @@
 	music = -1;
 
 	SDL_Init(SDL_INIT_VIDEO);
-	openal_init(5);
 
 }
 
@@ -60,6 +59,7 @@
 void SDLInteraction::StartMusic()
 {
 	if (music < 0) {
+	    openal_init(5);
 		music = openal_loadfile(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData());
 		openal_toggleloop(music);
 	}
--- a/QTfrontend/pages.cpp	Sat Aug 01 14:03:25 2009 +0000
+++ b/QTfrontend/pages.cpp	Sun Aug 02 17:37:45 2009 +0000
@@ -195,7 +195,7 @@
 		}
 		hbox->addWidget(CBVoicepack, 100);
 		BtnTestSound = addButton(":/res/PlaySound.png", hbox, 1, true);
-		BtnTestSound->setEnabled(openal_ready());
+		//BtnTestSound->setEnabled(openal_ready());
 		hbox->setStretchFactor(BtnTestSound, 1);
 		connect(BtnTestSound, SIGNAL(clicked()), this, SLOT(testSound()));
 		GBTLayout->addLayout(hbox);
@@ -427,12 +427,12 @@
 
 		CBEnableSound = new QCheckBox(AGGroupBox);
 		CBEnableSound->setText(QCheckBox::tr("Enable sound"));
-		CBEnableSound->setEnabled(openal_ready());
+		//CBEnableSound->setEnabled(openal_ready());
 		GBAlayout->addWidget(CBEnableSound);
 
 		CBEnableMusic = new QCheckBox(AGGroupBox);
 		CBEnableMusic->setText(QCheckBox::tr("Enable music"));
-		CBEnableMusic->setEnabled(openal_ready());
+		//CBEnableMusic->setEnabled(openal_ready());
 		GBAlayout->addWidget(CBEnableMusic);
 
 		QHBoxLayout * GBAvollayout = new QHBoxLayout(0);