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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed May 6 00:18:27 CEST 2009


Revision: 40338
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40338&view=rev
Author:   lordhoto
Date:     2009-05-05 22:18:26 +0000 (Tue, 05 May 2009)

Log Message:
-----------
Cleanup:
- Rename OPL_DOSBox to OPL, since it's inside a seperate namespace anyway
- Reanme MAME_OPL to OPL, since it's inside a seperate namespace anyway

Modified Paths:
--------------
    scummvm/trunk/sound/fmopl.cpp
    scummvm/trunk/sound/softsynth/opl/dosbox.cpp
    scummvm/trunk/sound/softsynth/opl/dosbox.h
    scummvm/trunk/sound/softsynth/opl/mame.cpp
    scummvm/trunk/sound/softsynth/opl/mame.h

Modified: scummvm/trunk/sound/fmopl.cpp
===================================================================
--- scummvm/trunk/sound/fmopl.cpp	2009-05-05 22:14:34 UTC (rev 40337)
+++ scummvm/trunk/sound/fmopl.cpp	2009-05-05 22:18:26 UTC (rev 40338)
@@ -42,9 +42,9 @@
 	if (type != kOpl2)
 		return 0;
 	else
-		return new MAME::OPL_MAME();
+		return new MAME::OPL();
 #else
-	return new DOSBox::OPL_DOSBox(type);
+	return new DOSBox::OPL(type);
 #endif
 }
 

Modified: scummvm/trunk/sound/softsynth/opl/dosbox.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/opl/dosbox.cpp	2009-05-05 22:14:34 UTC (rev 40337)
+++ scummvm/trunk/sound/softsynth/opl/dosbox.cpp	2009-05-05 22:18:26 UTC (rev 40338)
@@ -189,19 +189,19 @@
 };
 } // end of namespace OPL3
 
-OPL_DOSBox::OPL_DOSBox(kOplType type) : _type(type), _rate(0), _handler(0) {
+OPL::OPL(kOplType type) : _type(type), _rate(0), _handler(0) {
 }
 
-OPL_DOSBox::~OPL_DOSBox() {
+OPL::~OPL() {
 	free();
 }
 
-void OPL_DOSBox::free() {
+void OPL::free() {
 	delete _handler;
 	_handler = 0;
 }
 
-bool OPL_DOSBox::init(int rate) {
+bool OPL::init(int rate) {
 	free();
 
 	memset(&_reg, 0, sizeof(_reg));
@@ -226,11 +226,11 @@
 	return true;
 }
 
-void OPL_DOSBox::reset() {
+void OPL::reset() {
 	init(_rate);	
 }
 
-void OPL_DOSBox::write(int port, int val) {
+void OPL::write(int port, int val) {
 	if (port&1) {
 		switch (_type) {
 		case kOpl2:
@@ -274,7 +274,7 @@
 	}
 }
 
-byte OPL_DOSBox::read(int port) {
+byte OPL::read(int port) {
 	switch (_type) {
 	case kOpl2:
 		if (!(port & 1))
@@ -295,7 +295,7 @@
 	return 0;
 }
 
-void OPL_DOSBox::writeReg(int r, int v) {
+void OPL::writeReg(int r, int v) {
 	byte tempReg = 0;
 	switch (_type) {
 	case kOpl2:
@@ -316,7 +316,7 @@
 	};
 }
 
-void OPL_DOSBox::dualWrite(uint8 index, uint8 reg, uint8 val) {
+void OPL::dualWrite(uint8 index, uint8 reg, uint8 val) {
 	// Make sure you don't use opl3 features
 	// Don't allow write to disable opl3		
 	if (reg == 5)
@@ -340,7 +340,7 @@
 	_handler->writeReg(fullReg, val);
 }
 
-void OPL_DOSBox::readBuffer(int16 *buffer, int length) {
+void OPL::readBuffer(int16 *buffer, int length) {
 	// For stereo OPL cards, we divide the sample count by 2,
 	// to match stereo AudioStream behavior.
 	if (_type != kOpl2)

Modified: scummvm/trunk/sound/softsynth/opl/dosbox.h
===================================================================
--- scummvm/trunk/sound/softsynth/opl/dosbox.h	2009-05-05 22:14:34 UTC (rev 40337)
+++ scummvm/trunk/sound/softsynth/opl/dosbox.h	2009-05-05 22:18:26 UTC (rev 40338)
@@ -83,7 +83,7 @@
 	virtual void init(uint rate) = 0;
 };
 
-class OPL_DOSBox : public OPL {
+class OPL : public ::OPL::OPL {
 private:
 	kOplType _type;
 	uint _rate;
@@ -98,8 +98,8 @@
 	void free();
 	void dualWrite(uint8 index, uint8 reg, uint8 val);
 public:
-	OPL_DOSBox(kOplType type);
-	~OPL_DOSBox();
+	OPL(kOplType type);
+	~OPL();
 
 	bool init(int rate);
 	void reset();

Modified: scummvm/trunk/sound/softsynth/opl/mame.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/opl/mame.cpp	2009-05-05 22:14:34 UTC (rev 40337)
+++ scummvm/trunk/sound/softsynth/opl/mame.cpp	2009-05-05 22:18:26 UTC (rev 40338)
@@ -40,12 +40,12 @@
 namespace OPL {
 namespace MAME {
 
-OPL_MAME::~OPL_MAME() {
+OPL::~OPL() {
 	MAME::OPLDestroy(_opl);
 	_opl = 0;
 }
 
-bool OPL_MAME::init(int rate) {
+bool OPL::init(int rate) {
 	if (_opl)
 		MAME::OPLDestroy(_opl);
 
@@ -53,23 +53,23 @@
 	return (_opl != 0);
 }
 
-void OPL_MAME::reset() {
+void OPL::reset() {
 	MAME::OPLResetChip(_opl);
 }
 
-void OPL_MAME::write(int a, int v) {
+void OPL::write(int a, int v) {
 	MAME::OPLWrite(_opl, a, v);
 }
 
-byte OPL_MAME::read(int a) {
+byte OPL::read(int a) {
 	return MAME::OPLRead(_opl, a);
 }
 
-void OPL_MAME::writeReg(int r, int v) {
+void OPL::writeReg(int r, int v) {
 	MAME::OPLWriteReg(_opl, r, v);
 }
 
-void OPL_MAME::readBuffer(int16 *buffer, int length) {
+void OPL::readBuffer(int16 *buffer, int length) {
 	MAME::YM3812UpdateOne(_opl, buffer, length);
 }
 

Modified: scummvm/trunk/sound/softsynth/opl/mame.h
===================================================================
--- scummvm/trunk/sound/softsynth/opl/mame.h	2009-05-05 22:14:34 UTC (rev 40337)
+++ scummvm/trunk/sound/softsynth/opl/mame.h	2009-05-05 22:18:26 UTC (rev 40338)
@@ -176,12 +176,12 @@
 FM_OPL *makeAdlibOPL(int rate);
 
 // OPL API implementation
-class OPL_MAME : public OPL {
+class OPL : public ::OPL::OPL {
 private:
 	FM_OPL *_opl;
 public:
-	OPL_MAME() : _opl(0) {}
-	~OPL_MAME();
+	OPL() : _opl(0) {}
+	~OPL();
 
 	bool init(int rate);
 	void reset();


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