本文整理汇总了C++中SoundPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundPtr::get方法的具体用法?C++ SoundPtr::get怎么用?C++ SoundPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundPtr
的用法示例。
在下文中一共展示了SoundPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SafeReadSound
SoundPtr ResourceConfig::SafeReadSound(StringParser &theVal)
{
theVal.SkipWhitespace();
SoundDescriptor aDesc;
std::string aName;
if(theVal.GetChar()=='(')
{
theVal.IncrementPos();
theVal.ReadString(aName); EnsureComma(theVal);
int aFlags = 0;
while(true)
{
std::string aFlagStr;
theVal.ReadString(aFlagStr,true);
if(aFlagStr.empty())
break;
if(stricmp(aFlagStr.c_str(),"Preload")==0)
aFlags |= SoundFlag_Preload;
else if(stricmp(aFlagStr.c_str(),"Music")==0)
aFlags |= SoundFlag_Music;
else if(stricmp(aFlagStr.c_str(),"Muted")==0)
aFlags |= SoundFlag_Muted;
else
throw ConfigObjectException("Unknown sound flag: " + aFlagStr);
}
aDesc.SetSoundFlags(aFlags,true);
EnsureCloseParen(theVal);
}
else
theVal.ReadString(aName);
aDesc.mFilePath = ComponentConfig::GetResourceFile(aName);
SoundPtr aSound = WindowManager::GetDefaultWindowManager()->DecodeSound(aDesc);
if(aSound.get()==NULL)
throw ConfigObjectException("Failed to decode sound: " + aDesc.mFilePath);
return aSound;
}