aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth
diff options
context:
space:
mode:
authorMax Horn2011-06-20 00:59:48 +0200
committerMax Horn2011-06-20 00:59:48 +0200
commit88913c0139ac6d1dfb356d3048702b7bc8ef4079 (patch)
treea7436d20333c28f87f2ed0bc15c743b5eb8144ee /audio/softsynth
parent3853e76202b132e769ae149720eca931cd87104a (diff)
downloadscummvm-rg350-88913c0139ac6d1dfb356d3048702b7bc8ef4079.tar.gz
scummvm-rg350-88913c0139ac6d1dfb356d3048702b7bc8ef4079.tar.bz2
scummvm-rg350-88913c0139ac6d1dfb356d3048702b7bc8ef4079.zip
ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting conventions. For future use, this is the command I used: git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
Diffstat (limited to 'audio/softsynth')
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp26
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_midi.cpp44
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_midi.h6
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp4
-rw-r--r--audio/softsynth/mt32.cpp4
6 files changed, 43 insertions, 43 deletions
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index beee5f1cad..28591117f0 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -67,7 +67,7 @@ public:
void updateEnvelopeGenerator();
- void setInstrument(uint8 *instr);
+ void setInstrument(uint8 *instr);
void setLevel(uint8 lvl);
void setPitch(uint32 pt);
void setBalance(uint8 blc);
@@ -272,12 +272,12 @@ private:
static const uint8 _fmDefaultInstrument[];
};
-TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) :
+TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) :
TownsPC98_FmSynth(mixer, kTypeTowns, externalMutexHandling),
_fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0),
_baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _drvOwner(owner),
_pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume),
- _outputVolumeFlags(0), _fmChanPlaying(0),
+ _outputVolumeFlags(0), _fmChanPlaying(0),
_numReservedChannels(0), _numWaveTables(0), _updateOutputVol(false), _ready(false) {
#define INTCB(x) &TownsAudioInterfaceInternal::intf_##x
@@ -431,7 +431,7 @@ void TownsAudioInterfaceInternal::releaseRef(TownsAudioInterface *owner) {
return;
_refCount--;
-
+
if (_refCount) {
if (_refInstance)
_refInstance->removePluginDriver(owner);
@@ -484,7 +484,7 @@ int TownsAudioInterfaceInternal::processCommand(int command, va_list &args) {
if (command < 0 || command > 81)
return 4;
-
+
Common::StackLock lock(_mutex);
int res = (this->*_intfOpcodes[command])(args);
@@ -564,7 +564,7 @@ void TownsAudioInterfaceInternal::nextTickEx(int32 *buffer, uint32 bufferSize) {
}
finOutL += oL;
finOutR += oR;
-
+
if (!(_pcmChan[ii]._activeKey || _pcmChan[ii]._activeEffect))
_pcmChan[ii]._activeOutput = false;
}
@@ -996,7 +996,7 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) {
if (mute & 2)
memset(&_outputMute[12], 1, 4);
if (mute & 1)
- memset(&_outputMute[8], 1, 4);
+ memset(&_outputMute[8], 1, 4);
_outputMute[(f < 0x80) ? 11 : 15] = 0;
f += f;
@@ -1009,8 +1009,8 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) {
_outputMute[(f < 0x80) ? 0 : 4] = 0;
f += f;
_outputMute[(f < 0x80) ? 1 : 5] = 0;
- f += f;
-
+ f += f;
+
updateOutputVolume();
return 0;
}
@@ -1581,7 +1581,7 @@ void TownsAudio_PcmChannel::clear() {
_envTotalLevel = _envAttackRate = _envDecayRate = _envSustainLevel = _envSustainRate = _envReleaseRate = 0;
_envStep = _envCurrentLevel = 0;
- _envState = kEnvReady;
+ _envState = kEnvReady;
_activeKey = _activeEffect = _activeOutput = _keyPressed = _reserved = false;
@@ -1650,7 +1650,7 @@ void TownsAudio_PcmChannel::keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable *
_activeEffect = true;
else
_keyPressed = _activeKey = true;
-
+
_activeOutput = true;
}
@@ -1742,7 +1742,7 @@ void TownsAudio_PcmChannel::setBalance(uint8 blc) {
void TownsAudio_PcmChannel::updateOutput() {
if (_activeKey || _activeEffect) {
_pos += _step;
-
+
if (&_data[_pos >> 11] >= _loopEnd) {
if (_loopLen) {
_pos -= _loopLen;
@@ -1811,7 +1811,7 @@ void TownsAudio_PcmChannel::setVelo(uint8 velo) {
_envTotalLevel = ((_envTotalLevel * lvl) >> 14) & 0xff;
_envSustainLevel = ((_envSustainLevel * lvl) >> 14) & 0xff;
envAttack();
- _tl = (_envCurrentLevel >> 8) << 1;
+ _tl = (_envCurrentLevel >> 8) << 1;
}
}
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
index 071a697615..e415a0dda5 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
@@ -36,7 +36,7 @@ public:
void setupProgram(const uint8 *data, uint8 mLevelPara, uint8 tLevelPara);
void setupEffects(int index, uint8 flags, const uint8 *effectData);
void setModWheel(uint8 value);
-
+
void connect(TownsMidiInputChannel *chan);
void disconnect();
@@ -100,7 +100,7 @@ private:
uint8 _operator1Tl;
uint8 _sustainNoteOff;
int16 _duration;
-
+
uint16 _freq;
int16 _freqAdjust;
@@ -134,7 +134,7 @@ public:
void controlChange(byte control, byte value);
void pitchBendFactor(byte value);
void priority(byte value);
- void sysEx_customInstrument(uint32 type, const byte *instr);
+ void sysEx_customInstrument(uint32 type, const byte *instr);
private:
void controlModulationWheel(byte value);
@@ -145,7 +145,7 @@ private:
void releasePedal();
TownsMidiOutputChannel *_out;
-
+
uint8 *_instrument;
uint8 _prg;
uint8 _chanIndex;
@@ -175,7 +175,7 @@ private:
class TownsMidiChanState {
public:
TownsMidiChanState();
- ~TownsMidiChanState() {}
+ ~TownsMidiChanState() {}
uint8 get(uint8 type);
uint8 unk1;
@@ -247,7 +247,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u
// music (unsuitable data is just forced into the wrong audio device).
static const uint8 mul[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 12, 12, 15, 15 };
- uint8 chan = _chanMap[_chan];
+ uint8 chan = _chanMap[_chan];
uint8 mulAmsFms1 = _driver->_chanState[chan].mulAmsFms = data[0];
uint8 tl1 = _driver->_chanState[chan].tl = (data[1] | 0x3f) - mLevelPara;
@@ -296,7 +296,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u
void TownsMidiOutputChannel::setupEffects(int index, uint8 flags, const uint8 *effectData) {
uint16 effectMaxLevel[] = { 0x2FF, 0x1F, 0x07, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3E, 0x1F };
uint8 effectType[] = { 0x1D, 0x1C, 0x1B, 0x00, 0x03, 0x04, 0x07, 0x08, 0x0D, 0x10, 0x11, 0x14, 0x15, 0x1e, 0x1f, 0x00 };
-
+
EffectEnvelope *s = &_effectEnvelopes[index];
EffectDef *d = &_effectDefs[index];
@@ -354,7 +354,7 @@ void TownsMidiOutputChannel::connect(TownsMidiInputChannel *chan) {
void TownsMidiOutputChannel::disconnect() {
keyOff();
-
+
TownsMidiOutputChannel *p = _prev;
TownsMidiOutputChannel *n = _next;
@@ -448,10 +448,10 @@ int TownsMidiOutputChannel::advanceEffectEnvelope(EffectEnvelope *s, EffectDef *
s->state = kEnvReady;
return 0;
}
- }
+ }
int32 t = s->currentLevel + s->incrPerStep;
-
+
s->incrCountRem += s->incrPerStepRem;
if (s->incrCountRem >= s->numSteps) {
s->incrCountRem -= s->numSteps;
@@ -492,7 +492,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) {
if (v & 0x80)
e = _driver->randomValue(e);
-
+
if (!e)
e = 1;
@@ -525,7 +525,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) {
int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) {
uint8 chan = (type < 13) ? _chanMap2[_chan] : ((type < 26) ? _chanMap[_chan] : _chan);
-
+
if (type == 28)
return 15;
else if (type == 29)
@@ -539,8 +539,8 @@ int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) {
uint8 res = (_driver->_chanState[chan].get(def[0] >> 5) & def[2]) >> def[1];
if (def[3])
res = def[3] - res;
-
- return res;
+
+ return res;
}
int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) {
@@ -554,12 +554,12 @@ int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) {
return ((lvl + 1) * mod) >> 5;
if (mod < 0) {
- if (lvl < 0)
+ if (lvl < 0)
return _driver->_operatorLevelTable[((-lvl) << 5) - mod];
else
return -_driver->_operatorLevelTable[(lvl << 5) - mod];
} else {
- if (lvl < 0)
+ if (lvl < 0)
return -_driver->_operatorLevelTable[((-lvl) << 5) + mod];
else
return _driver->_operatorLevelTable[((-lvl) << 5) + mod];
@@ -577,7 +577,7 @@ void TownsMidiOutputChannel::keyOff() {
}
void TownsMidiOutputChannel::keyOnSetFreq(uint16 frq) {
- uint16 note = (frq << 1) >> 8;
+ uint16 note = (frq << 1) >> 8;
frq = (_freqMSB[note] << 11) | _freqLSB[note] ;
out(0xa4, frq >> 8);
out(0xa0, frq & 0xff);
@@ -701,7 +701,7 @@ void TownsMidiInputChannel::noteOff(byte note) {
void TownsMidiInputChannel::noteOn(byte note, byte velocity) {
TownsMidiOutputChannel *oc = _driver->allocateOutputChannel(_priority);
-
+
if (!oc)
return;
@@ -711,7 +711,7 @@ void TownsMidiInputChannel::noteOn(byte note, byte velocity) {
oc->_note = note;
oc->_sustainNoteOff = 0;
oc->_duration = _instrument[29] * 63;
-
+
oc->_operator1Tl = (_instrument[1] & 0x3f) + _driver->_operatorLevelTable[((velocity >> 1) << 5) + (_instrument[4] >> 2)];
if (oc->_operator1Tl > 63)
oc->_operator1Tl = 63;
@@ -840,7 +840,7 @@ MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerP
_channels = new TownsMidiInputChannel*[32];
for (int i = 0; i < 32; i++)
_channels[i] = new TownsMidiInputChannel(this, i > 8 ? (i + 1) : i);
-
+
_out = new TownsMidiOutputChannel*[6];
for (int i = 0; i < 6; i++)
_out[i] = new TownsMidiOutputChannel(this, i);
@@ -964,7 +964,7 @@ MidiChannel *MidiDriver_TOWNS::allocateChannel() {
if (!_isOpen)
return 0;
- for (int i = 0; i < 32; ++i) {
+ for (int i = 0; i < 32; ++i) {
TownsMidiInputChannel *chan = _channels[i];
if (chan->allocate())
return chan;
@@ -1023,7 +1023,7 @@ TownsMidiOutputChannel *MidiDriver_TOWNS::allocateOutputChannel(uint8 pri) {
res = _out[_allocCurPos];
}
}
-
+
if (res)
res->disconnect();
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.h b/audio/softsynth/fmtowns_pc98/towns_midi.h
index 9aa7c93b35..8c764c55d9 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.h
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.h
@@ -57,7 +57,7 @@ private:
void updateOutputChannels();
TownsMidiOutputChannel *allocateOutputChannel(uint8 pri);
-
+
int randomValue(int para);
TownsMidiInputChannel **_channels;
@@ -72,11 +72,11 @@ private:
uint32 _tickCounter;
uint8 _allocCurPos;
uint8 _rand;
-
+
bool _isOpen;
uint8 *_operatorLevelTable;
-
+
const uint16 _baseTempo;
};
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
index 49fe97caf1..001d258873 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
@@ -1265,7 +1265,7 @@ void TownsPC98_AudioDriver::fadeStep() {
void TownsPC98_AudioDriver::pause() {
_musicPlaying = false;
}
-
+
void TownsPC98_AudioDriver::cont() {
_musicPlaying = true;
}
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index 63007ba93c..b4967a556f 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -1160,12 +1160,12 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
for (int i = 0; i < 2; i++) {
if (_timers[i].enabled && _timers[i].cb) {
if (!_timers[i].smpTillCb) {
-
+
if (locked && _externalMutex) {
_mutex.unlock();
locked = false;
}
-
+
(this->*_timers[i].cb)();
if (!locked && _externalMutex) {
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp
index 6d13ec33b4..6703a6f7b7 100644
--- a/audio/softsynth/mt32.cpp
+++ b/audio/softsynth/mt32.cpp
@@ -564,8 +564,8 @@ bool MT32EmuMusicPlugin::checkDevice(MidiDriver::DeviceHandle) const {
warning("The MT-32 emulator requires one of the two following file sets (not bundled with ScummVM):\n Either 'MT32_CONTROL.ROM' and 'MT32_PCM.ROM' or 'CM32L_CONTROL.ROM' and 'CM32L_PCM.ROM'");
return false;
}
-
- return true;
+
+ return true;
}
Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {