mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-28 22:51:05 -04:00
Move OpenAL_SoundStream function definitions out of the class
This commit is contained in:
parent
2f6b73d461
commit
1b41987e18
@ -63,7 +63,16 @@ class OpenAL_SoundStream : public Sound
|
|||||||
std::auto_ptr<Sound_Decoder> Decoder;
|
std::auto_ptr<Sound_Decoder> Decoder;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OpenAL_SoundStream(std::auto_ptr<Sound_Decoder> decoder) : Decoder(decoder)
|
OpenAL_SoundStream(std::auto_ptr<Sound_Decoder> decoder);
|
||||||
|
virtual ~OpenAL_SoundStream();
|
||||||
|
|
||||||
|
virtual bool Play();
|
||||||
|
virtual void Stop();
|
||||||
|
virtual bool isPlaying();
|
||||||
|
};
|
||||||
|
|
||||||
|
OpenAL_SoundStream::OpenAL_SoundStream(std::auto_ptr<Sound_Decoder> decoder)
|
||||||
|
: Decoder(decoder)
|
||||||
{
|
{
|
||||||
throwALerror();
|
throwALerror();
|
||||||
|
|
||||||
@ -84,8 +93,8 @@ public:
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
int srate;
|
int srate;
|
||||||
enum Sound_Decoder::ChannelConfig chans;
|
Sound_Decoder::ChannelConfig chans;
|
||||||
enum Sound_Decoder::SampleType type;
|
Sound_Decoder::SampleType type;
|
||||||
|
|
||||||
Decoder->GetInfo(&srate, &chans, &type);
|
Decoder->GetInfo(&srate, &chans, &type);
|
||||||
Format = getALFormat(chans, type);
|
Format = getALFormat(chans, type);
|
||||||
@ -99,7 +108,7 @@ public:
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual ~OpenAL_SoundStream()
|
OpenAL_SoundStream::~OpenAL_SoundStream()
|
||||||
{
|
{
|
||||||
alDeleteSources(1, &Source);
|
alDeleteSources(1, &Source);
|
||||||
alDeleteBuffers(NumBuffers, Buffers);
|
alDeleteBuffers(NumBuffers, Buffers);
|
||||||
@ -107,7 +116,7 @@ public:
|
|||||||
Decoder->Close();
|
Decoder->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool Play()
|
bool OpenAL_SoundStream::Play()
|
||||||
{
|
{
|
||||||
std::vector<char> data(BufferSize);
|
std::vector<char> data(BufferSize);
|
||||||
|
|
||||||
@ -130,7 +139,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Stop()
|
void OpenAL_SoundStream::Stop()
|
||||||
{
|
{
|
||||||
alSourceStop(Source);
|
alSourceStop(Source);
|
||||||
alSourcei(Source, AL_BUFFER, 0);
|
alSourcei(Source, AL_BUFFER, 0);
|
||||||
@ -138,7 +147,7 @@ public:
|
|||||||
// FIXME: Rewind decoder
|
// FIXME: Rewind decoder
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool isPlaying()
|
bool OpenAL_SoundStream::isPlaying()
|
||||||
{
|
{
|
||||||
ALint processed, state;
|
ALint processed, state;
|
||||||
|
|
||||||
@ -181,7 +190,6 @@ public:
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
bool OpenAL_Output::Initialize(const std::string &devname)
|
bool OpenAL_Output::Initialize(const std::string &devname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user