[Scummvm-cvs-logs] SF.net SVN: scummvm:[50145] scummvm/trunk

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Tue Jun 22 17:30:42 CEST 2010


Revision: 50145
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50145&view=rev
Author:   athrxx
Date:     2010-06-22 15:30:41 +0000 (Tue, 22 Jun 2010)

Log Message:
-----------
GUI/LAUNCHER: This should fix the regression concerning pc speaker / pcjr support caused by patch #1956501

Modified Paths:
--------------
    scummvm/trunk/base/plugins.cpp
    scummvm/trunk/po/POTFILES
    scummvm/trunk/sound/mididrv.cpp
    scummvm/trunk/sound/null.cpp
    scummvm/trunk/sound/softsynth/pcspk.cpp

Added Paths:
-----------
    scummvm/trunk/sound/null.h

Modified: scummvm/trunk/base/plugins.cpp
===================================================================
--- scummvm/trunk/base/plugins.cpp	2010-06-22 15:18:55 UTC (rev 50144)
+++ scummvm/trunk/base/plugins.cpp	2010-06-22 15:30:41 UTC (rev 50145)
@@ -205,6 +205,8 @@
 		LINK_PLUGIN(MT32)
 		#endif
 		LINK_PLUGIN(ADLIB)
+		LINK_PLUGIN(PCSPK)
+		LINK_PLUGIN(PCJR)
 		LINK_PLUGIN(TOWNS)
 		#if defined (UNIX)
 		LINK_PLUGIN(TIMIDITY)

Modified: scummvm/trunk/po/POTFILES
===================================================================
--- scummvm/trunk/po/POTFILES	2010-06-22 15:18:55 UTC (rev 50144)
+++ scummvm/trunk/po/POTFILES	2010-06-22 15:30:41 UTC (rev 50145)
@@ -22,6 +22,7 @@
 engines/mohawk/dialogs.cpp
 
 sound/musicplugin.cpp
+sound/null.h
 sound/null.cpp
 sound/softsynth/mt32.cpp
 sound/softsynth/adlib.cpp

Modified: scummvm/trunk/sound/mididrv.cpp
===================================================================
--- scummvm/trunk/sound/mididrv.cpp	2010-06-22 15:18:55 UTC (rev 50144)
+++ scummvm/trunk/sound/mididrv.cpp	2010-06-22 15:30:41 UTC (rev 50145)
@@ -131,11 +131,15 @@
 	// given flags.
 	switch (getMusicType(hdl)) {
 	case MT_PCSPK:
-	case MT_PCJR:
 		if (flags & MDT_PCSPK)
 			return hdl;
 		break;
 
+	case MT_PCJR:		
+		if (flags & MDT_PCJR)
+			return hdl;
+		break;
+
 	case MT_ADLIB:
 		if (flags & MDT_ADLIB)
 			return hdl;

Modified: scummvm/trunk/sound/null.cpp
===================================================================
--- scummvm/trunk/sound/null.cpp	2010-06-22 15:18:55 UTC (rev 50144)
+++ scummvm/trunk/sound/null.cpp	2010-06-22 15:30:41 UTC (rev 50145)
@@ -22,34 +22,8 @@
  * $Id$
  */
 
-#include "sound/musicplugin.h"
-#include "sound/mpu401.h"
-#include "common/translation.h"
+#include "sound/null.h"
 
-/* NULL driver */
-class MidiDriver_NULL : public MidiDriver_MPU401 {
-public:
-	int open() { return 0; }
-	void send(uint32 b) { }
-};
-
-
-// Plugin interface
-
-class NullMusicPlugin : public MusicPluginObject {
-public:
-	virtual const char *getName() const {
-		return _s("No music");
-	}
-
-	virtual const char *getId() const {
-		return "null";
-	}
-
-	virtual MusicDevices getDevices() const;
-	virtual Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
-};
-
 Common::Error NullMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
 	*mididriver = new MidiDriver_NULL();
 

Added: scummvm/trunk/sound/null.h
===================================================================
--- scummvm/trunk/sound/null.h	                        (rev 0)
+++ scummvm/trunk/sound/null.h	2010-06-22 15:30:41 UTC (rev 50145)
@@ -0,0 +1,56 @@
+/* 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 SOUND_NULL_H
+#define SOUND_NULL_H
+
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
+#include "common/translation.h"
+
+/* NULL driver */
+class MidiDriver_NULL : public MidiDriver_MPU401 {
+public:
+	int open() { return 0; }
+	void send(uint32 b) { }
+};
+
+
+// Plugin interface
+
+class NullMusicPlugin : public MusicPluginObject {
+public:
+	virtual const char *getName() const {
+		return _s("No music");
+	}
+
+	virtual const char *getId() const {
+		return "null";
+	}
+
+	virtual MusicDevices getDevices() const;
+	Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
+};
+
+#endif
\ No newline at end of file


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

Modified: scummvm/trunk/sound/softsynth/pcspk.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/pcspk.cpp	2010-06-22 15:18:55 UTC (rev 50144)
+++ scummvm/trunk/sound/softsynth/pcspk.cpp	2010-06-22 15:30:41 UTC (rev 50145)
@@ -24,6 +24,7 @@
 */
 
 #include "sound/softsynth/pcspk.h"
+#include "sound/null.h"
 
 namespace Audio {
 
@@ -128,3 +129,59 @@
 }
 
 } // End of namespace Audio
+
+
+//	Plugin interface
+//	(This can only create a null driver since pc speaker support is not part of the
+//	midi driver architecture. But we need the plugin for the options menu in the launcher
+//	and for MidiDriver::detectDevice() which is more or less used by all engines.)
+
+class PCSpeakerMusicPlugin : public NullMusicPlugin {
+public:
+	const char *getName() const {
+		return _s("PC Speaker Emulator");
+	}
+
+	const char *getId() const {
+		return "pcspk";
+	}
+
+	MusicDevices getDevices() const;
+};
+
+MusicDevices PCSpeakerMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, _s(""), MT_PCSPK));
+	return devices;
+}
+
+class PCjrMusicPlugin : public NullMusicPlugin {
+public:
+	const char *getName() const {
+		return _s("IBM PCjr Emulator");
+	}
+
+	const char *getId() const {
+		return "pcjr";
+	}
+
+	MusicDevices getDevices() const;
+};
+
+MusicDevices PCjrMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, _s(""), MT_PCJR));
+	return devices;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(PCSPK)
+	//REGISTER_PLUGIN_DYNAMIC(PCSPK, PLUGIN_TYPE_MUSIC, PCSpeakerMusicPlugin);
+//#else
+	REGISTER_PLUGIN_STATIC(PCSPK, PLUGIN_TYPE_MUSIC, PCSpeakerMusicPlugin);
+//#endif
+
+//#if PLUGIN_ENABLED_DYNAMIC(PCJR)
+	//REGISTER_PLUGIN_DYNAMIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin);
+//#else
+	REGISTER_PLUGIN_STATIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin);
+//#endif
\ No newline at end of file


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