[Scummvm-cvs-logs] SF.net SVN: scummvm:[51333] scummvm/branches/gsoc2010-testbed/engines/ testbed

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Mon Jul 26 22:59:51 CEST 2010


Revision: 51333
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51333&view=rev
Author:   sud03r
Date:     2010-07-26 20:59:50 +0000 (Mon, 26 Jul 2010)

Log Message:
-----------
TESTBED: implemented some sample beeps using PCSpeaker emulator for testing sound subsystem

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
    scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
    scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp

Added Paths:
-----------
    scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-07-26 19:25:56 UTC (rev 51332)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-07-26 20:59:50 UTC (rev 51333)
@@ -8,6 +8,7 @@
 	graphics.o \
 	misc.o \
 	savegame.o \
+	sound.o \
 	testbed.o \
 	testsuite.o
 

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp	2010-07-26 20:59:50 UTC (rev 51333)
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "sound/mixer.h"
+#include "testbed/sound.h"
+#include "sound/softsynth/pcspk.h"
+
+namespace Testbed {
+
+bool SoundSubsystem::playPCSpkSound() {
+	Audio::PCSpeaker *speaker = new Audio::PCSpeaker();
+	Audio::Mixer *mixer = g_system->getMixer();
+	Audio::SoundHandle handle;
+	mixer->playStream(Audio::Mixer::kPlainSoundType, &handle, speaker);
+	speaker->play(Audio::PCSpeaker::kWaveFormSine, 1000, -1);
+	g_system->delayMillis(1000);
+	mixer->setChannelBalance(handle, -127);
+	g_system->delayMillis(1000);
+	mixer->setChannelBalance(handle, 127);
+	g_system->delayMillis(1000);
+	mixer->stopAll();
+	return true;
+}
+
+SoundSubsystemTestSuite::SoundSubsystemTestSuite() {
+	addTest("PCSpkrSound", &SoundSubsystem::playPCSpkSound, true);
+}
+
+}	// End of namespace Testbed


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h	2010-07-26 20:59:50 UTC (rev 51333)
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef TESTBED_SOUND_H
+#define TESTBED_SOUND_H
+
+#include "testbed/testsuite.h"
+
+namespace Testbed {
+
+namespace SoundSubsystem {
+
+// Helper functions for SoundSubsystem tests
+
+// will contain function declarations for SoundSubsystem tests
+bool playPCSpkSound();
+}
+
+class SoundSubsystemTestSuite : public Testsuite {
+public:
+	/**
+	 * The constructor for the SoundSubsystemTestSuite
+	 * For every test to be executed one must:
+	 * 1) Create a function that would invoke the test
+	 * 2) Add that test to list by executing addTest()
+	 *
+	 * @see addTest()
+	 */
+	SoundSubsystemTestSuite();
+	~SoundSubsystemTestSuite() {}
+	
+	const char *getName() const {
+		return "SoundSubsystem";
+	}
+	
+	const char *getDescription() const {
+		return "Sound Subsystem";
+	}
+
+};
+
+} // End of namespace Testbed
+
+#endif // TESTBED_SOUND_H


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/sound.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/template.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/template.h	2010-07-26 19:25:56 UTC (rev 51332)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/template.h	2010-07-26 20:59:50 UTC (rev 51333)
@@ -52,7 +52,13 @@
 	 */
 	XXXTestSuite();
 	~XXXTestSuite() {}
-	const char *getName() const;
+	const char *getName() const {
+		return "Dummy Template";
+	}
+	
+	const char *getDescription() const {
+		return "Some Arbit description";
+	}
 
 };
 

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-07-26 19:25:56 UTC (rev 51332)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/testbed.cpp	2010-07-26 20:59:50 UTC (rev 51333)
@@ -34,6 +34,7 @@
 #include "testbed/graphics.h"
 #include "testbed/misc.h"
 #include "testbed/savegame.h"
+#include "testbed/sound.h"
 #include "testbed/testbed.h"
 
 namespace Testbed {
@@ -72,6 +73,9 @@
 	// Events
 	ts = new EventTestSuite();
 	_testsuiteList.push_back(ts);
+	// Sound
+	ts = new SoundSubsystemTestSuite();
+	_testsuiteList.push_back(ts);
 }
 
 TestbedEngine::~TestbedEngine() {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list