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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Oct 21 14:44:52 CEST 2006


Revision: 24407
          http://svn.sourceforge.net/scummvm/?rev=24407&view=rev
Author:   fingolfin
Date:     2006-10-21 05:44:10 -0700 (Sat, 21 Oct 2006)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/music.cpp
    scummvm/trunk/engines/saga/puzzle.cpp
    scummvm/trunk/engines/scumm/dialogs.cpp
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.h
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
    scummvm/trunk/engines/scumm/player_mod.cpp
    scummvm/trunk/engines/scumm/player_mod.h
    scummvm/trunk/engines/scumm/player_nes.cpp
    scummvm/trunk/engines/scumm/player_nes.h
    scummvm/trunk/engines/scumm/player_v1.cpp
    scummvm/trunk/engines/scumm/player_v1.h
    scummvm/trunk/engines/scumm/player_v2.cpp
    scummvm/trunk/engines/scumm/player_v2.h
    scummvm/trunk/engines/scumm/player_v2a.cpp
    scummvm/trunk/engines/scumm/player_v2a.h
    scummvm/trunk/engines/scumm/player_v3a.cpp
    scummvm/trunk/engines/scumm/player_v3a.h
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/sound.cpp
    scummvm/trunk/engines/scumm/sound.h
    scummvm/trunk/engines/sword2/controls.cpp
    scummvm/trunk/sound/audiocd.cpp
    scummvm/trunk/sound/audiocd.h
    scummvm/trunk/sound/mididrv.cpp
    scummvm/trunk/sound/mixer.h
    scummvm/trunk/sound/mpu401.cpp
    scummvm/trunk/sound/softsynth/mt32.cpp

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/saga/interface.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -546,8 +546,8 @@
 void Interface::textInputStartRepeat(uint16 ascii) {
 	if (!_textInputRepeatPhase) {
 		_textInputRepeatPhase = 1;
-		Common::g_timer->removeTimerProc(&textInputRepeatCallback);
-		Common::g_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY1, this);
+		_vm->_timer->removeTimerProc(&textInputRepeatCallback);
+		_vm->_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY1, this);
 	}
 
 	_textInputRepeatChar = ascii;
@@ -556,8 +556,8 @@
 void Interface::textInputRepeat() {
 	if (_textInputRepeatPhase == 1) {
 		_textInputRepeatPhase = 2;
-		Common::g_timer->removeTimerProc(&textInputRepeatCallback);
-		Common::g_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY2, this);
+		_vm->_timer->removeTimerProc(&textInputRepeatCallback);
+		_vm->_timer->installTimerProc(&textInputRepeatCallback, KEYBOARD_REPEAT_DELAY2, this);
 	} else if (_textInputRepeatPhase == 2) {
 		processAscii(_textInputRepeatChar, true);
 	}
@@ -565,7 +565,7 @@
 
 void Interface::processKeyUp(uint16 ascii) {
 	if (_textInputRepeatPhase) {
-		Common::g_timer->removeTimerProc(&textInputRepeatCallback);
+		_vm->_timer->removeTimerProc(&textInputRepeatCallback);
 		_textInputRepeatPhase = 0;
 	}
 }

Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/saga/music.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -346,7 +346,7 @@
 	_player->setVolume(volume);
 
 	if (_currentVolumePercent == 100) {
-		Common::g_timer->removeTimerProc(&musicVolumeGaugeCallback);
+		_vm->_timer->removeTimerProc(&musicVolumeGaugeCallback);
 		_currentVolume = _targetVolume;
 	}
 }
@@ -361,12 +361,12 @@
 	if (time == 1) {
 		_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume);
 		_player->setVolume(volume);
-		Common::g_timer->removeTimerProc(&musicVolumeGaugeCallback);
+		_vm->_timer->removeTimerProc(&musicVolumeGaugeCallback);
 		_currentVolume = volume;
 		return;
 	}
 
-	Common::g_timer->installTimerProc(&musicVolumeGaugeCallback, time * 100L, this);
+	_vm->_timer->installTimerProc(&musicVolumeGaugeCallback, time * 100L, this);
 }
 
 bool Music::isPlaying() {

Modified: scummvm/trunk/engines/saga/puzzle.cpp
===================================================================
--- scummvm/trunk/engines/saga/puzzle.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/saga/puzzle.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -119,7 +119,7 @@
 
 void Puzzle::execute(void) {
 	_active = true;
-	Common::g_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+	_vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
 
 	initPieces();
 
@@ -134,7 +134,7 @@
 void Puzzle::exitPuzzle(void) {
 	_active = false;
 
-	Common::g_timer->removeTimerProc(&hintTimerCallback);
+	_vm->_timer->removeTimerProc(&hintTimerCallback);
 
 	_vm->_scene->changeScene(ITE_SCENE_LODGE, 0, kTransitionNoFade);
 	_vm->_interface->setMode(kPanelMain);
@@ -383,17 +383,17 @@
 
 	_vm->_actor->setSpeechColor(1, kITEColorBlack);
 
-	Common::g_timer->removeTimerProc(&hintTimerCallback);
+	_vm->_timer->removeTimerProc(&hintTimerCallback);
 
 	switch (_hintRqState) {
 	case kRQSpeaking:
 		if (_vm->_actor->isSpeaking()) {
-			Common::g_timer->installTimerProc(&hintTimerCallback, 50000, this);
+			_vm->_timer->installTimerProc(&hintTimerCallback, 50000, this);
 			break;
 		}
 
 		_hintRqState = _hintNextRqState;
-		Common::g_timer->installTimerProc(&hintTimerCallback, 333333, this);
+		_vm->_timer->installTimerProc(&hintTimerCallback, 333333, this);
 		break;
 
 	case kRQNoHint:
@@ -416,11 +416,11 @@
 		//	Roll to see if Sakka scolds
 		if (_vm->_rnd.getRandomNumber(1)) {
 			_hintRqState = kRQSakkaDenies;
-			Common::g_timer->installTimerProc(&hintTimerCallback, 200000, this);
+			_vm->_timer->installTimerProc(&hintTimerCallback, 200000, this);
 		} else {
 			_hintRqState = kRQSpeaking;
 			_hintNextRqState = kRQHintRequested;
-			Common::g_timer->installTimerProc(&hintTimerCallback, 50000, this);
+			_vm->_timer->installTimerProc(&hintTimerCallback, 50000, this);
 		}
 
 		break;
@@ -433,7 +433,7 @@
 
 		_hintRqState = kRQSpeaking;
 		_hintNextRqState = kRQHintRequestedStage2;
-		Common::g_timer->installTimerProc(&hintTimerCallback, 50000, this);
+		_vm->_timer->installTimerProc(&hintTimerCallback, 50000, this);
 
 		_vm->_interface->converseClear();
 		_vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 1, 0, 0 );
@@ -460,7 +460,7 @@
 		_vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0);
 		_vm->_interface->converseDisplayText();
 
-		Common::g_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+		_vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
 
 		_hintRqState = kRQSkipEverything;
 		break;
@@ -483,8 +483,8 @@
 	case 2:		// Decline the hint
 		_vm->_actor->abortSpeech();
 		_hintRqState = kRQNoHint;
-		Common::g_timer->removeTimerProc(&hintTimerCallback);
-		Common::g_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this);
+		_vm->_timer->removeTimerProc(&hintTimerCallback);
+		_vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this);
 		clearHint();
 		break;
 	}
@@ -546,8 +546,8 @@
 	_vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0);
 	_vm->_interface->converseDisplayText();
 
-	Common::g_timer->removeTimerProc(&hintTimerCallback);
-	Common::g_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+	_vm->_timer->removeTimerProc(&hintTimerCallback);
+	_vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
 }
 
 void Puzzle::clearHint(void) {

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -326,7 +326,7 @@
 		int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y");
 		int hPad = g_gui.evaluator()->getVar("scummsaveload_thumbnail.hPad");
 		int vPad = g_gui.evaluator()->getVar("scummsaveload_thumbnail.vPad");
-		int thumbH = ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1);
+		int thumbH = ((g_system->getHeight() % 200 && g_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1);
 
 		_container->resize(thumbX - hPad, thumbY - vPad, kThumbnailWidth + hPad * 2, thumbH + vPad * 2 + kLineHeight * 4);
 	

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -46,9 +46,9 @@
 
 namespace Scumm {
 
-SoundHE::SoundHE(ScummEngine *parent)
+SoundHE::SoundHE(ScummEngine *parent, Audio::Mixer *mixer)
 	:
-	Sound(parent),
+	Sound(parent, mixer),
 	_vm((ScummEngine_v60he *)parent),
 	_overrideFreq(0),
 	_heMusic(0),
@@ -114,7 +114,7 @@
 int SoundHE::isSoundRunning(int sound) const {
 	if (_vm->_game.heversion >= 70) {
 		if (sound >= 10000) {
-			return _vm->_mixer->getSoundID(_heSoundChannels[sound - 10000]);
+			return _mixer->getSoundID(_heSoundChannels[sound - 10000]);
 		}
 	} else if (_vm->_game.heversion >= 60) {
 		if (sound == -2) {
@@ -124,7 +124,7 @@
 		}
 	}
 
-	if (_vm->_mixer->isSoundIDActive(sound))
+	if (_mixer->isSoundIDActive(sound))
 		return sound;
 
 	if (isSoundInQueue(sound))
@@ -189,7 +189,7 @@
 		_vm->_talkDelay = 0;
 	}
 
-	_vm->_mixer->stopHandle(_heSoundChannels[chan]);
+	_mixer->stopHandle(_heSoundChannels[chan]);
 
 	_heChannel[chan].sound = 0;
 	_heChannel[chan].priority = 0;
@@ -219,7 +219,7 @@
 
 	if (min < 8) {
 		for (chan = min; chan < ARRAYSIZE(_heChannel); chan++) {
-			if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[chan]) == 0)
+			if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) == 0)
 				return chan;
 		}
 	} else {
@@ -236,7 +236,7 @@
 			chan = i;
 	}
 
-	if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
+	if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
 		return _heChannel[chan].sbngBlock;
 	} else {
 		return 0;
@@ -250,7 +250,7 @@
 			chan = i;
 	}
 
-	if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
+	if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
 		int time =  _vm->getHETimer(chan + 4) * 11025 / 1000;
 		return time;
 	} else {
@@ -271,7 +271,7 @@
 			chan = i;
 	}
 
-	if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
+	if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
 		debug(5, "getSoundVar: sound %d var %d result %d", sound, var, _heChannel[chan].soundVars[var]);
 		return _heChannel[chan].soundVars[var];
 	} else {
@@ -528,14 +528,14 @@
 
 		musicFile.seek(music_offs, SEEK_SET);
 
-		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
+		_mixer->stopHandle(_heSoundChannels[heChannel]);
 		spoolPtr = _vm->_res->createResource(rtSpoolBuffer, heChannel, size);
 		assert(spoolPtr);
 		musicFile.read(spoolPtr, size);
 		musicFile.close();
 
 		if (_vm->_game.heversion == 70) {
-			_vm->_mixer->playRaw(&_heSoundChannels[heChannel], spoolPtr, size, 11025, flags, soundID, 255, 0, 0,0, type);
+			_mixer->playRaw(&_heSoundChannels[heChannel], spoolPtr, size, 11025, flags, soundID, 255, 0, 0,0, type);
 			return;
 		}
 	}
@@ -585,8 +585,8 @@
 			flags |= Audio::Mixer::FLAG_LOOP;
 		}
 
-		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
-		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID, 255, 0, 0,0, type);
+		_mixer->stopHandle(_heSoundChannels[heChannel]);
+		_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID, 255, 0, 0,0, type);
 	}
 	// Support for sound in Humongous Entertainment games
 	else if (READ_BE_UINT32(ptr) == MKID_BE('DIGI') || READ_BE_UINT32(ptr) == MKID_BE('TALK')) {
@@ -598,7 +598,7 @@
 		// Skip DIGI/TALK (8) and HSHD (24) blocks
 		ptr += 32;
 
-		if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) {
+		if (_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) {
 			int curSnd = _heChannel[heChannel].sound;
 			if (curSnd == 1 && soundID != 1)
 				return;
@@ -641,8 +641,8 @@
 			_heChannel[heChannel].timer = size * 1000 / rate;
 		}
 
-		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
-		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID, 255, 0, 0,0, type);
+		_mixer->stopHandle(_heSoundChannels[heChannel]);
+		_mixer->playRaw(&_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID, 255, 0, 0,0, type);
 
 	}
 	// Support for PCM music in 3DO versions of Humongous Entertainment games
@@ -658,9 +658,9 @@
 
 		flags = Audio::Mixer::FLAG_AUTOFREE;
 
-		_vm->_mixer->stopID(_currentMusic);
+		_mixer->stopID(_currentMusic);
 		_currentMusic = soundID;
-		_vm->_mixer->playRaw(NULL, ptr + 8, size, rate, flags, soundID, 255, 0, 0,0, Audio::Mixer::kMusicSoundType);
+		_mixer->playRaw(NULL, ptr + 8, size, rate, flags, soundID, 255, 0, 0,0, Audio::Mixer::kMusicSoundType);
 	}
 	else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) {
 		if (_vm->_imuse) {

Modified: scummvm/trunk/engines/scumm/he/sound_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/he/sound_he.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -56,7 +56,7 @@
 	} _heChannel[8];
 
 public:
-	SoundHE(ScummEngine *parent);
+	SoundHE(ScummEngine *parent, Audio::Mixer *mixer);
 	~SoundHE();
 	
 	virtual void addSoundToQueue(int sound, int heOffset = 0, int heChannel = 0, int heFlags = 0);

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -44,8 +44,8 @@
 	imuseDigital->callback();
 }
 
-IMuseDigital::IMuseDigital(ScummEngine_v7 *scumm, int fps)
-	: _vm(scumm) {
+IMuseDigital::IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps)
+	: _vm(scumm), _mixer(mixer) {
 	_pause = false;
 	_sound = new ImuseDigiSndMgr(_vm);
 	assert(_sound);
@@ -200,7 +200,7 @@
 			if (track->volGroupId == 3)
 				type = Audio::Mixer::kMusicSoundType;
 
-			_vm->_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false);
+			_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false);
 		}
 	}
 }
@@ -318,9 +318,9 @@
 					if (result > mixer_size)
 						result = mixer_size;
 
-					if (_vm->_mixer->isReady()) {
-						_vm->_mixer->setChannelVolume(track->handle, vol);
-						_vm->_mixer->setChannelBalance(track->handle, pan);
+					if (_mixer->isReady()) {
+						_mixer->setChannelVolume(track->handle, vol);
+						_mixer->setChannelBalance(track->handle, pan);
 						track->stream->append(data, result);
 						track->regionOffset += result;
 					}
@@ -335,13 +335,13 @@
 					assert(mixer_size >= 0);
 				} while (mixer_size != 0);
 			} else if (track->stream2) {
-				if (_vm->_mixer->isReady()) {
+				if (_mixer->isReady()) {
 					if (!track->started) {
 						track->started = true;
-						_vm->_mixer->playInputStream(type, &track->handle, track->stream2, -1, vol, pan, false);
+						_mixer->playInputStream(type, &track->handle, track->stream2, -1, vol, pan, false);
 					} else {
-						_vm->_mixer->setChannelVolume(track->handle, vol);
-						_vm->_mixer->setChannelBalance(track->handle, pan);
+						_mixer->setChannelVolume(track->handle, vol);
+						_mixer->setChannelBalance(track->handle, pan);
 					}
 				}
 			}

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -90,6 +90,7 @@
 
 	Common::Mutex _mutex;
 	ScummEngine_v7 *_vm;
+	Audio::Mixer *_mixer;
 	ImuseDigiSndMgr *_sound;
 
 	char *_audioNames;
@@ -131,7 +132,7 @@
 	void playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence);
 
 public:
-	IMuseDigital(ScummEngine_v7 *scumm, int fps);
+	IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps);
 	virtual ~IMuseDigital();
 
 	void setAudioNames(int32 num, char *names);

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -172,9 +172,9 @@
 	 				track->stream->finish();
 	 			}
 				if (track->stream->endOfStream()
-						|| _vm->_mixer->isPaused() // hack for paused Mixer
+						|| _mixer->isPaused() // hack for paused Mixer
 						|| _vm->_insaneRunning) { // INSANE hack for sync timer mode
-					_vm->_mixer->stopHandle(track->handle);
+					_mixer->stopHandle(track->handle);
 					delete track->stream;
 					track->stream = NULL;
 					_sound->closeSound(track->soundHandle);
@@ -182,7 +182,7 @@
 					track->used = false;
 				}
 			} else if (track->stream2) {
-				_vm->_mixer->stopHandle(track->handle);
+				_mixer->stopHandle(track->handle);
 				delete track->stream2;
 				track->stream2 = NULL;
 				track->used = false;
@@ -285,7 +285,7 @@
 	for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) {
 		Track *track = _track[l];
 		if (track->soundId == sound) {
-			if ((track->stream2 && _vm->_mixer->isSoundHandleActive(track->handle)) ||
+			if ((track->stream2 && _mixer->isSoundHandleActive(track->handle)) ||
 				(track->stream && track->used && !track->readyToRemove)) {
 					return 1;
 			}

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -179,7 +179,7 @@
 		int32 streamBufferSize = track->iteration;
 		track->stream2 = NULL;
 		track->stream = Audio::makeAppendableAudioStream(freq, track->mixerFlags, streamBufferSize);
-		_vm->_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false);
+		_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false);
 		track->started = true;
 	}
 
@@ -358,7 +358,7 @@
 	// setup 1 second stream wrapped buffer
 	int32 streamBufferSize = fadeTrack->iteration;
 	fadeTrack->stream = Audio::makeAppendableAudioStream(_sound->getFreq(fadeTrack->soundHandle), fadeTrack->mixerFlags, streamBufferSize);
-	_vm->_mixer->playInputStream(type, &fadeTrack->handle, fadeTrack->stream, -1, fadeTrack->vol / 1000, fadeTrack->pan, false);
+	_mixer->playInputStream(type, &fadeTrack->handle, fadeTrack->stream, -1, fadeTrack->vol / 1000, fadeTrack->pan, false);
 	fadeTrack->started = true;
 	fadeTrack->used = true;
 

Modified: scummvm/trunk/engines/scumm/player_mod.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_mod.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_mod.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -28,9 +28,9 @@
 
 namespace Scumm {
 
-Player_MOD::Player_MOD(ScummEngine *scumm) {
+Player_MOD::Player_MOD(Audio::Mixer *mixer) {
 	int i;
-	_mixer = scumm->_mixer;
+	_mixer = mixer;
 	_samplerate = _mixer->getOutputRate();
 	_mixamt = 0;
 	_mixpos = 0;

Modified: scummvm/trunk/engines/scumm/player_mod.h
===================================================================
--- scummvm/trunk/engines/scumm/player_mod.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_mod.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -38,7 +38,7 @@
  */
 class Player_MOD : public Audio::AudioStream {
 public:
-	Player_MOD(ScummEngine *scumm);
+	Player_MOD(Audio::Mixer *mixer);
 	virtual ~Player_MOD();
 	virtual void setMusicVolume(int vol);
 

Modified: scummvm/trunk/engines/scumm/player_nes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_nes.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_nes.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -605,10 +605,10 @@
 
 }
 
-Player_NES::Player_NES(ScummEngine *scumm) {
+Player_NES::Player_NES(ScummEngine *scumm, Audio::Mixer *mixer) {
 	int i;
 	_vm = scumm;
-	_mixer = scumm->_mixer;
+	_mixer = mixer;
 	APUe::APU.SampleRate = _sample_rate = _mixer->getOutputRate();
 
 	_samples_per_frame = _sample_rate / 60;

Modified: scummvm/trunk/engines/scumm/player_nes.h
===================================================================
--- scummvm/trunk/engines/scumm/player_nes.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_nes.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -45,7 +45,7 @@
  */
 class Player_NES : public Audio::AudioStream, public MusicEngine {
 public:
-	Player_NES(ScummEngine *scumm);
+	Player_NES(ScummEngine *scumm, Audio::Mixer *mixer);
 	virtual ~Player_NES();
 
 	virtual void setMusicVolume(int vol);

Modified: scummvm/trunk/engines/scumm/player_v1.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v1.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v1.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -34,7 +34,8 @@
 #define TIMER_BASE_FREQ 1193000
 #define FIXP_SHIFT  16
 
-Player_V1::Player_V1(ScummEngine *scumm, bool pcjr) : Player_V2(scumm, pcjr) {
+Player_V1::Player_V1(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr)
+	: Player_V2(scumm, mixer, pcjr) {
 	// Initialize channel code
 	for (int i = 0; i < 4; ++i)
 		clear_channel(i);

Modified: scummvm/trunk/engines/scumm/player_v1.h
===================================================================
--- scummvm/trunk/engines/scumm/player_v1.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v1.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -33,7 +33,7 @@
  */
 class Player_V1 : public Player_V2 {
 public:
-	Player_V1(ScummEngine *scumm, bool pcjr);
+	Player_V1(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr);
 	~Player_V1();
 
 	virtual void startSound(int sound);

Modified: scummvm/trunk/engines/scumm/player_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v2.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v2.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -342,12 +342,12 @@
 #endif
 
 
-Player_V2::Player_V2(ScummEngine *scumm, bool pcjr) {
+Player_V2::Player_V2(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr) {
 	int i;
 
 	_isV3Game = (scumm->_game.version >= 3);
 	_vm = scumm;
-	_mixer = scumm->_mixer;
+	_mixer = mixer;
 	_sample_rate = _mixer->getOutputRate();
 
 	_header_len = (scumm->_game.features & GF_OLD_BUNDLE) ? 4 : 6;

Modified: scummvm/trunk/engines/scumm/player_v2.h
===================================================================
--- scummvm/trunk/engines/scumm/player_v2.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v2.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -74,7 +74,7 @@
  */
 class Player_V2 : public Audio::AudioStream, public MusicEngine {
 public:
-	Player_V2(ScummEngine *scumm, bool pcjr);
+	Player_V2(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr);
 	virtual ~Player_V2();
 
 	virtual void setMusicVolume(int vol);

Modified: scummvm/trunk/engines/scumm/player_v2a.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v2a.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v2a.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -1303,7 +1303,7 @@
 	return NULL;
 }
 
-Player_V2A::Player_V2A(ScummEngine *scumm) {
+Player_V2A::Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer) {
 	int i;
 	_vm = scumm;
 
@@ -1317,7 +1317,7 @@
 		_slot[i].sound = NULL;
 	}
 
-	_mod = new Player_MOD(scumm);
+	_mod = new Player_MOD(mixer);
 	_mod->setUpdateProc(update_proc, this, 60);
 }
 

Modified: scummvm/trunk/engines/scumm/player_v2a.h
===================================================================
--- scummvm/trunk/engines/scumm/player_v2a.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v2a.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -40,7 +40,7 @@
  */
 class Player_V2A : public MusicEngine {
 public:
-	Player_V2A(ScummEngine *scumm);
+	Player_V2A(ScummEngine *scumm, Audio::Mixer *mixer);
 	virtual ~Player_V2A();
 
 	virtual void setMusicVolume(int vol);

Modified: scummvm/trunk/engines/scumm/player_v3a.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v3a.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v3a.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -35,7 +35,7 @@
 	{0x00D6, 0x00CA, 0x00BE, 0x00B4, 0x00A9, 0x00A0, 0x0097, 0x008E, 0x0086, 0x007F, 0x00F0, 0x00E2}
 };
 
-Player_V3A::Player_V3A(ScummEngine *scumm) {
+Player_V3A::Player_V3A(ScummEngine *scumm, Audio::Mixer *mixer) {
 	int i;
 	_vm = scumm;
 	for (i = 0; i < V3A_MAXMUS; i++) {
@@ -56,7 +56,7 @@
 
 	_isinit = false;
 
-	_mod = new Player_MOD(scumm);
+	_mod = new Player_MOD(mixer);
 	_mod->setUpdateProc(update_proc, this, 60);
 }
 

Modified: scummvm/trunk/engines/scumm/player_v3a.h
===================================================================
--- scummvm/trunk/engines/scumm/player_v3a.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/player_v3a.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -39,7 +39,7 @@
  */
 class Player_V3A : public MusicEngine {
 public:
-	Player_V3A(ScummEngine *scumm);
+	Player_V3A(ScummEngine *scumm, Audio::Mixer *mixer);
 	virtual ~Player_V3A();
 
 	virtual void setMusicVolume(int vol);

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -1009,9 +1009,9 @@
 
 	// Create the sound manager
 	if (_game.heversion > 0)
-		_sound = new SoundHE(this);
+		_sound = new SoundHE(this, _mixer);
 	else
-		_sound = new Sound(this);
+		_sound = new Sound(this, _mixer);
 
 	// Setup the music engine
 	setupMusic(_game.midi);
@@ -1096,16 +1096,14 @@
 void ScummEngine_v7::setupScumm() {
 
 	if (_game.features & GF_DIGI_IMUSE) {
-#ifndef DISABLE_SCUMM_7_8
-		_musicEngine = _imuseDigital = new IMuseDigital(this, 10);
-#endif
+		_musicEngine = _imuseDigital = new IMuseDigital(this, _mixer, 10);
 	}
 
 	ScummEngine::setupScumm();
 
 	// Create FT INSANE object
 	if (_game.id == GID_FT)
-		_insane = new Insane((ScummEngine_v7 *)this);
+		_insane = new Insane(this);
 	else
 		_insane = 0;
 
@@ -1457,19 +1455,19 @@
 		// TODO
 		_musicEngine = NULL;
 	} else if (_game.platform == Common::kPlatformNES) {
-		_musicEngine = new Player_NES(this);
+		_musicEngine = new Player_NES(this, _mixer);
 	} else if ((_game.platform == Common::kPlatformAmiga) && (_game.version == 2)) {
-		_musicEngine = new Player_V2A(this);
+		_musicEngine = new Player_V2A(this, _mixer);
 	} else if ((_game.platform == Common::kPlatformAmiga) && (_game.version == 3)) {
-		_musicEngine = new Player_V3A(this);
+		_musicEngine = new Player_V3A(this, _mixer);
 	} else if ((_game.platform == Common::kPlatformAmiga) && (_game.version <= 4)) {
 		_musicEngine = NULL;
 	} else if (_game.id == GID_MANIAC && (_game.version == 1)) {
-		_musicEngine = new Player_V1(this, midiDriver != MD_PCSPK);
+		_musicEngine = new Player_V1(this, _mixer, midiDriver != MD_PCSPK);
 	} else if (_game.version <= 2) {
-		_musicEngine = new Player_V2(this, midiDriver != MD_PCSPK);
+		_musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK);
 	} else if ((_musicType == MDT_PCSPK) && ((_game.version > 2) && (_game.version <= 4))) {
-		_musicEngine = new Player_V2(this, midiDriver != MD_PCSPK);
+		_musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK);
 	} else if (_game.version >= 3 && _game.heversion <= 61 && _game.platform != Common::kPlatform3DO) {
 		MidiDriver *nativeMidiDriver = 0;
 		MidiDriver *adlibMidiDriver = 0;

Modified: scummvm/trunk/engines/scumm/sound.cpp
===================================================================
--- scummvm/trunk/engines/scumm/sound.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/sound.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -56,9 +56,10 @@
 };
 
 
-Sound::Sound(ScummEngine *parent)
+Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
 	:
 	_vm(parent),
+	_mixer(mixer),
 	_soundQuePos(0),
 	_soundQue2Pos(0),
 	_sfxFile(0),
@@ -187,7 +188,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr, size);
-		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
 	// WORKAROUND bug # 1311447
 	else if (READ_BE_UINT32(ptr) == 0x460e200d) {
@@ -209,7 +210,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr, size);
-		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
 	// Support for sampled sound effects in Monkey Island 1 and 2
 	else if (READ_BE_UINT32(ptr) == MKID_BE('SBL ')) {
@@ -280,7 +281,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr + 6, size);
-		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
 	else if ((_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 3) || READ_BE_UINT32(ptr) == MKID_BE('SOUN') || READ_BE_UINT32(ptr) == MKID_BE('TOWS')) {
 
@@ -333,7 +334,7 @@
 				if (loopEnd > 0)
 					flags |= Audio::Mixer::FLAG_LOOP;
 
-				_vm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
+				_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
 			}
 			break;
 		case 1:
@@ -394,7 +395,7 @@
 		sound = (char *)malloc(size);
 		int vol = ptr[24] * 4;
 		memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size);
-		_vm->_mixer->playRaw(NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0);
+		_mixer->playRaw(NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0);
 	}
 	else {
 
@@ -458,7 +459,7 @@
 		} else if (_vm->_game.heversion >= 60) {
 			finished = !isSoundRunning(1);
 		} else {
-			finished = !_vm->_mixer->isSoundHandleActive(_talkChannelHandle);
+			finished = !_mixer->isSoundHandleActive(_talkChannelHandle);
 		}
 
 		if ((uint) act < 0x80 && ((_vm->_game.version == 8) || (_vm->_game.version <= 7 && !_vm->_string[0].no_talk_anim))) {
@@ -556,7 +557,7 @@
 
 		if (mode == 1 && (_vm->_game.id == GID_TENTACLE || _vm->_game.id == GID_SAMNMAX)) {
 			id = 777777 + _talk_sound_channel;
-			_vm->_mixer->stopID(id);
+			_mixer->stopID(id);
 		}
 
 		if (b > 8) {
@@ -598,7 +599,7 @@
 		_mouthSyncMode = true;
 	}
 
-	if (!_soundsPaused && _vm->_mixer->isReady()) {
+	if (!_soundsPaused && _mixer->isReady()) {
 		Audio::AudioStream *input = NULL;
 
 		switch (_soundMode) {
@@ -636,7 +637,7 @@
 			_vm->_imuseDigital->startVoice(kTalkSoundID, input);
 #endif
 		} else {
-			_vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, input, id);
+			_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, input, id);
 		}
 	}
 }
@@ -650,7 +651,7 @@
 		} else if (_vm->_game.heversion >= 60) {
 			stopSound(1);
 		} else {
-			_vm->_mixer->stopHandle(_talkChannelHandle);
+			_mixer->stopHandle(_talkChannelHandle);
 		}
 		_sfxMode &= ~2;
 	}
@@ -682,7 +683,7 @@
 	if (sound == _currentCDSound)
 		return pollCD();
 
-	if (_vm->_mixer->isSoundIDActive(sound))
+	if (_mixer->isSoundIDActive(sound))
 		return 1;
 
 	if (isSoundInQueue(sound))
@@ -727,7 +728,7 @@
 	if (_vm->_imuse)
 		return _vm->_imuse->get_sound_active(sound);
 
-	if (_vm->_mixer->isSoundIDActive(sound))
+	if (_mixer->isSoundIDActive(sound))
 		return 1;
 
 	return false;
@@ -765,7 +766,7 @@
 	}
 
 	if (!(_vm->_game.features & GF_DIGI_IMUSE))
-		_vm->_mixer->stopID(sound);
+		_mixer->stopID(sound);
 
 	if (_vm->_musicEngine)
 		_vm->_musicEngine->stopSound(sound);
@@ -797,7 +798,7 @@
 
 	// Stop all SFX
 	if (!_vm->_imuseDigital) {
-		_vm->_mixer->stopAll();
+		_mixer->stopAll();
 	}
 }
 
@@ -874,7 +875,7 @@
 	}
 #endif
 
-	_vm->_mixer->pauseAll(pause);
+	_mixer->pauseAll(pause);
 
 	if ((_vm->_game.features & GF_AUDIOTRACKS) && _vm->VAR(_vm->VAR_MUSIC_TIMER) > 0) {
 		if (pause)
@@ -983,7 +984,7 @@
 }
 
 bool Sound::isSfxFinished() const {
-	return !_vm->_mixer->hasActiveChannelOfType(Audio::Mixer::kSFXSoundType);
+	return !_mixer->hasActiveChannelOfType(Audio::Mixer::kSFXSoundType);
 }
 
 // We use a real timer in an attempt to get better sync with CD tracks. This is

Modified: scummvm/trunk/engines/scumm/sound.h
===================================================================
--- scummvm/trunk/engines/scumm/sound.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/scumm/sound.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -27,6 +27,10 @@
 #include "sound/mixer.h"
 #include "scumm/saveload.h"
 
+namespace Audio {
+class Mixer;
+}
+
 namespace Scumm {
 
 class ScummEngine;
@@ -52,6 +56,7 @@
 
 protected:
 	ScummEngine *_vm;
+	Audio::Mixer *_mixer;
 
 	int16 _soundQuePos, _soundQue[0x100];
 	int16 _soundQue2Pos;
@@ -85,7 +90,7 @@
 	byte _sfxMode;
 
 public:
-	Sound(ScummEngine *parent);
+	Sound(ScummEngine *parent, Audio::Mixer *mixer);
 	virtual ~Sound();
 	virtual void addSoundToQueue(int sound, int heOffset = 0, int heChannel = 0, int heFlags = 0);
 	virtual void addSoundToQueue2(int sound, int heOffset = 0, int heChannel = 0, int heFlags = 0);

Modified: scummvm/trunk/engines/sword2/controls.cpp
===================================================================
--- scummvm/trunk/engines/sword2/controls.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/engines/sword2/controls.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -1003,7 +1003,7 @@
 	if (widget == _musicSwitch) {
 		_vm->_sound->muteMusic(result != 0);
 	} else if (widget == _musicSlider) {
-		_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, result);
+		_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, result);
 		_vm->_sound->muteMusic(result == 0);
 		_musicSwitch->setValue(result != 0);
 	} else if (widget == _speechSlider) {

Modified: scummvm/trunk/sound/audiocd.cpp
===================================================================
--- scummvm/trunk/sound/audiocd.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/audiocd.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -68,6 +68,8 @@
 	memset(_cachedTracks, 0, sizeof(_cachedTracks));
 	memset(_trackInfo, 0, sizeof(_trackInfo));
 	_currentCache = 0;
+	_mixer = g_system->getMixer();
+	assert(_mixer);
 }
 
 void AudioCDManager::play(int track, int numLoops, int startFrame, int duration) {
@@ -83,9 +85,9 @@
 		_cd.duration = duration;
 
 		if (index >= 0) {
-			g_engine->_mixer->stopHandle(_cd.handle);
+			_mixer->stopHandle(_cd.handle);
 			_cd.playing = true;
-			_trackInfo[index]->play(g_engine->_mixer, &_cd.handle, _cd.start, _cd.duration);
+			_trackInfo[index]->play(_mixer, &_cd.handle, _cd.start, _cd.duration);
 		} else {
 			g_system->playCD(track, numLoops, startFrame, duration);
 			_cd.playing = false;
@@ -95,7 +97,7 @@
 
 void AudioCDManager::stop() {
 	if (_cd.playing) {
-		g_engine->_mixer->stopHandle(_cd.handle);
+		_mixer->stopHandle(_cd.handle);
 		_cd.playing = false;
 	} else {
 		g_system->stopCD();
@@ -109,16 +111,16 @@
 void AudioCDManager::updateCD() {
 	if (_cd.playing) {
 		// If the sound handle is 0, then playback stopped.
-		if (!g_engine->_mixer->isSoundHandleActive(_cd.handle)) {
+		if (!_mixer->isSoundHandleActive(_cd.handle)) {
 			// If playback just stopped, check if the current track is supposed
 			// to be repeated, and if that's the case, play it again. Else, stop
 			// the CD explicitly.
 			if (_cd.numLoops == -1 || --_cd.numLoops > 0) {
 				int index = getCachedTrack(_cd.track);
 				assert(index >= 0);
-				_trackInfo[index]->play(g_engine->_mixer, &_cd.handle, _cd.start, _cd.duration);
+				_trackInfo[index]->play(_mixer, &_cd.handle, _cd.start, _cd.duration);
 			} else {
-				g_engine->_mixer->stopHandle(_cd.handle);
+				_mixer->stopHandle(_cd.handle);
 				_cd.playing = false;
 			}
 		}

Modified: scummvm/trunk/sound/audiocd.h
===================================================================
--- scummvm/trunk/sound/audiocd.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/audiocd.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -31,9 +31,10 @@
 
 namespace Audio {
 
+
 class DigitalTrackInfo {
 public:
-	virtual void play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int startFrame, int duration) = 0;
+	virtual void play(Mixer *mixer, SoundHandle *handle, int startFrame, int duration) = 0;
 	virtual ~DigitalTrackInfo() { }
 };
 
@@ -65,7 +66,7 @@
 private:
 	/* used for emulated CD music */
 	struct ExtStatus : Status {
-		Audio::SoundHandle handle;
+		SoundHandle handle;
 	};
 	ExtStatus _cd;
 
@@ -81,6 +82,7 @@
 	DigitalTrackInfo *_trackInfo[CACHE_TRACKS];
 	int _currentCache;
 
+	Mixer	*_mixer;
 };
 
 /** Shortcut for accessing the audio CD manager. */

Modified: scummvm/trunk/sound/mididrv.cpp
===================================================================
--- scummvm/trunk/sound/mididrv.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/mididrv.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -26,6 +26,7 @@
 #include "engines/engine.h"
 #include "common/config-manager.h"
 #include "common/str.h"
+#include "common/system.h"
 #include "common/util.h"
 #include "sound/mididrv.h"
 
@@ -211,9 +212,9 @@
 	switch (midiDriver) {
 	case MD_NULL:      return MidiDriver_NULL_create();
 
-	case MD_ADLIB:     return MidiDriver_ADLIB_create(g_engine->_mixer);
+	case MD_ADLIB:     return MidiDriver_ADLIB_create(g_system->getMixer());
 
-	case MD_TOWNS:     return MidiDriver_YM2612_create(g_engine->_mixer);
+	case MD_TOWNS:     return MidiDriver_YM2612_create(g_system->getMixer());
 
 	// Right now PC Speaker and PCjr are handled
 	// outside the MidiDriver architecture, so
@@ -222,11 +223,11 @@
 	case MD_PCJR:      return NULL;
 
 #ifdef USE_FLUIDSYNTH
-	case MD_FLUIDSYNTH:	return MidiDriver_FluidSynth_create(g_engine->_mixer);
+	case MD_FLUIDSYNTH:	return MidiDriver_FluidSynth_create(g_system->getMixer());
 #endif
 
 #ifdef USE_MT32EMU
-	case MD_MT32:      return MidiDriver_MT32_create(g_engine->_mixer);
+	case MD_MT32:      return MidiDriver_MT32_create(g_system->getMixer());
 #endif
 
 #if defined(PALMOS_MODE)

Modified: scummvm/trunk/sound/mixer.h
===================================================================
--- scummvm/trunk/sound/mixer.h	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/mixer.h	2006-10-21 12:44:10 UTC (rev 24407)
@@ -39,8 +39,8 @@
 class Mixer;
 
 class SoundHandle {
-	friend class Audio::Channel;
-	friend class Audio::Mixer;
+	friend class Channel;
+	friend class Mixer;
 	uint32 _val;
 public:
 	inline SoundHandle() : _val(0xFFFFFFFF) {}

Modified: scummvm/trunk/sound/mpu401.cpp
===================================================================
--- scummvm/trunk/sound/mpu401.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/mpu401.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -21,6 +21,7 @@
 
 #include "common/stdafx.h"
 #include "sound/mpu401.h"
+#include "common/system.h"
 #include "common/timer.h"
 #include "common/util.h"	// for ARRAYSIZE
 
@@ -100,7 +101,7 @@
 
 void MidiDriver_MPU401::close() {
 	if (_timer_proc)
-		Common::g_timer->removeTimerProc(_timer_proc);
+		g_system->getTimerManager()->removeTimerProc(_timer_proc);
 	_timer_proc = 0;
 	for (int i = 0; i < 16; ++i)
 		send(0x7B << 8 | 0xB0 | i);
@@ -134,9 +135,9 @@
 void MidiDriver_MPU401::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) {
 	if (!_timer_proc || !timer_proc) {
 		if (_timer_proc)
-			Common::g_timer->removeTimerProc(_timer_proc);
+			g_system->getTimerManager()->removeTimerProc(_timer_proc);
 		_timer_proc = timer_proc;
 		if (timer_proc)
-			Common::g_timer->installTimerProc(timer_proc, 10000, timer_param);
+			g_system->getTimerManager()->installTimerProc(timer_proc, 10000, timer_param);
 	}
 }

Modified: scummvm/trunk/sound/softsynth/mt32.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32.cpp	2006-10-21 12:22:30 UTC (rev 24406)
+++ scummvm/trunk/sound/softsynth/mt32.cpp	2006-10-21 12:44:10 UTC (rev 24407)
@@ -75,7 +75,7 @@
 	int getRate() const { return _outputRate; }
 };
 
-class MT32File: public MT32Emu::File {
+class MT32File : public MT32Emu::File {
 	Common::File file;
 public:
 	bool open(const char *filename, OpenMode mode) {


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