[Scummvm-cvs-logs] CVS: scummvm/sound audiostream.cpp,1.39,1.40 fmopl.cpp,1.18,1.19 midiparser.cpp,1.17,1.18 midiparser_xmidi.cpp,1.14,1.15 mixer.cpp,1.130,1.131 mixer.h,1.57,1.58 rate.cpp,1.28,1.29
Pawel Kolodziejski
aquadran at users.sourceforge.net
Sat Nov 8 15:06:03 CET 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv686
Modified Files:
audiostream.cpp fmopl.cpp midiparser.cpp midiparser_xmidi.cpp
mixer.cpp mixer.h rate.cpp
Log Message:
cleanup whitespaces
Index: audiostream.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- audiostream.cpp 18 Sep 2003 02:07:18 -0000 1.39
+++ audiostream.cpp 8 Nov 2003 23:05:04 -0000 1.40
@@ -116,7 +116,7 @@
byte *_bufferEnd;
byte *_pos;
byte *_end;
-
+
inline int16 readIntern();
inline bool eosIntern() const { return _end == _pos; };
public:
@@ -255,11 +255,11 @@
*/
MP3InputStream::MP3InputStream(File *file, mad_timer_t duration, uint size) {
// duration == 0 means: play everything till end of file
-
+
mad_stream_init(&_stream);
mad_frame_init(&_frame);
mad_synth_init(&_synth);
-
+
_duration = duration;
_posInFrame = 0;
@@ -276,27 +276,26 @@
if (size) {
_file = 0;
}
-
}
MP3InputStream::~MP3InputStream() {
mad_synth_finish(&_synth);
mad_frame_finish(&_frame);
mad_stream_finish(&_stream);
-
+
free(_ptr);
}
bool MP3InputStream::init() {
// TODO
-
+
// Read in the first chunk of the MP3 file
_size = _file->read(_ptr, _bufferSize);
if (_size <= 0) {
warning("MP3InputStream: Failed to read MP3 data");
return false;
}
-
+
// Feed the data we just read into the stream decoder
mad_stream_buffer(&_stream, _ptr, _size);
@@ -305,8 +304,7 @@
// Check the header, determine if this is a stereo stream
int num;
- switch(_frame.header.mode)
- {
+ switch(_frame.header.mode) {
case MAD_MODE_SINGLE_CHANNEL:
case MAD_MODE_DUAL_CHANNEL:
case MAD_MODE_JOINT_STEREO:
@@ -333,7 +331,7 @@
if (!_file)
_size = -1;
-
+
// Give up immediately if we are at the EOF already
if (_size <= 0)
return;
@@ -347,7 +345,7 @@
}
// Read in more data from the input file
_size = _file->read(_ptr + offset, _bufferSize - offset);
-
+
// Nothing read -> EOF -> bail out
if (_size <= 0) {
return;
@@ -364,7 +362,7 @@
error("MP3InputStream: Unrecoverable error");
}
}
-
+
// Subtract the duration of this frame from the time left to play
mad_timer_t frame_duration = _frame.header.duration;
mad_timer_negate(&frame_duration);
@@ -372,7 +370,7 @@
if (!first && _file && mad_timer_compare(_duration, mad_timer_zero) <= 0)
_size = -1; // Mark for EOF
-
+
// Synthesise the frame into PCM samples and reset the buffer position
mad_synth_frame(&_synth, &_frame);
_posInFrame = 0;
@@ -494,7 +492,7 @@
_end_pos = ov_pcm_tell(_ov_file) + duration;
else
_end_pos = ov_pcm_total(_ov_file, -1);
-
+
// Read in initial data
refill();
}
@@ -537,14 +535,14 @@
long result = ov_read(_ov_file, read_pos, len_left,
#ifndef VORBIS_TREMOR
#ifdef SCUMM_BIG_ENDIAN
- 1,
+ 1,
#else
- 0,
+ 0,
#endif
- 2, // 16 bit
- 1, // signed
+ 2, // 16 bit
+ 1, // signed
#endif
- NULL);
+ NULL);
if (result == OV_HOLE) {
// Possibly recoverable, just warn about it
warning("Corrupted data in Vorbis file");
Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- fmopl.cpp 7 Nov 2003 02:41:03 -0000 1.18
+++ fmopl.cpp 8 Nov 2003 23:05:04 -0000 1.19
@@ -625,9 +625,9 @@
pom = 20 * log10(1 / pom); /* decibel */
j = int(pom / EG_STEP); /* TL_TABLE steps */
- /* degree 0 - 90 , degree 180 - 90 : plus section */
+ /* degree 0 - 90 , degree 180 - 90 : plus section */
SIN_TABLE[ s] = SIN_TABLE[SIN_ENT / 2 - s] = &TL_TABLE[j];
- /* degree 180 - 270 , degree 360 - 270 : minus section */
+ /* degree 180 - 270 , degree 360 - 270 : minus section */
SIN_TABLE[SIN_ENT / 2 + s] = SIN_TABLE[SIN_ENT - s] = &TL_TABLE[TL_MAX + j];
}
for (s = 0;s < SIN_ENT; s++) {
Index: midiparser.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- midiparser.cpp 7 Aug 2003 23:42:15 -0000 1.17
+++ midiparser.cpp 8 Nov 2003 23:05:04 -0000 1.18
@@ -43,8 +43,7 @@
_smartJump (false),
_num_tracks (0),
_active_track (255),
-_abort_parse (0)
-{
+_abort_parse (0) {
memset (_active_notes, 0, sizeof(_active_notes));
}
Index: midiparser_xmidi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser_xmidi.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- midiparser_xmidi.cpp 3 Oct 2003 23:34:06 -0000 1.14
+++ midiparser_xmidi.cpp 8 Nov 2003 23:05:04 -0000 1.15
@@ -144,7 +144,7 @@
// Read length of
len = read4high (pos);
start = pos;
-
+
// XDIRless XMIDI, we can handle them here.
if (!memcmp (pos, "XMID", 4)) {
printf ("Warning: XMIDI doesn't have XDIR\n");
@@ -166,11 +166,11 @@
// Read length of chunk
chunk_len = read4high (pos);
-
+
// Add eight bytes
i += 8;
-
- if (memcmp (buf, "INFO", 4)) {
+
+ if (memcmp (buf, "INFO", 4)) {
// Must align
pos += (chunk_len + 1) & ~1;
i += (chunk_len + 1) & ~1;
@@ -182,7 +182,7 @@
printf ("Invalid chunk length %d for 'INFO' block!\n", (int) chunk_len);
return false;
}
-
+
_num_tracks = (byte) read2low (pos);
if (chunk_len > 2) {
@@ -197,21 +197,21 @@
printf ("Didn't find a valid track count\n");
return false;
}
-
+
// Ok now to start part 2
// Goto the right place
pos = start + ((len + 1) & ~1);
-
+
if (memcmp (pos, "CAT ", 4)) {
// Not an XMID
printf ("Expected 'CAT ' but found '%c%c%c%c'\n", pos[0], pos[1], pos[2], pos[3]);
return false;
}
pos += 4;
-
+
// Now read length of this track
len = read4high (pos);
-
+
if (memcmp (pos, "XMID", 4)) {
// Not an XMID
printf ("Expected 'XMID' but found '%c%c%c%c'\n", pos[0], pos[1], pos[2], pos[3]);
Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- mixer.cpp 25 Oct 2003 01:11:14 -0000 1.130
+++ mixer.cpp 8 Nov 2003 23:05:04 -0000 1.131
@@ -199,7 +199,7 @@
void SoundMixer::endStream(PlayingSoundHandle handle) {
Common::StackLock lock(_mutex);
-
+
// Simply ignore stop requests for handles of sounds that already terminated
if (handle == 0)
return;
@@ -331,7 +331,7 @@
void SoundMixer::stopHandle(PlayingSoundHandle handle) {
Common::StackLock lock(_mutex);
-
+
// Simply ignore stop requests for handles of sounds that already terminated
if (handle == 0)
return;
@@ -349,7 +349,7 @@
void SoundMixer::setChannelVolume(PlayingSoundHandle handle, byte volume) {
Common::StackLock lock(_mutex);
-
+
if (handle == 0)
return;
@@ -366,7 +366,7 @@
void SoundMixer::setChannelPan(PlayingSoundHandle handle, int8 pan) {
Common::StackLock lock(_mutex);
-
+
if (handle == 0)
return;
@@ -537,8 +537,8 @@
}
ChannelStream::ChannelStream(SoundMixer *mixer, PlayingSoundHandle *handle,
- void *sound, uint32 size, uint rate,
- byte flags, uint32 buffer_size, byte volume, int8 pan)
+ void *sound, uint32 size, uint rate,
+ byte flags, uint32 buffer_size, byte volume, int8 pan)
: Channel(mixer, handle) {
_volume = volume;
_pan = pan;
Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- mixer.h 25 Oct 2003 01:11:14 -0000 1.57
+++ mixer.h 8 Nov 2003 23:05:04 -0000 1.58
@@ -147,19 +147,19 @@
/** Check whether any SFX channel is active.*/
bool hasActiveSFXChannel();
-
+
/** set the global volume, 0-256 */
void setVolume(int volume);
-
+
/** query the global volume, 0-256 */
int getVolume() const { return _globalVolume; }
/** set the music volume, 0-256 */
void setMusicVolume(int volume);
-
+
/** query the music volume, 0-256 */
int getMusicVolume() const { return _musicVolume; }
-
+
/** query the output rate in kHz */
uint getOutputRate() const { return _outputRate; }
Index: rate.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/rate.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- rate.cpp 5 Sep 2003 23:27:11 -0000 1.28
+++ rate.cpp 8 Nov 2003 23:05:04 -0000 1.29
@@ -115,7 +115,7 @@
ilast[0] = ilast[1] = 0;
icur[0] = icur[1] = 0;
-
+
inLen = 0;
}
@@ -124,11 +124,10 @@
* Return number of samples processed.
*/
template<bool stereo, bool reverseStereo>
-int LinearRateConverter<stereo, reverseStereo>::flow(AudioInputStream &input, st_sample_t *obuf, st_size_t osamp, st_volume_t vol_l, st_volume_t vol_r)
-{
+int LinearRateConverter<stereo, reverseStereo>::flow(AudioInputStream &input, st_sample_t *obuf, st_size_t osamp, st_volume_t vol_l, st_volume_t vol_r) {
st_sample_t *ostart, *oend;
st_sample_t out[2];
-
+
const int numChannels = stereo ? 2 : 1;
int i;
More information about the Scummvm-git-logs
mailing list