Fix for Visual Studio 2008. stdint.h is not bundled with VS 2008, instead we use cstdint.hpp from BOOST.

This commit is contained in:
Jan Borsodi 2010-09-09 23:25:11 +02:00
parent 32a2d1650c
commit 7f26ba2ba3
3 changed files with 10 additions and 4 deletions

View file

@ -55,8 +55,9 @@ static void checkALError(const char *where)
static void getALFormat(SampleSourcePtr inp, int &fmt, int &rate) static void getALFormat(SampleSourcePtr inp, int &fmt, int &rate)
{ {
int ch, bits; int32_t rate_, ch, bits;
inp->getInfo(&rate, &ch, &bits); inp->getInfo(&rate_, &ch, &bits);
rate = rate_;
fmt = 0; fmt = 0;

View file

@ -2,7 +2,7 @@
#define MANGLE_SOUND_SOURCE_H #define MANGLE_SOUND_SOURCE_H
#include <string> #include <string>
#include <stdint.h> #include <boost/cstdint.hpp>
#include <assert.h> #include <assert.h>
#include "../stream/stream.hpp" #include "../stream/stream.hpp"
@ -10,6 +10,8 @@
namespace Mangle { namespace Mangle {
namespace Sound { namespace Sound {
typedef boost::int32_t int32_t;
/// A stream containing raw sound data and information about the format /// A stream containing raw sound data and information about the format
class SampleSource : public Stream::Stream class SampleSource : public Stream::Stream
{ {

View file

@ -17,7 +17,10 @@ using namespace Mangle::Sound;
void AudiereSource::getInfo(int32_t *rate, int32_t *channels, int32_t *bits) void AudiereSource::getInfo(int32_t *rate, int32_t *channels, int32_t *bits)
{ {
SampleFormat fmt; SampleFormat fmt;
sample->getFormat(*channels, *rate, fmt); int channels_, rate_;
sample->getFormat(channels_, rate_, fmt);
*channels = channels_;
*rate = rate_;
if(bits) if(bits)
{ {
if(fmt == SF_U8) if(fmt == SF_U8)