diff options
author | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
commit | 6b4484472b79dc7ea7d1ce545a28fba7d3b7696f (patch) | |
tree | c44c4e61f18ddd537f7082cb48869cf33d422fbd /backends/midi | |
parent | 86ab70b149e5cd00cf54f2e41896e2c4e16795e4 (diff) | |
download | scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.gz scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.bz2 scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.zip |
Remove trailing whitespaces.
svn-id: r18604
Diffstat (limited to 'backends/midi')
-rw-r--r-- | backends/midi/alsa.cpp | 2 | ||||
-rw-r--r-- | backends/midi/coreaudio.cpp | 48 | ||||
-rw-r--r-- | backends/midi/quicktime.cpp | 8 | ||||
-rw-r--r-- | backends/midi/ypa1.cpp | 10 | ||||
-rw-r--r-- | backends/midi/zodiac.cpp | 12 |
5 files changed, 40 insertions, 40 deletions
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp index 81d264965f..d7b91b4614 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -90,7 +90,7 @@ int MidiDriver_ALSA::open() { error("Invalid port %s", var); return -1; } - } else { + } else { if (parse_addr(var, &seq_client, &seq_port) < 0) { error("Invalid port %s", var); return -1; diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index b4822a821e..cf7e3af6d1 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -37,7 +37,7 @@ // Enable the following switch to make ScummVM try to use native MIDI hardware -// on your computer for MIDI output. This is currently quite hackish, in +// on your computer for MIDI output. This is currently quite hackish, in // particular you have no way to specify which device is used (it just always // uses the first output device it can find), nor is there a switch to // force it to use the soft synth instead of the MIDI HW. @@ -89,8 +89,8 @@ int MidiDriver_CORE::open() { int dests = MIDIGetNumberOfDestinations(); if (dests > 0 && mClient) { mDest = MIDIGetDestination(0); - err = MIDIOutputPortCreate( mClient, - CFSTR("scummvm_output_port"), + err = MIDIOutputPortCreate( mClient, + CFSTR("scummvm_output_port"), &mOutPort); } #endif @@ -99,7 +99,7 @@ int MidiDriver_CORE::open() { AudioUnitConnection auconnect; ComponentDescription compdesc; Component compid; - + // Open the Music Device. // We use the AudioUnit v1 API, even though it is deprecated, because // this way we stay compatible with older OS X versions. @@ -111,10 +111,10 @@ int MidiDriver_CORE::open() { compdesc.componentFlagsMask = 0; compid = FindNextComponent(NULL, &compdesc); au_MusicDevice = static_cast<AudioUnit>(OpenComponent(compid)); - + if (au_MusicDevice == 0) error("Failed opening CoreAudio music device"); - + // Load custom soundfont, if specified // FIXME: This is kind of a temporary hack. Better (IMO) would be to // query QuickTime for whatever custom soundfont was set in the @@ -123,13 +123,13 @@ int MidiDriver_CORE::open() { FSRef fsref; FSSpec fsSpec; const char *soundfont = ConfMan.get("soundfont").c_str(); - + err = FSPathMakeRef ((const byte *)soundfont, &fsref, NULL); - + if (err == noErr) { err = FSGetCatalogInfo (&fsref, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL); } - + if (err == noErr) { err = AudioUnitSetProperty ( au_MusicDevice, @@ -138,16 +138,16 @@ int MidiDriver_CORE::open() { &fsSpec, sizeof(fsSpec) ); } - + if (err != noErr) warning("Failed loading custom sound font '%s' (error %d)\n", soundfont, err); } - + // open the output unit au_output = (AudioUnit) OpenDefaultComponent(kAudioUnitComponentType, kAudioUnitSubType_Output); if (au_output == 0) error("Failed opening output audio unit"); - + // connect the units auconnect.sourceAudioUnit = au_MusicDevice; auconnect.sourceOutputNumber = 0; @@ -155,20 +155,20 @@ int MidiDriver_CORE::open() { err = AudioUnitSetProperty(au_output, kAudioUnitProperty_MakeConnection, kAudioUnitScope_Input, 0, (void *)&auconnect, sizeof(AudioUnitConnection)); - + #ifdef COREAUDIO_DISABLE_REVERB UInt32 usesReverb = 0; AudioUnitSetProperty (au_MusicDevice, kMusicDeviceProperty_UsesInternalReverb, kAudioUnitScope_Global, 0, &usesReverb, sizeof (usesReverb)); #endif - + // initialize the units AudioUnitInitialize(au_MusicDevice); AudioUnitInitialize(au_output); - + // start the output AudioOutputUnitStart(au_output); - + } return 0; @@ -184,7 +184,7 @@ void MidiDriver_CORE::close() { } else { // Stop the output AudioOutputUnitStop(au_output); - + // Cleanup CloseComponent(au_output); au_output = 0; @@ -201,15 +201,15 @@ void MidiDriver_CORE::send(uint32 b) { if (mOutPort && mDest) { MIDIPacketList packetList; MIDIPacket *packet = &packetList.packet[0]; - + packetList.numPackets = 1; - + packet->timeStamp = 0; packet->length = 3; packet->data[0] = status_byte; packet->data[1] = first_byte; packet->data[2] = second_byte; - + MIDISend(mOutPort, mDest, &packetList); } else { assert(au_output != NULL); @@ -219,18 +219,18 @@ void MidiDriver_CORE::send(uint32 b) { } void MidiDriver_CORE::sysEx(byte *msg, uint16 length) { - + if (mOutPort && mDest) { byte buf[384]; MIDIPacketList *packetList = (MIDIPacketList *)buf; MIDIPacket *packet = packetList->packet; assert(sizeof(buf) >= sizeof(UInt32) + sizeof(MIDITimeStamp) + sizeof(UInt16) + length + 2); - + packetList->numPackets = 1; packet->timeStamp = 0; - + // Add SysEx frame if missing if (*msg != 0xF0) { packet->length = length + 2; @@ -241,7 +241,7 @@ void MidiDriver_CORE::sysEx(byte *msg, uint16 length) { packet->length = length; memcpy(packet->data, msg, length); } - + MIDISend(mOutPort, mDest, packetList); } else { assert(au_output != NULL); diff --git a/backends/midi/quicktime.cpp b/backends/midi/quicktime.cpp index 43ccb47fe9..1741d612d6 100644 --- a/backends/midi/quicktime.cpp +++ b/backends/midi/quicktime.cpp @@ -47,7 +47,7 @@ class MidiDriver_QT : public MidiDriver_MPU401 { public: MidiDriver_QT(); - + int open(); void close(); void send(uint32 b); @@ -62,7 +62,7 @@ private: // pitch bending so differently from MPU401. uint16 _pitchbend [16]; byte _pitchbend_range [16]; - + void dispose(); }; @@ -109,7 +109,7 @@ int MidiDriver_QT::open() { bail: error("Init QT failed %x %x %d\n", (int)qtNoteAllocator, (int)qtNoteChannel, (int)qtErr); - + dispose(); return MERR_DEVICE_NOT_AVAILABLE; @@ -206,7 +206,7 @@ void MidiDriver_QT::send(uint32 b) { // to +/- 12 semitones. Based on this, we first center the input data, then // multiply it by a factor. If all was right, the factor would be 3/8, but for // mysterious reasons the actual factor we have to use is more like 1/32 or 3/64. - // Maybe the QT docs are right, and + // Maybe the QT docs are right, and _pitchbend[chanID] = ((uint16) midiCmd[1] | (uint16) (midiCmd[2] << 7)); long theBend = ((long) _pitchbend[chanID] - 0x2000) * _pitchbend_range[chanID] / 32; diff --git a/backends/midi/ypa1.cpp b/backends/midi/ypa1.cpp index 10d353997d..19f7628541 100644 --- a/backends/midi/ypa1.cpp +++ b/backends/midi/ypa1.cpp @@ -72,7 +72,7 @@ void MidiDriver_YamahaPa1::send(uint32 b) { midiCmd[2] = (b & 0x00FF0000) >> 16; midiCmd[1] = (b & 0x0000FF00) >> 8; midiCmd[0] = (b & 0x000000FF); - + chanID = (midiCmd[0] & 0x0F) ; mdCmd = midiCmd[0] & 0xF0; @@ -80,19 +80,19 @@ void MidiDriver_YamahaPa1::send(uint32 b) { case 0x80: // note off Pa1Lib_midiNoteOff(_midiHandle, chanID, midiCmd[1], 0); break; - + case 0x90: // note on Pa1Lib_midiNoteOn(_midiHandle, chanID, midiCmd[1], midiCmd[2]); break; - + case 0xB0: // control change Pa1Lib_midiControlChange(_midiHandle, chanID, midiCmd[1], midiCmd[2]); break; - + case 0xC0: // progam change Pa1Lib_midiProgramChange(_midiHandle, chanID, midiCmd[1]); break; - + case 0xE0: // pitchBend Pa1Lib_midiPitchBend(_midiHandle, chanID, (short)(midiCmd[1] | (midiCmd[2] << 8))); break; diff --git a/backends/midi/zodiac.cpp b/backends/midi/zodiac.cpp index 8fb4304dc1..39cfd203ef 100644 --- a/backends/midi/zodiac.cpp +++ b/backends/midi/zodiac.cpp @@ -64,7 +64,7 @@ void MidiDriver_Zodiac::close() { if (_isOpen) { _isOpen = false; MidiDriver_MPU401::close(); - + TwMidiSetMasterVolume(_oldVol); TwMidiClose(_midiHandle); } @@ -81,7 +81,7 @@ void MidiDriver_Zodiac::send(uint32 b) { midiCmd[2] = (b & 0x00FF0000) >> 16; midiCmd[1] = (b & 0x0000FF00) >> 8; midiCmd[0] = (b & 0x000000FF); - + chanID = (midiCmd[0] & 0x0F) ; mdCmd = midiCmd[0] & 0xF0; @@ -89,19 +89,19 @@ void MidiDriver_Zodiac::send(uint32 b) { case 0x80: // note off TwMidiNoteOff(_midiHandle, chanID, midiCmd[1], 0); break; - + case 0x90: // note on TwMidiNoteOn(_midiHandle, chanID, midiCmd[1], midiCmd[2]); break; - + case 0xB0: // control change TwMidiControlChange(_midiHandle, chanID, midiCmd[1], midiCmd[2]); break; - + case 0xC0: // progam change TwMidiProgramChange(_midiHandle, chanID, midiCmd[1]); break; - + case 0xE0: // pitchBend TwMidiPitchBend(_midiHandle, chanID, (short)(midiCmd[1] | (midiCmd[2] << 8))); break; |