diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/adpcm.cpp | 10 | ||||
-rw-r--r-- | sound/fmopl.h | 4 | ||||
-rw-r--r-- | sound/softsynth/opl/dosbox.cpp | 22 | ||||
-rw-r--r-- | sound/softsynth/opl/opl_impl.h | 14 | ||||
-rw-r--r-- | sound/softsynth/opl/opl_inc.h | 8 | ||||
-rw-r--r-- | sound/timestamp.h | 10 | ||||
-rw-r--r-- | sound/vag.cpp | 18 | ||||
-rw-r--r-- | sound/vag.h | 6 |
8 files changed, 46 insertions, 46 deletions
diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp index a5f2f7c4eb..37b14140b7 100644 --- a/sound/adpcm.cpp +++ b/sound/adpcm.cpp @@ -112,12 +112,12 @@ public: ADPCMInputStream::ADPCMInputStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign, uint numLoops) : _stream(stream), _disposeAfterUse(disposeAfterUse), _channels(channels), _type(type), _blockAlign(blockAlign), _rate(rate), _numLoops(numLoops) { - + if (type == kADPCMMSIma && blockAlign == 0) error("ADPCMInputStream(): blockAlign isn't specified for MS IMA ADPCM"); if (type == kADPCMMS && blockAlign == 0) error("ADPCMInputStream(): blockAlign isn't specified for MS ADPCM"); - + if (type == kADPCMTinsel4 && blockAlign == 0) error("ADPCMInputStream(): blockAlign isn't specified for Tinsel 4-bit ADPCM"); if (type == kADPCMTinsel6 && blockAlign == 0) @@ -131,7 +131,7 @@ ADPCMInputStream::ADPCMInputStream(Common::SeekableReadStream *stream, bool disp error("ADPCMInputStream(): Tinsel 6-bit ADPCM only supports mono"); if (type == kADPCMTinsel8 && channels != 1) error("ADPCMInputStream(): Tinsel 8-bit ADPCM only supports mono"); - + _startpos = stream->pos(); _endpos = _startpos + size; _curLoop = 0; @@ -182,7 +182,7 @@ int ADPCMInputStream::readBuffer(int16 *buffer, const int numSamples) { error("Unsupported ADPCM encoding"); break; } - + // Loop if necessary if (samplesDecoded < numSamples || _stream->pos() == _endpos) { _curLoop++; @@ -192,7 +192,7 @@ int ADPCMInputStream::readBuffer(int16 *buffer, const int numSamples) { return samplesDecoded + readBuffer(buffer + samplesDecoded, numSamples - samplesDecoded); } } - + return samplesDecoded; } diff --git a/sound/fmopl.h b/sound/fmopl.h index 81d9610a44..d0b15368e0 100644 --- a/sound/fmopl.h +++ b/sound/fmopl.h @@ -76,7 +76,7 @@ public: /** * Creates the specific driver with a specific type setup. - */ + */ static OPL *create(DriverId driver, OplType type); /** @@ -86,7 +86,7 @@ public: static OPL *create(OplType type = kOpl2) { return create(detect(type), type); } private: - static const EmulatorDescription _drivers[]; + static const EmulatorDescription _drivers[]; }; class OPL { diff --git a/sound/softsynth/opl/dosbox.cpp b/sound/softsynth/opl/dosbox.cpp index cbb3090608..25fda7f2e6 100644 --- a/sound/softsynth/opl/dosbox.cpp +++ b/sound/softsynth/opl/dosbox.cpp @@ -40,7 +40,7 @@ #include <string.h> namespace OPL { -namespace DOSBox { +namespace DOSBox { Timer::Timer() { masked = false; @@ -51,7 +51,7 @@ Timer::Timer() { } void Timer::update(double time) { - if (!enabled || !delay) + if (!enabled || !delay) return; double deltaStart = time - startTime; // Only set the overflow flag when not masked @@ -66,7 +66,7 @@ void Timer::reset(double time) { double delta = (time - startTime); double rem = fmod(delta, delay); double next = delay - rem; - startTime = time + next; + startTime = time + next; } void Timer::stop() { @@ -116,7 +116,7 @@ bool Chip::write(uint32 reg, uint8 val) { timer[1].stop(); timer[1].masked = (val & 0x20) > 0; - + if (timer[1].masked) timer[1].overflow = false; } @@ -148,7 +148,7 @@ namespace OPL2 { #include "opl_impl.h" struct Handler : public DOSBox::Handler { - void writeReg(uint32 reg, uint8 val) { + void writeReg(uint32 reg, uint8 val) { adlib_write(reg, val); } @@ -171,7 +171,7 @@ namespace OPL3 { #include "opl_impl.h" struct Handler : public DOSBox::Handler { - void writeReg(uint32 reg, uint8 val) { + void writeReg(uint32 reg, uint8 val) { adlib_write(reg, val); } @@ -217,13 +217,13 @@ bool OPL::init(int rate) { case Config::kOpl3: _handler = new OPL3::Handler(); break; - + default: return false; } _handler->init(rate); - + if (_type == Config::kDualOpl2) { // Setup opl3 mode in the hander _handler->writeReg(0x105, 1); @@ -234,7 +234,7 @@ bool OPL::init(int rate) { } void OPL::reset() { - init(_rate); + init(_rate); } void OPL::write(int port, int val) { @@ -325,7 +325,7 @@ void OPL::writeReg(int r, int v) { void OPL::dualWrite(uint8 index, uint8 reg, uint8 val) { // Make sure you don't use opl3 features - // Don't allow write to disable opl3 + // Don't allow write to disable opl3 if (reg == 5) return; @@ -334,7 +334,7 @@ void OPL::dualWrite(uint8 index, uint8 reg, uint8 val) { val &= 3; // Write to the timer? - if (_chip[index].write(reg, val)) + if (_chip[index].write(reg, val)) return; // Enabling panning diff --git a/sound/softsynth/opl/opl_impl.h b/sound/softsynth/opl/opl_impl.h index c5ef87ce3c..5c68baa485 100644 --- a/sound/softsynth/opl/opl_impl.h +++ b/sound/softsynth/opl/opl_impl.h @@ -6,12 +6,12 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -131,7 +131,7 @@ static fltype decrelconst[4] = {1/39.28064,1/31.41608,1/26.17344,1/22.44608}; void operator_advance(op_type* op_pt, Bit32s vib) { op_pt->wfpos = op_pt->tcount; // waveform position - + // advance waveform time op_pt->tcount += op_pt->tinc; op_pt->tcount += (Bit32s)(op_pt->tinc)*vib/FIXEDPT; @@ -311,7 +311,7 @@ void change_attackrate(Bitu regbase, op_type* op_pt) { op_pt->env_step_a = (1<<(steps<=12?12-steps:0))-1; Bits step_num = (step_skip<=48)?(4-(step_skip&3)):0; - static Bit8u step_skip_mask[5] = {0xff, 0xfe, 0xee, 0xba, 0xaa}; + static Bit8u step_skip_mask[5] = {0xff, 0xfe, 0xee, 0xba, 0xaa}; op_pt->env_step_skip_a = step_skip_mask[step_num]; #if defined(OPLTYPE_IS_OPL3) @@ -1001,7 +1001,7 @@ void adlib_getsample(Bit16s* sndptr, Bits numsamples) { operator_advance(&cptr[9],vibval1[i]); opfuncs[cptr[9].op_state](&cptr[9]); operator_output(&cptr[9],0,tremval1[i]); - + Bit32s chanval = cptr[9].cval*2; CHANVAL_OUT } @@ -1033,7 +1033,7 @@ void adlib_getsample(Bit16s* sndptr, Bits numsamples) { operator_advance(&cptr[9],vibval2[i]); opfuncs[cptr[9].op_state](&cptr[9]); operator_output(&cptr[9],cptr[0].cval*FIXEDPT,tremval2[i]); - + Bit32s chanval = cptr[9].cval*2; CHANVAL_OUT } @@ -1347,7 +1347,7 @@ void adlib_getsample(Bit16s* sndptr, Bits numsamples) { } else { // FM-FM-style synthesis (op1[fb] * op2 * op3 * op4) - if ((cptr[0].op_state != OF_TYPE_OFF) || (cptr[9].op_state != OF_TYPE_OFF) || + if ((cptr[0].op_state != OF_TYPE_OFF) || (cptr[9].op_state != OF_TYPE_OFF) || (cptr[3].op_state != OF_TYPE_OFF) || (cptr[3+9].op_state != OF_TYPE_OFF)) { if ((cptr[0].vibrato) && (cptr[0].op_state != OF_TYPE_OFF)) { vibval1 = vibval_var1; diff --git a/sound/softsynth/opl/opl_inc.h b/sound/softsynth/opl/opl_inc.h index 0798bd9f6a..b7b6ac1d41 100644 --- a/sound/softsynth/opl/opl_inc.h +++ b/sound/softsynth/opl/opl_inc.h @@ -6,12 +6,12 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -132,7 +132,7 @@ typedef struct operator_struct { Bit32u act_state; // activity state (regular, percussion) bool sus_keep; // keep sustain level when decay finished bool vibrato,tremolo; // vibrato/tremolo enable bits - + // variables used to provide non-continuous envelopes Bit32u generator_pos; // for non-standard sample rates we need to determine how many samples have passed Bits cur_env_step; // current (standardized) sample position @@ -151,7 +151,7 @@ Bitu chip_num; op_type op[MAXOPERATORS]; Bits int_samplerate; - + Bit8u status; Bit32u index; #if defined(OPLTYPE_IS_OPL3) diff --git a/sound/timestamp.h b/sound/timestamp.h index af0cf96ff9..deb86bc2d7 100644 --- a/sound/timestamp.h +++ b/sound/timestamp.h @@ -45,23 +45,23 @@ protected: public: Timestamp(); - + /** * Set up a timestamp with a given time and framerate. * @param msecs staring time in milliseconds * @param frameRate number of frames per second */ Timestamp(uint32 msecs, int frameRate); - + /** Adds a number of frames to a timestamp. */ Timestamp addFrames(int frames) const; - + /** Computes the difference (# of frames) between this timestamp and b. */ int frameDiff(const Timestamp &b) const; - + /** Computes the difference (# of milliseconds) between this timestamp and b. */ int msecsDiff(const Timestamp &b) const; - + /** Determines the time in milliseconds described by this timestamp. */ uint32 msecs() const; }; diff --git a/sound/vag.cpp b/sound/vag.cpp index 46e6a64233..a08c1c0a72 100644 --- a/sound/vag.cpp +++ b/sound/vag.cpp @@ -22,7 +22,7 @@ * $Id$ * */ - + #include "sound/vag.h" namespace Audio { @@ -48,10 +48,10 @@ double f[5][2] = { { 0.0, 0.0 }, int VagStream::readBuffer(int16 *buffer, const int numSamples) { int32 samplesDecoded = 0; - + if (_samplesRemaining) { byte i = 0; - + for (i = 28 - _samplesRemaining; i < 28 && samplesDecoded < numSamples; i++) { _samples[i] = _samples[i] + _s1 * f[_predictor][0] + _s2 * f[_predictor][1]; _s2 = _s1; @@ -70,17 +70,17 @@ int VagStream::readBuffer(int16 *buffer, const int numSamples) { _samplesRemaining = 0; } - + while (samplesDecoded < numSamples) { byte i = 0; - + _predictor = _stream->readByte(); byte shift = _predictor & 0xf; _predictor >>= 4; - + if (_stream->readByte() == 7) return samplesDecoded; - + for (i = 0; i < 28; i += 2) { byte d = _stream->readByte(); int16 s = (d & 0xf) << 12; @@ -92,7 +92,7 @@ int VagStream::readBuffer(int16 *buffer, const int numSamples) { s |= 0xffff0000; _samples[i + 1] = (double)(s >> shift); } - + for (i = 0; i < 28 && samplesDecoded < numSamples; i++) { _samples[i] = _samples[i] + _s1 * f[_predictor][0] + _s2 * f[_predictor][1]; _s2 = _s1; @@ -101,7 +101,7 @@ int VagStream::readBuffer(int16 *buffer, const int numSamples) { buffer[samplesDecoded] = d; samplesDecoded++; } - + if (i != 27) _samplesRemaining = 28 - i; } diff --git a/sound/vag.h b/sound/vag.h index 228f68279e..f6f79d2b81 100644 --- a/sound/vag.h +++ b/sound/vag.h @@ -33,19 +33,19 @@ #include "sound/audiostream.h" #include "common/stream.h" - + namespace Audio { class VagStream : public Audio::AudioStream { public: VagStream(Common::SeekableReadStream *stream, bool loop = false, int rate = 11025); ~VagStream(); - + bool isStereo() const { return false; } bool endOfData() const { return _stream->pos() == _stream->size(); } int getRate() const { return _rate; } int readBuffer(int16 *buffer, const int numSamples); - void rewind(); + void rewind(); private: Common::SeekableReadStream *_stream; |