本文整理汇总了C++中SoundFile::SetCompleteVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundFile::SetCompleteVolume方法的具体用法?C++ SoundFile::SetCompleteVolume怎么用?C++ SoundFile::SetCompleteVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundFile
的用法示例。
在下文中一共展示了SoundFile::SetCompleteVolume方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadMusic
void AudioManager::LoadMusic(
const tstring& path,
const tstring& name,
float32 volume,
uint8 channel
)
{
Logger::GetInstance()->Log(mSoundService != nullptr,
_T("Sound Service is invalid."), STARENGINE_LOG_TAG);
if(mMusicList.find(name) != mMusicList.end())
{
Logger::GetInstance()->Log(LogLevel::Warning,
_T("Sound Service: The music file '") + name +
_T("' is already loaded."), STARENGINE_LOG_TAG);
return;
}
auto pathit = mMusicPathList.find(path);
if(pathit != mMusicPathList.end())
{
star::Logger::GetInstance()->Log(LogLevel::Warning,
_T("Sound Service : Sound File Path Already Exists"),
STARENGINE_LOG_TAG);
tstring nameold = pathit->second;
auto nameit = mMusicList.find(nameold);
if(nameit != mMusicList.end())
{
star::Logger::GetInstance()->Log(LogLevel::Warning,
_T("Sound Service: Found sound file of old path, making copy for new name"),
STARENGINE_LOG_TAG);
mMusicList[name] = nameit->second;
return;
}
mMusicPathList.erase(pathit);
return;
}
SoundFile* music = new SoundFile(path, channel);
music->SetCompleteVolume(
volume,
GetChannelVolume(channel),
GetVolume()
);
mMusicList[name] = music;
mMusicPathList[path] = name;
return;
}