Esempio n. 1
0
Grid::Cleanup::~Cleanup() {
	
	std::lock_guard<std::mutex> gaurd(Grid::s_mutex);
	delete Grid::s_instance;
	Grid::s_instance = nullptr;

}
Esempio n. 2
0
nuiSound* nuiSoundManager::GetSound(const nglPath& rPath, nuiSound::Type type)
{
  nglCriticalSectionGuard gaurd(mCS);
  nglString ID = nuiSound::GetStringID(rPath, type);
  SoundMap::iterator it = mSounds.find(ID);
  if (it != mSounds.end())
  {
    nuiSound* pSound = it->second;
    return pSound;
  }
  
  nuiSound* pSound = NULL;
  
  switch (type) 
  {
    case nuiSound::eStream:
      pSound = new nuiFileSound(rPath);
      break;
      
    case nuiSound::eMemory:
      pSound = new nuiMemorySound(rPath);
      break;
      
    default:
      NGL_ASSERT(0);
      break;
  }
  
  mSounds[ID] = pSound;
  return pSound;
}
Esempio n. 3
0
nuiSynthSound* nuiSoundManager::GetSynthSound()
{
  nglCriticalSectionGuard gaurd(mCS);
  nuiSynthSound* pSound = new nuiSynthSound();
  nglString ID = pSound->GetID();
  mSounds[ID] = pSound;
  
  return pSound;
}
Esempio n. 4
0
nuiSound* nuiSoundManager::GetSound(const nglString& rSoundID, nglIStream* pStream)
{
  nglCriticalSectionGuard gaurd(mCS);
  nglString ID = rSoundID;
  SoundMap::iterator it = mSounds.find(ID);
  if (it != mSounds.end())
  {
    nuiSound* pSound = it->second;
    delete pStream;
    return pSound;
  }
  
  nuiSound* pSound = NULL;
  pSound = new nuiMemorySound(rSoundID, pStream);

  mSounds[ID] = pSound;
  return pSound;
}