mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Rename some Sound class member functions
This commit is contained in:
parent
403e51cef3
commit
1965b5bc79
3 changed files with 16 additions and 20 deletions
|
@ -93,10 +93,10 @@ public:
|
|||
OpenAL_SoundStream(DecoderPtr decoder);
|
||||
virtual ~OpenAL_SoundStream();
|
||||
|
||||
void Play(float volume, float pitch);
|
||||
virtual void Stop();
|
||||
void play(float volume, float pitch);
|
||||
virtual void stop();
|
||||
virtual bool isPlaying();
|
||||
virtual void Update(const float *pos);
|
||||
virtual void update(const float *pos);
|
||||
};
|
||||
|
||||
class OpenAL_Sound : public Sound
|
||||
|
@ -108,9 +108,9 @@ public:
|
|||
OpenAL_Sound(ALuint src, ALuint buf);
|
||||
virtual ~OpenAL_Sound();
|
||||
|
||||
virtual void Stop();
|
||||
virtual void stop();
|
||||
virtual bool isPlaying();
|
||||
virtual void Update(const float *pos);
|
||||
virtual void update(const float *pos);
|
||||
};
|
||||
|
||||
|
||||
|
@ -159,7 +159,7 @@ OpenAL_SoundStream::~OpenAL_SoundStream()
|
|||
mDecoder->close();
|
||||
}
|
||||
|
||||
void OpenAL_SoundStream::Play(float volume, float pitch)
|
||||
void OpenAL_SoundStream::play(float volume, float pitch)
|
||||
{
|
||||
std::vector<char> data(sBufferSize);
|
||||
|
||||
|
@ -182,7 +182,7 @@ void OpenAL_SoundStream::Play(float volume, float pitch)
|
|||
throwALerror();
|
||||
}
|
||||
|
||||
void OpenAL_SoundStream::Stop()
|
||||
void OpenAL_SoundStream::stop()
|
||||
{
|
||||
alSourceStop(mSource);
|
||||
alSourcei(mSource, AL_BUFFER, 0);
|
||||
|
@ -234,7 +234,7 @@ bool OpenAL_SoundStream::isPlaying()
|
|||
return true;
|
||||
}
|
||||
|
||||
void OpenAL_SoundStream::Update(const float *pos)
|
||||
void OpenAL_SoundStream::update(const float *pos)
|
||||
{
|
||||
alSource3f(mSource, AL_POSITION, pos[0], pos[2], -pos[1]);
|
||||
alSource3f(mSource, AL_DIRECTION, 0.0f, 0.0f, 0.0f);
|
||||
|
@ -254,7 +254,7 @@ OpenAL_Sound::~OpenAL_Sound()
|
|||
alGetError();
|
||||
}
|
||||
|
||||
void OpenAL_Sound::Stop()
|
||||
void OpenAL_Sound::stop()
|
||||
{
|
||||
alSourceStop(mSource);
|
||||
throwALerror();
|
||||
|
@ -270,7 +270,7 @@ bool OpenAL_Sound::isPlaying()
|
|||
return state==AL_PLAYING;
|
||||
}
|
||||
|
||||
void OpenAL_Sound::Update(const float *pos)
|
||||
void OpenAL_Sound::update(const float *pos)
|
||||
{
|
||||
alSource3f(mSource, AL_POSITION, pos[0], pos[2], -pos[1]);
|
||||
alSource3f(mSource, AL_DIRECTION, 0.0f, 0.0f, 0.0f);
|
||||
|
@ -427,7 +427,7 @@ Sound* OpenAL_Output::streamSound(const std::string &fname, float volume, float
|
|||
decoder->open(fname);
|
||||
|
||||
sound.reset(new OpenAL_SoundStream(decoder));
|
||||
sound->Play(volume, pitch);
|
||||
sound->play(volume, pitch);
|
||||
|
||||
return sound.release();
|
||||
}
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
#ifndef GAME_SOUND_SOUND_H
|
||||
#define GAME_SOUND_SOUND_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
namespace MWSound
|
||||
{
|
||||
class Sound
|
||||
{
|
||||
virtual void Stop() = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual bool isPlaying() = 0;
|
||||
virtual void Update(const float *pos) = 0;
|
||||
virtual void update(const float *pos) = 0;
|
||||
|
||||
public:
|
||||
virtual ~Sound() { }
|
||||
|
|
|
@ -159,14 +159,14 @@ namespace MWSound
|
|||
void SoundManager::stopMusic()
|
||||
{
|
||||
if(mMusic)
|
||||
mMusic->Stop();
|
||||
mMusic->stop();
|
||||
setPlaylist();
|
||||
}
|
||||
|
||||
void SoundManager::streamMusicFull(const std::string& filename)
|
||||
{
|
||||
if(mMusic)
|
||||
mMusic->Stop();
|
||||
mMusic->stop();
|
||||
mMusic.reset(mOutput->streamSound(filename, 0.4f, 1.0f));
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ namespace MWSound
|
|||
while(iditer != snditer->second.end())
|
||||
{
|
||||
const ESM::Position &pos = ptr.getCellRef().pos;
|
||||
iditer->second->Update(pos.pos);
|
||||
iditer->second->update(pos.pos);
|
||||
iditer++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue