[Scummvm-cvs-logs] SF.net SVN: scummvm: [24680] scummvm/trunk/engines/scumm/imuse

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Nov 12 03:24:35 CET 2006


Revision: 24680
          http://svn.sourceforge.net/scummvm/?rev=24680&view=rev
Author:   eriktorbjorn
Date:     2006-11-11 18:24:25 -0800 (Sat, 11 Nov 2006)

Log Message:
-----------
Whitespace

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse/imuse.cpp
    scummvm/trunk/engines/scumm/imuse/imuse_internal.h
    scummvm/trunk/engines/scumm/imuse/imuse_player.cpp
    scummvm/trunk/engines/scumm/imuse/instrument.cpp
    scummvm/trunk/engines/scumm/imuse/instrument.h
    scummvm/trunk/engines/scumm/imuse/sysex.h
    scummvm/trunk/engines/scumm/imuse/sysex_samnmax.cpp
    scummvm/trunk/engines/scumm/imuse/sysex_scumm.cpp

Modified: scummvm/trunk/engines/scumm/imuse/imuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse.cpp	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/imuse.cpp	2006-11-12 02:24:25 UTC (rev 24680)
@@ -149,7 +149,7 @@
 	if (ptr[8] == 'S' && ptr[9] == 'O')
 		return false;
 
-	error("Unknown music type: '%c%c%c%c'", (char)tag>>24, (char)tag>>16, (char)tag>>8, (char)tag);
+	error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag);
 
 	return false;
 }
@@ -191,7 +191,7 @@
 	if (ptr[8] == 'S' && ptr[9] == 'O')
 		return true;
 
-	error("Unknown music type: '%c%c%c%c'", (char)tag>>24, (char)tag>>16, (char)tag>>8, (char)tag);
+	error("Unknown music type: '%c%c%c%c'", (char)tag >> 24, (char)tag >> 16, (char)tag >> 8, (char)tag);
 
 	return false;
 }
@@ -387,12 +387,12 @@
 
 bool IMuseInternal::get_sound_active(int sound) const {
 	Common::StackLock lock(_mutex, "IMuseInternal::get_sound_active()");
-	return getSoundStatus_internal (sound, false) != 0;
+	return getSoundStatus_internal(sound, false) != 0;
 }
 
 int32 IMuseInternal::doCommand(int numargs, int a[]) {
 	Common::StackLock lock(_mutex, "IMuseInternal::doCommand()");
-	return doCommand_internal (numargs, a);
+	return doCommand_internal(numargs, a);
 }
 
 void IMuseInternal::setBase(byte **base) {
@@ -452,7 +452,7 @@
 	return 0;
 }
 
-void IMuseInternal::addSysexHandler (byte mfgID, sysexfunc handler) {
+void IMuseInternal::addSysexHandler(byte mfgID, sysexfunc handler) {
 	// TODO: Eventually support multiple sysEx handlers and pay
 	// attention to the client-supplied manufacturer ID.
 	Common::StackLock lock(_mutex, "IMuseInternal::property()");
@@ -467,7 +467,7 @@
 //
 ////////////////////////////////////////
 
-void IMuseInternal::setMusicVolume (int vol) {
+void IMuseInternal::setMusicVolume(int vol) {
 	Common::StackLock lock(_mutex, "IMuseInternal::setMusicVolume()");
 	if (vol > 255)
 		vol = 255;
@@ -484,12 +484,12 @@
 
 void IMuseInternal::startSound(int sound) {
 	Common::StackLock lock(_mutex, "IMuseInternal::startSound()");
-	startSound_internal (sound);
+	startSound_internal(sound);
 }
 
 void IMuseInternal::stopSound(int sound) {
 	Common::StackLock lock(_mutex, "IMuseInternal::stopSound()");
-	stopSound_internal (sound);
+	stopSound_internal(sound);
 }
 
 void IMuseInternal::stopAllSounds() {
@@ -497,7 +497,7 @@
 	stopAllSounds_internal();
 }
 
-int IMuseInternal::getSoundStatus (int sound) const {
+int IMuseInternal::getSoundStatus(int sound) const {
 	Common::StackLock lock(_mutex, "IMuseInternal::getSoundStatus()");
 	return getSoundStatus_internal (sound, true);
 }
@@ -557,7 +557,7 @@
 //
 ////////////////////////////////////////
 
-bool IMuseInternal::startSound_internal (int sound) {
+bool IMuseInternal::startSound_internal(int sound) {
 	// Do not start a sound if it is already set to start on an ImTrigger
 	// event. This fixes carnival music problems where a sound has been set
 	// to trigger at the right time, but then is started up immediately
@@ -633,7 +633,7 @@
 	return player->startSound(sound, driver, _direct_passthrough);
 }
 
-int IMuseInternal::stopSound_internal (int sound) {
+int IMuseInternal::stopSound_internal(int sound) {
 	int r = -1;
 	Player *player = findActivePlayer(sound);
 	if (player) {
@@ -652,7 +652,7 @@
 	return 0;
 }
 
-int IMuseInternal::getSoundStatus_internal (int sound, bool ignoreFadeouts) const {
+int IMuseInternal::getSoundStatus_internal(int sound, bool ignoreFadeouts) const {
 	const Player *player = _players;
 	for (int i = ARRAYSIZE(_players); i; i--, player++) {
 		if (player->isActive() && (!ignoreFadeouts || !player->isFadingOut())) {
@@ -713,9 +713,9 @@
 			debug(0, "IMuse doCommand(7) - getMasterVolume (%d)", a[1]);
 			return _master_volume / 2; // Convert from 0-255 to 0-127
 		case 8:
-			return startSound_internal (a[1]) ? 0 : -1;
+			return startSound_internal(a[1]) ? 0 : -1;
 		case 9:
-			return stopSound_internal (a[1]);
+			return stopSound_internal(a[1]);
 		case 10: // FIXME: Sam and Max - Not sure if this is correct
 			return stopAllSounds_internal();
 		case 11:
@@ -968,7 +968,7 @@
 			break;
 		_queue_end = pos;
 
-		doCommand_internal (p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0);
+		doCommand_internal(p[0], p[1], p[2], p[3], p[4], p[5], p[6], 0);
 
 		if (_queue_cleared)
 			return;
@@ -1231,8 +1231,8 @@
 	// NOTE: We ONLY do this if the sound that will trigger the command is actually
 	// playing. Otherwise, there's a problem when exiting and re-entering the
 	// Bumpusville mansion. Ref Bug #780918.
-	if (trig->command[0] == 8 && getSoundStatus_internal (trig->command[1],true) && getSoundStatus_internal (sound,true))
-		stopSound_internal (trig->command[1]);
+	if (trig->command[0] == 8 && getSoundStatus_internal(trig->command[1],true) && getSoundStatus_internal(sound,true))
+		stopSound_internal(trig->command[1]);
 	return 0;
 }
 
@@ -1257,7 +1257,7 @@
 	for (i = 0; i < ARRAYSIZE(_snm_triggers); ++i) {
 		if (_snm_triggers[i].sound == sound) {
 			_snm_triggers[i].sound = _snm_triggers[i].id = 0;
-			doCommand_internal (8, _snm_triggers[i].command);
+			doCommand_internal(8, _snm_triggers[i].command);
 			++count;
 		}
 	}
@@ -1384,12 +1384,12 @@
 	if (native_midi != NULL) {
 		_timer_info_native.imuse = this;
 		_timer_info_native.driver = native_midi;
-		initMidiDriver (&_timer_info_native);
+		initMidiDriver(&_timer_info_native);
 	}
 	if (adlib_midi != NULL) {
 		_timer_info_adlib.imuse = this;
 		_timer_info_adlib.driver = adlib_midi;
-		initMidiDriver (&_timer_info_adlib);
+		initMidiDriver(&_timer_info_adlib);
 	}
 
 	if (!_tempoFactor)
@@ -1408,14 +1408,14 @@
 	return 0;
 }
 
-void IMuseInternal::initMidiDriver (TimerCallbackInfo *info) {
+void IMuseInternal::initMidiDriver(TimerCallbackInfo *info) {
 	// Open MIDI driver
 	int result = info->driver->open();
 	if (result)
 		error("IMuse initialization - %s", MidiDriver::getErrorName(result));
 
 	// Connect to the driver's timer
-	info->driver->setTimerCallback (info, &IMuseInternal::midiTimerCallback);
+	info->driver->setTimerCallback(info, &IMuseInternal::midiTimerCallback);
 }
 
 void IMuseInternal::initMT32(MidiDriver *midi) {
@@ -1612,7 +1612,7 @@
 		if (!ptr->time_left)
 			continue;
 		if (ptr->time_left <= advance) {
-			doCommand_internal (ptr->a, ptr->b, ptr->c, ptr->d, ptr->e, ptr->f, 0, 0);
+			doCommand_internal(ptr->a, ptr->b, ptr->c, ptr->d, ptr->e, ptr->f, 0, 0);
 			ptr->time_left = advance;
 		}
 		ptr->time_left -= advance;
@@ -1671,9 +1671,9 @@
 //
 ////////////////////////////////////////
 
-void IMuseInternal::midiTimerCallback (void *data) {
-	TimerCallbackInfo *info = (TimerCallbackInfo *) data;
-	info->imuse->on_timer (info->driver);
+void IMuseInternal::midiTimerCallback(void *data) {
+	TimerCallbackInfo *info = (TimerCallbackInfo *)data;
+	info->imuse->on_timer(info->driver);
 }
 
 void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {

Modified: scummvm/trunk/engines/scumm/imuse/imuse_internal.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse_internal.h	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/imuse_internal.h	2006-11-12 02:24:25 UTC (rev 24680)
@@ -161,7 +161,7 @@
  * #define SYSEX_CALLBACK_FUNCTION nameOfHandlerFunction
  */
 #ifdef SYSEX_CALLBACK_FUNCTION
-	friend void SYSEX_CALLBACK_FUNCTION (Player *, const byte *, uint16);
+	friend void SYSEX_CALLBACK_FUNCTION(Player *, const byte *, uint16);
 #endif
 
 protected:
@@ -240,7 +240,7 @@
 	Player();
 	virtual ~Player();
 
-	int	 addParameterFader(int param, int target, int time);
+	int addParameterFader(int param, int target, int time);
 	void clear();
 	void clearLoop();
 	void fixAfterLoad();
@@ -384,7 +384,7 @@
  * #define SYSEX_CALLBACK_FUNCTION nameOfHandlerFunction
  */
 #ifdef SYSEX_CALLBACK_FUNCTION
-	friend void SYSEX_CALLBACK_FUNCTION (Player *, const byte *, uint16);
+	friend void SYSEX_CALLBACK_FUNCTION(Player *, const byte *, uint16);
 #endif
 
 protected:
@@ -445,8 +445,8 @@
 	IMuseInternal();
 	int initialize(OSystem *syst, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver);
 
-	static void midiTimerCallback (void *data);
-	void on_timer (MidiDriver *midi);
+	static void midiTimerCallback(void *data);
+	void on_timer(MidiDriver *midi);
 
 	byte *findStartOfSound(int sound);
 	bool isMT32(int sound);
@@ -454,7 +454,7 @@
 	int get_queue_sound_status(int sound) const;
 	void handle_marker(uint id, byte data);
 	int get_channel_volume(uint a);
-	void initMidiDriver (TimerCallbackInfo *info);
+	void initMidiDriver(TimerCallbackInfo *info);
 	void initGM(MidiDriver *midi);
 	void initMT32(MidiDriver *midi);
 	void init_players();
@@ -499,22 +499,22 @@
 
 protected:
 	// Internal mutex-free versions of the IMuse and MusicEngine methods.
-	bool startSound_internal (int sound);
-	int stopSound_internal (int sound);
+	bool startSound_internal(int sound);
+	int stopSound_internal(int sound);
 	int stopAllSounds_internal();
-	int getSoundStatus_internal (int sound, bool ignoreFadeouts) const;
-	int32 doCommand_internal (int a, int b, int c, int d, int e, int f, int g, int h);
-	int32 doCommand_internal (int numargs, int args[]);
+	int getSoundStatus_internal(int sound, bool ignoreFadeouts) const;
+	int32 doCommand_internal(int a, int b, int c, int d, int e, int f, int g, int h);
+	int32 doCommand_internal(int numargs, int args[]);
 
 public:
 	// IMuse interface
 	void pause(bool paused);
 	int save_or_load(Serializer *ser, ScummEngine *scumm);
 	bool get_sound_active(int sound) const;
-	int32 doCommand (int numargs, int args[]);
+	int32 doCommand(int numargs, int args[]);
 	void setBase(byte **base);
 	uint32 property(int prop, uint32 value);
-	virtual void addSysexHandler (byte mfgID, sysexfunc handler);
+	virtual void addSysexHandler(byte mfgID, sysexfunc handler);
 
 public:
 	// MusicEngine interface
@@ -522,7 +522,7 @@
 	void startSound(int sound);
 	void stopSound(int sound);
 	void stopAllSounds();
-	int getSoundStatus (int sound) const;
+	int getSoundStatus(int sound) const;
 	int getMusicTimer() const;
 	void terminate();
 

Modified: scummvm/trunk/engines/scumm/imuse/imuse_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse_player.cpp	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/imuse_player.cpp	2006-11-12 02:24:25 UTC (rev 24680)
@@ -402,7 +402,7 @@
 
 void Player::decode_sysex_bytes(const byte *src, byte *dst, int len) {
 	while (len >= 0) {
-		*dst++ = ((src[0] << 4)&0xFF) | (src[1] & 0xF);
+		*dst++ = ((src[0] << 4) & 0xFF) | (src[1] & 0xF);
 		src += 2;
 		len -= 2;
 	}
@@ -885,7 +885,7 @@
 		break;
 
 	default:
-		debug(0, "Player::addParameterFader (%d, %d, %d): Unknown parameter", param, target, time);
+		debug(0, "Player::addParameterFader(%d, %d, %d): Unknown parameter", param, target, time);
 		return 0; // Should be -1, but we'll let the script think it worked.
 	}
 

Modified: scummvm/trunk/engines/scumm/imuse/instrument.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/instrument.cpp	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/instrument.cpp	2006-11-12 02:24:25 UTC (rev 24680)
@@ -35,7 +35,7 @@
 	byte program;
 }
 
-roland_to_gm_map [] = {
+roland_to_gm_map[] = {
 	// Monkey Island 2 instruments
 	// TODO: Complete
 	{ "badspit   ",  62 },
@@ -130,11 +130,11 @@
 	bool _mt32;
 
 public:
-	Instrument_Program (byte program, bool mt32);
-	Instrument_Program (Serializer *s);
-	void saveOrLoad (Serializer *s);
-	void send (MidiChannel *mc);
-	void copy_to (Instrument *dest) { dest->program (_program, _mt32); }
+	Instrument_Program(byte program, bool mt32);
+	Instrument_Program(Serializer *s);
+	void saveOrLoad(Serializer *s);
+	void send(MidiChannel *mc);
+	void copy_to(Instrument *dest) { dest->program(_program, _mt32); }
 	bool is_valid() {
 		return (_program < 128) &&
 			((_native_mt32 == _mt32) || _native_mt32
@@ -164,11 +164,11 @@
 	} _instrument;
 
 public:
-	Instrument_Adlib (const byte *data);
-	Instrument_Adlib (Serializer *s);
-	void saveOrLoad (Serializer *s);
-	void send (MidiChannel *mc);
-	void copy_to (Instrument *dest) { dest->adlib ((byte *) &_instrument); }
+	Instrument_Adlib(const byte *data);
+	Instrument_Adlib(Serializer *s);
+	void saveOrLoad(Serializer *s);
+	void send(MidiChannel *mc);
+	void copy_to(Instrument *dest) { dest->adlib((byte *)&_instrument); }
 	bool is_valid() { return true; }
 };
 
@@ -239,11 +239,11 @@
 	uint8 getEquivalentGM();
 
 public:
-	Instrument_Roland (const byte *data);
-	Instrument_Roland (Serializer *s);
-	void saveOrLoad (Serializer *s);
-	void send (MidiChannel *mc);
-	void copy_to (Instrument *dest) { dest->roland ((byte *) &_instrument); }
+	Instrument_Roland(const byte *data);
+	Instrument_Roland(Serializer *s);
+	void saveOrLoad(Serializer *s);
+	void send(MidiChannel *mc);
+	void copy_to(Instrument *dest) { dest->roland((byte *)&_instrument); }
 	bool is_valid() { return (_native_mt32 ? true : (_instrument_name[0] != '\0')); }
 };
 
@@ -253,7 +253,7 @@
 //
 ////////////////////////////////////////
 
-void Instrument::nativeMT32 (bool native) {
+void Instrument::nativeMT32(bool native) {
 	_native_mt32 = native;
 }
 
@@ -264,35 +264,35 @@
 	_type = itNone;
 }
 
-void Instrument::program (byte prog, bool mt32) {
+void Instrument::program(byte prog, bool mt32) {
 	clear();
 	if (prog > 127)
 		return;
 	_type = itProgram;
-	_instrument = new Instrument_Program (prog, mt32);
+	_instrument = new Instrument_Program(prog, mt32);
 }
 
-void Instrument::adlib (const byte *instrument) {
+void Instrument::adlib(const byte *instrument) {
 	clear();
 	if (!instrument)
 		return;
 	_type = itAdlib;
-	_instrument = new Instrument_Adlib (instrument);
+	_instrument = new Instrument_Adlib(instrument);
 }
 
-void Instrument::roland (const byte *instrument) {
+void Instrument::roland(const byte *instrument) {
 	clear();
 	if (!instrument)
 		return;
 	_type = itRoland;
-	_instrument = new Instrument_Roland (instrument);
+	_instrument = new Instrument_Roland(instrument);
 }
 
 void Instrument::saveOrLoad (Serializer *s) {
 	if (s->isSaving()) {
-		s->saveByte (_type);
+		s->saveByte(_type);
 		if (_instrument)
-			_instrument->saveOrLoad (s);
+			_instrument->saveOrLoad(s);
 	} else {
 		clear();
 		_type = s->loadByte();
@@ -300,16 +300,16 @@
 		case itNone:
 			break;
 		case itProgram:
-			_instrument = new Instrument_Program (s);
+			_instrument = new Instrument_Program(s);
 			break;
 		case itAdlib:
-			_instrument = new Instrument_Adlib (s);
+			_instrument = new Instrument_Adlib(s);
 			break;
 		case itRoland:
-			_instrument = new Instrument_Roland (s);
+			_instrument = new Instrument_Roland(s);
 			break;
 		default:
-			warning ("No known instrument classification #%d", (int) _type);
+			warning("No known instrument classification #%d", (int)_type);
 			_type = itNone;
 		}
 	}
@@ -321,38 +321,38 @@
 //
 ////////////////////////////////////////
 
-Instrument_Program::Instrument_Program (byte program, bool mt32) :
+Instrument_Program::Instrument_Program(byte program, bool mt32) :
 _program (program),
 _mt32 (mt32) {
 	if (program > 127)
 		_program = 255;
 }
 
-Instrument_Program::Instrument_Program (Serializer *s) {
+Instrument_Program::Instrument_Program(Serializer *s) {
 	_program = 255;
 	if (!s->isSaving())
-		saveOrLoad (s);
+		saveOrLoad(s);
 }
 
-void Instrument_Program::saveOrLoad (Serializer *s) {
+void Instrument_Program::saveOrLoad(Serializer *s) {
 	if (s->isSaving()) {
-		s->saveByte (_program);
-		s->saveByte (_mt32 ? 1 : 0);
+		s->saveByte(_program);
+		s->saveByte(_mt32 ? 1 : 0);
 	} else {
 		_program = s->loadByte();
 		_mt32 = (s->loadByte() > 0);
 	}
 }
 
-void Instrument_Program::send (MidiChannel *mc) {
+void Instrument_Program::send(MidiChannel *mc) {
 	if (_program > 127)
 		return;
 
 	byte program = _program;
 	if (_native_mt32 != _mt32)
-		program = _native_mt32 ? MidiDriver::_gmToMt32 [program] : MidiDriver::_mt32ToGm [program];
+		program = _native_mt32 ? MidiDriver::_gmToMt32[program] : MidiDriver::_mt32ToGm[program];
 	if (program < 128)
-		mc->programChange (program);
+		mc->programChange(program);
 }
 
 ////////////////////////////////////////
@@ -361,26 +361,26 @@
 //
 ////////////////////////////////////////
 
-Instrument_Adlib::Instrument_Adlib (const byte *data) {
-	memcpy (&_instrument, data, sizeof (_instrument));
+Instrument_Adlib::Instrument_Adlib(const byte *data) {
+	memcpy(&_instrument, data, sizeof(_instrument));
 }
 
-Instrument_Adlib::Instrument_Adlib (Serializer *s) {
+Instrument_Adlib::Instrument_Adlib(Serializer *s) {
 	if (!s->isSaving())
-		saveOrLoad (s);
+		saveOrLoad(s);
 	else
-		memset (&_instrument, 0, sizeof (_instrument));
+		memset(&_instrument, 0, sizeof(_instrument));
 }
 
-void Instrument_Adlib::saveOrLoad (Serializer *s) {
+void Instrument_Adlib::saveOrLoad(Serializer *s) {
 	if (s->isSaving())
-		s->saveBytes (&_instrument, sizeof (_instrument));
+		s->saveBytes(&_instrument, sizeof(_instrument));
 	else
-		s->loadBytes (&_instrument, sizeof (_instrument));
+		s->loadBytes(&_instrument, sizeof(_instrument));
 }
 
-void Instrument_Adlib::send (MidiChannel *mc) {
-	mc->sysEx_customInstrument ('ADL ', (byte *) &_instrument);
+void Instrument_Adlib::send(MidiChannel *mc) {
+	mc->sysEx_customInstrument('ADL ', (byte *)&_instrument);
 }
 
 ////////////////////////////////////////
@@ -389,39 +389,39 @@
 //
 ////////////////////////////////////////
 
-Instrument_Roland::Instrument_Roland (const byte *data) {
-	memcpy (&_instrument, data, sizeof (_instrument));
-	memcpy (&_instrument_name, &_instrument.common.name, sizeof (_instrument.common.name));
+Instrument_Roland::Instrument_Roland(const byte *data) {
+	memcpy(&_instrument, data, sizeof(_instrument));
+	memcpy(&_instrument_name, &_instrument.common.name, sizeof(_instrument.common.name));
 	_instrument_name[10] = '\0';
 	if (!_native_mt32 && getEquivalentGM() >= 128) {
-		debug (0, "MT-32 instrument \"%s\" not supported yet", _instrument_name);
+		debug(0, "MT-32 instrument \"%s\" not supported yet", _instrument_name);
 		_instrument_name[0] = '\0';
 	}
 }
 
-Instrument_Roland::Instrument_Roland (Serializer *s) {
+Instrument_Roland::Instrument_Roland(Serializer *s) {
 	_instrument_name[0] = '\0';
 	if (!s->isSaving())
 		saveOrLoad (s);
 	else
-		memset (&_instrument, 0, sizeof (_instrument));
+		memset(&_instrument, 0, sizeof(_instrument));
 }
 
 void Instrument_Roland::saveOrLoad (Serializer *s) {
 	if (s->isSaving()) {
-		s->saveBytes (&_instrument, sizeof (_instrument));
+		s->saveBytes (&_instrument, sizeof(_instrument));
 	} else {
-		s->loadBytes (&_instrument, sizeof (_instrument));
-		memcpy (&_instrument_name, &_instrument.common.name, sizeof (_instrument.common.name));
+		s->loadBytes (&_instrument, sizeof(_instrument));
+		memcpy(&_instrument_name, &_instrument.common.name, sizeof(_instrument.common.name));
 		_instrument_name[10] = '\0';
 		if (!_native_mt32 && getEquivalentGM() >= 128) {
-			debug (2, "MT-32 custom instrument \"%s\" not supported", _instrument_name);
+			debug(2, "MT-32 custom instrument \"%s\" not supported", _instrument_name);
 			_instrument_name[0] = '\0';
 		}
 	} // end if
 }
 
-void Instrument_Roland::send (MidiChannel *mc) {
+void Instrument_Roland::send(MidiChannel *mc) {
 	if (_native_mt32) {
 		if (mc->getNumber() > 8)
 			return;
@@ -435,25 +435,25 @@
 
 		// Recompute the checksum.
 		byte checksum = 0;
-		byte *ptr = (byte *) &_instrument + 4;
+		byte *ptr = (byte *)&_instrument + 4;
 		int i;
-		for (i = 4; i < (int)sizeof (_instrument) - 1; ++i)
+		for (i = 4; i < (int)sizeof(_instrument) - 1; ++i)
 			checksum -= *ptr++;
 		_instrument.checksum = checksum & 0x7F;
 
-		mc->device()->sysEx ((byte *) &_instrument, sizeof (_instrument));
+		mc->device()->sysEx((byte *)&_instrument, sizeof(_instrument));
 	} else {
 		// Convert to a GM program change.
 		byte program = getEquivalentGM();
 		if (program < 128)
-			mc->programChange (program);
+			mc->programChange(program);
 	}
 }
 
 uint8 Instrument_Roland::getEquivalentGM() {
 	byte i;
 	for (i = 0; i != ARRAYSIZE(roland_to_gm_map); ++i) {
-		if (!memcmp (roland_to_gm_map[i].name, _instrument.common.name, 10))
+		if (!memcmp(roland_to_gm_map[i].name, _instrument.common.name, 10))
 			return roland_to_gm_map[i].program;
 	}
 	return 255;

Modified: scummvm/trunk/engines/scumm/imuse/instrument.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse/instrument.h	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/instrument.h	2006-11-12 02:24:25 UTC (rev 24680)
@@ -36,9 +36,9 @@
 class InstrumentInternal {
 public:
 	virtual ~InstrumentInternal() {}
-	virtual void saveOrLoad (Serializer *s) = 0;
-	virtual void send (MidiChannel *mc) = 0;
-	virtual void copy_to (Instrument *dest) = 0;
+	virtual void saveOrLoad(Serializer *s) = 0;
+	virtual void send(MidiChannel *mc) = 0;
+	virtual void copy_to(Instrument *dest) = 0;
 	virtual bool is_valid() = 0;
 	virtual operator int() { return 255; }
 };
@@ -58,20 +58,28 @@
 
 	Instrument() : _type (0), _instrument (0) { }
 	~Instrument() { delete _instrument; }
-	static void nativeMT32 (bool native);
+	static void nativeMT32(bool native);
 	static const byte _gmRhythmMap[35];
 
 	void clear();
-	void copy_to (Instrument *dest) { if (_instrument) _instrument->copy_to (dest); else dest->clear(); }
+	void copy_to(Instrument *dest) {
+		if (_instrument)
+			_instrument->copy_to(dest);
+		else
+			dest->clear();
+	}
 
-	void program (byte program, bool mt32);
-	void adlib (const byte *instrument);
-	void roland (const byte *instrument);
+	void program(byte program, bool mt32);
+	void adlib(const byte *instrument);
+	void roland(const byte *instrument);
 
 	byte getType() { return _type; }
 	bool isValid() { return (_instrument ? _instrument->is_valid() : false); }
-	void saveOrLoad (Serializer *s);
-	void send (MidiChannel *mc) { if (_instrument) _instrument->send (mc); }
+	void saveOrLoad(Serializer *s);
+	void send(MidiChannel *mc) {
+		if (_instrument)
+			_instrument->send(mc);
+	}
 };
 
 } // End of namespace Scumm

Modified: scummvm/trunk/engines/scumm/imuse/sysex.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse/sysex.h	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/sysex.h	2006-11-12 02:24:25 UTC (rev 24680)
@@ -30,8 +30,8 @@
 
 class Player;
 
-extern void sysexHandler_Scumm (Player *, const byte *, uint16);
-extern void sysexHandler_SamNMax (Player *, const byte *, uint16);
+extern void sysexHandler_Scumm(Player *, const byte *, uint16);
+extern void sysexHandler_SamNMax(Player *, const byte *, uint16);
 
 } // End of namespace Scumm
 

Modified: scummvm/trunk/engines/scumm/imuse/sysex_samnmax.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/sysex_samnmax.cpp	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/sysex_samnmax.cpp	2006-11-12 02:24:25 UTC (rev 24680)
@@ -37,9 +37,9 @@
 
 namespace Scumm {
 
-extern void sysexHandler_Scumm (Player *, const byte *, uint16);
+extern void sysexHandler_Scumm(Player *, const byte *, uint16);
 
-void sysexHandler_SamNMax (Player *player, const byte *msg, uint16 len) {
+void sysexHandler_SamNMax(Player *player, const byte *msg, uint16 len) {
 	byte a;
 
 	IMuseInternal *se = player->_se;
@@ -71,7 +71,7 @@
 		break;
 
 	default:
-		sysexHandler_Scumm (player, msg, len);
+		sysexHandler_Scumm(player, msg, len);
 	}
 }
 

Modified: scummvm/trunk/engines/scumm/imuse/sysex_scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/sysex_scumm.cpp	2006-11-12 00:10:13 UTC (rev 24679)
+++ scummvm/trunk/engines/scumm/imuse/sysex_scumm.cpp	2006-11-12 02:24:25 UTC (rev 24680)
@@ -37,7 +37,7 @@
 
 namespace Scumm {
 
-void sysexHandler_Scumm (Player *player, const byte *msg, uint16 len) {
+void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
 	Part *part;
 	byte a;
 	byte buf[128];
@@ -67,12 +67,12 @@
 		part = player->getPart(p[0] & 0x0F);
 		if (part) {
 			part->set_onoff(p[2] & 0x01);
-			part->effectLevel ((p[2] & 0x02) ? 127 : 0);
+			part->effectLevel((p[2] & 0x02) ? 127 : 0);
 			part->set_pri(p[4]);
 			part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F));
 			part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F));
 			part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false;
-			part->pitchBendFactor ((p[13] & 0x0F) << 4 | (p[14] & 0x0F));
+			part->pitchBendFactor((p[13] & 0x0F) << 4 | (p[14] & 0x0F));
 			if (part->_percussion) {
 				if (part->_mc) {
 					part->off();
@@ -93,8 +93,9 @@
 
 	case 1:
 		// Shut down a part. [Bug 1088045, comments]
-		part = player->getPart (p[0]);
-		if (part != NULL) part->uninit();
+		part = player->getPart(p[0]);
+		if (part != NULL)
+			part->uninit();
 		break;
 
 	case 2: // Start of song. Ignore for now.
@@ -189,7 +190,7 @@
 
 	case 96: // Set instrument
 		part = player->getPart(p[0] & 0x0F);
-		a = (p[1] & 0x0F) << 12 |(p[2] & 0x0F) << 8 |(p[3] & 0x0F) << 4 |(p[4] & 0x0F);
+		a = (p[1] & 0x0F) << 12 | (p[2] & 0x0F) << 8 | (p[3] & 0x0F) << 4 | (p[4] & 0x0F);
 		if (part)
 			part->set_instrument(a);
 		break;


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