diff options
Diffstat (limited to 'engines/testbed/sound.cpp')
-rw-r--r-- | engines/testbed/sound.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp index fac2437123..e256621553 100644 --- a/engines/testbed/sound.cpp +++ b/engines/testbed/sound.cpp @@ -50,15 +50,15 @@ SoundSubsystemDialog::SoundSubsystemDialog() : TestbedInteractionDialog(80, 60, _mixer = g_system->getMixer(); - // the three streams to be mixed + // the three streams to be mixed Audio::PCSpeaker *s1 = new Audio::PCSpeaker(); Audio::PCSpeaker *s2 = new Audio::PCSpeaker(); Audio::PCSpeaker *s3 = new Audio::PCSpeaker(); - + s1->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1); s2->play(Audio::PCSpeaker::kWaveFormSine, 1200, -1); s3->play(Audio::PCSpeaker::kWaveFormSine, 1400, -1); - + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_h1, s1); _mixer->pauseHandle(_h1, true); @@ -72,7 +72,7 @@ SoundSubsystemDialog::SoundSubsystemDialog() : TestbedInteractionDialog(80, 60, void SoundSubsystemDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) { - + switch (cmd) { case kPlayChannel1: _buttonArray[0]->setLabel("Pause Channel #1"); @@ -112,7 +112,7 @@ void SoundSubsystemDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, TestExitStatus SoundSubsystem::playBeeps() { Testsuite::clearScreen(); - TestExitStatus passed = kTestPassed; + TestExitStatus passed = kTestPassed; Common::String info = "Testing Sound Output by generating beeps\n" "You should hear a left beep followed by a right beep\n"; @@ -120,31 +120,31 @@ TestExitStatus SoundSubsystem::playBeeps() { Testsuite::logPrintf("Info! Skipping test : Play Beeps\n"); return kTestSkipped; } - + Audio::PCSpeaker *speaker = new Audio::PCSpeaker(); Audio::Mixer *mixer = g_system->getMixer(); Audio::SoundHandle handle; mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, speaker); - + // Left Beep Testsuite::writeOnScreen("Left Beep", Common::Point(0, 100)); mixer->setChannelBalance(handle, -127); speaker->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1); g_system->delayMillis(500); mixer->pauseHandle(handle, true); - + if (Testsuite::handleInteractiveInput(" Were you able to hear the left beep? ", "Yes", "No", kOptionRight)) { Testsuite::logDetailedPrintf("Error! Left Beep couldn't be detected : Error with Mixer::setChannelBalance()\n"); passed = kTestFailed; } - + // Right Beep Testsuite::writeOnScreen("Right Beep", Common::Point(0, 100)); mixer->setChannelBalance(handle, 127); mixer->pauseHandle(handle, false); g_system->delayMillis(500); mixer->stopAll(); - + if (Testsuite::handleInteractiveInput("Were you able to hear the right beep?", "Yes", "No", kOptionRight)) { Testsuite::logDetailedPrintf("Error! Right Beep couldn't be detected : Error with Mixer::setChannelBalance()\n"); passed = kTestFailed; @@ -154,7 +154,7 @@ TestExitStatus SoundSubsystem::playBeeps() { TestExitStatus SoundSubsystem::mixSounds() { Testsuite::clearScreen(); - TestExitStatus passed = kTestPassed; + TestExitStatus passed = kTestPassed; Common::String info = "Testing Mixer Output by generating multichannel sound output using PC speaker emulator.\n" "The mixer should be able to play them simultaneously\n"; @@ -174,7 +174,7 @@ TestExitStatus SoundSubsystem::mixSounds() { TestExitStatus SoundSubsystem::audiocdOutput() { Testsuite::clearScreen(); - TestExitStatus passed = kTestPassed; + TestExitStatus passed = kTestPassed; Common::String info = "Testing AudioCD API implementation.\n" "Here we have four tracks, we play them in order i.e 1-2-3-last.\n" "The user should verify if the tracks were run in correct order or not."; @@ -183,13 +183,13 @@ TestExitStatus SoundSubsystem::audiocdOutput() { Testsuite::logPrintf("Info! Skipping test : AudioCD API\n"); return kTestSkipped; } - + Common::Point pt(0, 100); Testsuite::writeOnScreen("Playing the tracks of testCD in order i.e 1-2-3-last", pt); - + // Play all tracks - for (int i = 1; i < 5; i++) { + for (int i = 1; i < 5; i++) { AudioCD.play(i, 1, 0, 0); while (AudioCD.isPlaying()) { g_system->delayMillis(500); @@ -203,12 +203,12 @@ TestExitStatus SoundSubsystem::audiocdOutput() { Testsuite::logPrintf("Error! Error in AudioCD.play() or probably sound files were not detected, try -d1 (debuglevel 1)\n"); passed = kTestFailed; } - + return passed; } TestExitStatus SoundSubsystem::sampleRates() { - + Common::String info = "Testing Multiple Sample Rates.\n" "Here we try to play sounds at three different sample rates."; @@ -216,7 +216,7 @@ TestExitStatus SoundSubsystem::sampleRates() { Testsuite::logPrintf("Info! Skipping test : Sample Rates\n"); return kTestSkipped; } - + TestExitStatus passed = kTestPassed; Audio::Mixer *mixer = g_system->getMixer(); @@ -225,14 +225,14 @@ TestExitStatus SoundSubsystem::sampleRates() { Audio::PCSpeaker *s2 = new Audio::PCSpeaker(s1->getRate() - 10000); // Stream at twice sampling rate Audio::PCSpeaker *s3 = new Audio::PCSpeaker(s1->getRate() + 10000); - + s1->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1); s2->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1); s3->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1); - + Audio::SoundHandle handle; Common::Point pt(0, 100); - + mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, s1); Testsuite::writeOnScreen(Common::String::printf("Playing at smaple rate: %d", s1->getRate()), pt); g_system->delayMillis(1000); @@ -250,7 +250,7 @@ TestExitStatus SoundSubsystem::sampleRates() { g_system->delayMillis(1000); mixer->stopHandle(handle); g_system->delayMillis(1000); - + Testsuite::clearScreen(); if (Testsuite::handleInteractiveInput("Was the mixer able to play beeps with variable sample rates?", "Yes", "No", kOptionRight)) { Testsuite::logDetailedPrintf("Error! Error with variable sample rates\n"); @@ -263,7 +263,7 @@ TestExitStatus SoundSubsystem::sampleRates() { SoundSubsystemTestSuite::SoundSubsystemTestSuite() { addTest("SimpleBeeps", &SoundSubsystem::playBeeps, true); addTest("MixSounds", &SoundSubsystem::mixSounds, true); - + // Make audio-files discoverable Common::FSNode gameRoot(ConfMan.get("path")); if (gameRoot.exists()) { |