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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jun 24 13:40:01 CEST 2007


Revision: 27690
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27690&view=rev
Author:   fingolfin
Date:     2007-06-24 04:40:00 -0700 (Sun, 24 Jun 2007)

Log Message:
-----------
Mod code cleanup

Modified Paths:
--------------
    scummvm/trunk/sound/mods/infogrames.h
    scummvm/trunk/sound/mods/paula.h

Modified: scummvm/trunk/sound/mods/infogrames.h
===================================================================
--- scummvm/trunk/sound/mods/infogrames.h	2007-06-24 11:03:09 UTC (rev 27689)
+++ scummvm/trunk/sound/mods/infogrames.h	2007-06-24 11:40:00 UTC (rev 27690)
@@ -80,14 +80,6 @@
 	Instruments *getInstruments(void) const { return _instruments; }
 	bool getRepeating(void) const { return _repCount != 0; }
 	void setRepeating (int32 repCount) { _repCount = repCount; }
-	virtual void startPlay(void) { _playing = true;}
-	virtual void stopPlay(void)
-	{
-		_mutex.lock();
-		_playing = false;
-		_mutex.unlock();
-	}
-	virtual void pausePlay(bool pause) { _playing = !pause; }
 
 	bool load(Common::SeekableReadStream &dum);
 	bool load(const char *dum) {
@@ -98,7 +90,16 @@
 		return false;
 	}
 	void unload(void);
-	void restart(void) { if (_data) { stopPlay(); init(); startPlay(); } }
+	void restart(void) {
+		if (_data) {
+			// Use the mutex here to ensure we do not call init()
+			// while data is being read by the mixer thread.
+			_mutex.lock();
+			init();
+			_playing = true;
+			_mutex.unlock();
+		}
+	}
 
 protected:
 	Instruments *_instruments;

Modified: scummvm/trunk/sound/mods/paula.h
===================================================================
--- scummvm/trunk/sound/mods/paula.h	2007-06-24 11:03:09 UTC (rev 27689)
+++ scummvm/trunk/sound/mods/paula.h	2007-06-24 11:40:00 UTC (rev 27690)
@@ -51,9 +51,9 @@
 	}
 	void clearVoice(byte voice);
 	void clearVoices() { for (int i = 0; i < NUM_VOICES; ++i) clearVoice(i); }
-	virtual void startPlay(void) {}
-	virtual void stopPlay(void) {}
-	virtual void pausePlay(bool pause) {}
+	void startPlay(void) { _playing = true; }
+	void stopPlay(void) { _playing = false; }
+	void pausePlay(bool pause) { _playing = !pause; }
 
 // AudioStream API
 	int readBuffer(int16 *buffer, const int numSamples);


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