mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
add file notification to Mac ticket 514, also change name of class FileInfo to CFileInfo to ease Mac development
This was SVN commit r13821.
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#include "ISoundManager.h"
|
||||
#include "SoundManager.h"
|
||||
|
||||
#include "ps/Filesystem.h"
|
||||
|
||||
#include "soundmanager/data/SoundData.h"
|
||||
#include "soundmanager/items/CSoundItem.h"
|
||||
#include "soundmanager/items/CBufferItem.h"
|
||||
@@ -208,7 +210,8 @@ private:
|
||||
|
||||
void ISoundManager::CreateSoundManager()
|
||||
{
|
||||
g_SoundManager = new CSoundManager();
|
||||
if ( !g_SoundManager )
|
||||
g_SoundManager = new CSoundManager();
|
||||
}
|
||||
|
||||
void ISoundManager::SetEnabled(bool doEnable)
|
||||
@@ -217,7 +220,7 @@ void ISoundManager::SetEnabled(bool doEnable)
|
||||
{
|
||||
SAFE_DELETE(g_SoundManager);
|
||||
}
|
||||
else if ( ! g_SoundManager && doEnable )
|
||||
else if ( !g_SoundManager && doEnable )
|
||||
{
|
||||
ISoundManager::CreateSoundManager();
|
||||
}
|
||||
@@ -240,6 +243,18 @@ void CSoundManager::al_check(const char* caller, int line)
|
||||
al_ReportError(err, caller, line);
|
||||
}
|
||||
|
||||
Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path))
|
||||
{
|
||||
// LOGERROR(L"GUI file '%ls' changed - reloading page", path.string().c_str());
|
||||
|
||||
return INFO::OK;
|
||||
}
|
||||
|
||||
/*static*/ Status CSoundManager::ReloadChangedFileCB(void* param, const VfsPath& path)
|
||||
{
|
||||
return static_cast<CSoundManager*>(param)->ReloadChangedFiles(path);
|
||||
}
|
||||
|
||||
CSoundManager::CSoundManager()
|
||||
{
|
||||
m_CurrentEnvirons = 0;
|
||||
@@ -282,10 +297,14 @@ CSoundManager::CSoundManager()
|
||||
m_Worker = new CSoundManagerWorker();
|
||||
m_Worker->SetEnabled( true );
|
||||
}
|
||||
|
||||
RegisterFileReloadFunc(ReloadChangedFileCB, this);
|
||||
}
|
||||
|
||||
CSoundManager::~CSoundManager()
|
||||
{
|
||||
UnregisterFileReloadFunc(ReloadChangedFileCB, this);
|
||||
|
||||
if (m_Worker )
|
||||
{
|
||||
AL_CHECK
|
||||
@@ -649,11 +668,14 @@ void CSoundManager::PlayGroupItem(ISoundItem* anItem, ALfloat groupGain )
|
||||
|
||||
void CSoundManager::SetMusicEnabled (bool isEnabled)
|
||||
{
|
||||
LOGERROR(L"entering enabled area", isEnabled);
|
||||
|
||||
if (m_CurrentTune && !isEnabled)
|
||||
{
|
||||
m_CurrentTune->FadeAndDelete(1.00);
|
||||
m_CurrentTune = 0L;
|
||||
}
|
||||
LOGERROR(L"exiting enabled area", isEnabled);
|
||||
m_MusicEnabled = isEnabled;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user