diff options
author | Max Horn | 2007-06-24 11:40:00 +0000 |
---|---|---|
committer | Max Horn | 2007-06-24 11:40:00 +0000 |
commit | 61af086e8e3131e7c32ad2ed3c12dc253f8b6191 (patch) | |
tree | 794b578dd3122cf20d0904faf8efbdede9bf2c9b /sound | |
parent | 71e696094ef08d48506b1cc61ec9921a748d1c5c (diff) | |
download | scummvm-rg350-61af086e8e3131e7c32ad2ed3c12dc253f8b6191.tar.gz scummvm-rg350-61af086e8e3131e7c32ad2ed3c12dc253f8b6191.tar.bz2 scummvm-rg350-61af086e8e3131e7c32ad2ed3c12dc253f8b6191.zip |
Mod code cleanup
svn-id: r27690
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mods/infogrames.h | 19 | ||||
-rw-r--r-- | sound/mods/paula.h | 6 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sound/mods/infogrames.h b/sound/mods/infogrames.h index 7220c2bf9a..bba43cbef2 100644 --- a/sound/mods/infogrames.h +++ b/sound/mods/infogrames.h @@ -80,14 +80,6 @@ public: 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 @@ public: 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; diff --git a/sound/mods/paula.h b/sound/mods/paula.h index 0e89b78db6..4bf0b8cec2 100644 --- a/sound/mods/paula.h +++ b/sound/mods/paula.h @@ -51,9 +51,9 @@ public: } 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); |