diff --git a/include/eepp/audio/csound.hpp b/include/eepp/audio/csound.hpp index 28605508a..77886927e 100755 --- a/include/eepp/audio/csound.hpp +++ b/include/eepp/audio/csound.hpp @@ -7,15 +7,15 @@ namespace EE { namespace Audio { -/** @enum EE_SOUND_STATE The state of the sound */ -enum EE_SOUND_STATE { - SOUND_STOPPED, - SOUND_PAUSED, - SOUND_PLAYING -}; - class EE_API cSound { public : + /** @enum EE_SOUND_STATE The state of the sound */ + enum Status { + Stopped, + Paused, + Playing + }; + cSound(); ~cSound(); @@ -81,10 +81,10 @@ class EE_API cSound { eeFloat Attenuation() const; /** Get the Sound State */ - EE_SOUND_STATE GetState() const; + Status GetState() const; /** Get the Sound State */ - EE_SOUND_STATE State() const; + Status State() const; /** Get the current playing position of the sound */ virtual Uint32 PlayingOffset() const; diff --git a/include/eepp/audio/csoundstream.hpp b/include/eepp/audio/csoundstream.hpp index 0bc998df6..2cb4a4735 100755 --- a/include/eepp/audio/csoundstream.hpp +++ b/include/eepp/audio/csoundstream.hpp @@ -34,9 +34,9 @@ class EE_API cSoundStream : private cThread, private cSound { unsigned int GetSampleRate() const; - EE_SOUND_STATE GetState() const; + Status GetState() const; - EE_SOUND_STATE State() const ; + Status State() const ; Uint32 PlayingOffset() const; diff --git a/include/eepp/audio/tsoundmanager.hpp b/include/eepp/audio/tsoundmanager.hpp index c07ac4c2d..cc9509d40 100755 --- a/include/eepp/audio/tsoundmanager.hpp +++ b/include/eepp/audio/tsoundmanager.hpp @@ -111,7 +111,7 @@ cSound& tSoundManager::GetFreeSound( const T& id ) { for ( Uint32 i = 0; i < tSize; i++ ) { // If there is a free slot, use it. - if ( tSound->Snd[i].GetState() != SOUND_PLAYING ) { + if ( tSound->Snd[i].GetState() != cSound::Playing ) { return tSound->Snd[i]; } } @@ -142,7 +142,7 @@ void tSoundManager::Play( const T& id ) { for ( Uint32 i = 0; i < tSize; i++ ) { // If there is a free slot, use it. - if ( tSound->Snd[i].GetState() != SOUND_PLAYING ) { + if ( tSound->Snd[i].GetState() != cSound::Playing ) { tSound->Snd[i].Play(); return; } diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 2ff1f9386..6044df898 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/projects/linux/ee.files b/projects/linux/ee.files index ee0bbe7bc..e133b5338 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -2,8 +2,6 @@ ../../include/eepp/audio/tsoundloader.hpp ../../include/eepp/audio/openal.hpp ../../include/eepp/audio/csoundstream.hpp -../../include/eepp/audio/csoundfileogg.hpp -../../include/eepp/audio/csoundfiledefault.hpp ../../include/eepp/audio/csoundfile.hpp ../../include/eepp/audio/csoundbuffer.hpp ../../include/eepp/audio/csound.hpp @@ -573,3 +571,5 @@ ../../src/eepp/physics/moment.cpp ../../src/eepp/physics/area.cpp ../../premake4.lua +../../src/eepp/audio/csoundfileogg.hpp +../../src/eepp/audio/csoundfiledefault.hpp diff --git a/src/eepp/audio/csound.cpp b/src/eepp/audio/csound.cpp index 6b1c5f0f2..22c9d8983 100755 --- a/src/eepp/audio/csound.cpp +++ b/src/eepp/audio/csound.cpp @@ -148,18 +148,18 @@ eeFloat cSound::Attenuation() const { return Attenuation; } -EE_SOUND_STATE cSound::GetState() const { +cSound::Status cSound::GetState() const { ALint State; ALCheck( alGetSourcei( mSource, AL_SOURCE_STATE, &State ) ); switch (State) { case AL_INITIAL : - case AL_STOPPED : return SOUND_STOPPED; - case AL_PAUSED : return SOUND_PAUSED; - case AL_PLAYING : return SOUND_PLAYING; + case AL_STOPPED : return cSound::Stopped; + case AL_PAUSED : return cSound::Paused; + case AL_PLAYING : return cSound::Playing; } - return SOUND_STOPPED; + return cSound::Stopped; } Uint32 cSound::PlayingOffset() const { @@ -216,7 +216,7 @@ void cSound::ResetBuffer() { mBuffer = NULL; } -EE_SOUND_STATE cSound::State() const { +cSound::Status cSound::State() const { return GetState(); } diff --git a/include/eepp/audio/csoundfiledefault.hpp b/src/eepp/audio/csoundfiledefault.hpp similarity index 100% rename from include/eepp/audio/csoundfiledefault.hpp rename to src/eepp/audio/csoundfiledefault.hpp diff --git a/include/eepp/audio/csoundfileogg.hpp b/src/eepp/audio/csoundfileogg.hpp similarity index 100% rename from include/eepp/audio/csoundfileogg.hpp rename to src/eepp/audio/csoundfileogg.hpp diff --git a/src/eepp/audio/csoundstream.cpp b/src/eepp/audio/csoundstream.cpp index 5463328df..995d78d77 100755 --- a/src/eepp/audio/csoundstream.cpp +++ b/src/eepp/audio/csoundstream.cpp @@ -68,13 +68,13 @@ unsigned int cSoundStream::GetSampleRate() const { return mSampleRate; } -EE_SOUND_STATE cSoundStream::GetState() const { - EE_SOUND_STATE Status = cSound::GetState(); +cSound::Status cSoundStream::GetState() const { + Status status = cSound::GetState(); - if ( ( Status == SOUND_STOPPED ) && mIsStreaming ) // To compensate for the lag between Play() and alSourcePlay() - Status = SOUND_PLAYING; + if ( ( status == cSound::Stopped ) && mIsStreaming ) // To compensate for the lag between Play() and alSourcePlay() + status = cSound::Playing; - return Status; + return status; } Uint32 cSoundStream::PlayingOffset() const { @@ -117,7 +117,7 @@ void cSoundStream::Run() { while ( mIsStreaming ) { // The stream has been interrupted ! - if ( cSound::GetState() == SOUND_STOPPED ) { + if ( cSound::GetState() == cSound::Stopped ) { // User requested to stop : finish the streaming loop if ( !RequestStop ) { cSound::Play(); @@ -165,7 +165,7 @@ void cSoundStream::Run() { } // Leave some time for the other threads if the stream is still playing - if ( cSound::GetState() != SOUND_STOPPED ) + if ( cSound::GetState() != cSound::Stopped ) Sys::Sleep(10); } @@ -244,7 +244,7 @@ void cSoundStream::ClearQueue() { ALCheck( alSourceUnqueueBuffers( cSound::mSource, 1, &Buffer ) ); } -EE_SOUND_STATE cSoundStream::State() const { +cSound::Status cSoundStream::State() const { return GetState(); } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 663d59c50..55367e7a8 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -1321,7 +1321,7 @@ void cEETest::Input() { mWindow->FrameRateLimit( 10 ); - if ( mMusEnabled && Mus->State() == SOUND_PLAYING ) + if ( mMusEnabled && Mus->State() == cSound::Playing ) Mus->Pause(); } else { @@ -1337,7 +1337,7 @@ void cEETest::Input() { mWindow->FrameRateLimit( mLastFPSLimit ); - if ( mMusEnabled && Mus->State() == SOUND_PAUSED ) + if ( mMusEnabled && Mus->State() == cSound::Paused ) Mus->Play(); }