diff options
author | Eugene Sandulenko | 2009-02-28 10:53:45 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-02-28 10:53:45 +0000 |
commit | 440fcb1d5abb1100074b3fdf69f8df26850c390a (patch) | |
tree | 48f557059c0bc9c16e73e31ab4ad25cfb93bca12 /engines/sword1/vag.h | |
parent | 5aa50ec889109864cbdd13298b4026c8ed78f484 (diff) | |
download | scummvm-rg350-440fcb1d5abb1100074b3fdf69f8df26850c390a.tar.gz scummvm-rg350-440fcb1d5abb1100074b3fdf69f8df26850c390a.tar.bz2 scummvm-rg350-440fcb1d5abb1100074b3fdf69f8df26850c390a.zip |
Patch #2638336: Broken Sword PSX Support Part 2 of 2
svn-id: r38957
Diffstat (limited to 'engines/sword1/vag.h')
-rw-r--r-- | engines/sword1/vag.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/engines/sword1/vag.h b/engines/sword1/vag.h new file mode 100644 index 0000000000..e9f429a599 --- /dev/null +++ b/engines/sword1/vag.h @@ -0,0 +1,58 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program 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 General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef SWORD1_VAG_H +#define SWORD1_VAG_H + +#include "sound/audiostream.h" +#include "common/stream.h" + +namespace Sword1 { + +class VagStream : public Audio::AudioStream { +public: + VagStream(Common::SeekableReadStream *stream, bool loop = false); + ~VagStream(); + + bool isStereo() const { return false; } + bool endOfData() const { return _stream->pos() == _stream->size(); } + int getRate() const { return 11025; } + int readBuffer(int16 *buffer, const int numSamples); + + void rewind(); + +private: + Common::SeekableReadStream *_stream; + + bool _loop; + byte _predictor; + double _samples[28]; + byte _samplesRemaining; + double _s1, _s2; +}; + +} // End of namespace Sword1 + +#endif |