本文整理汇总了C++中SoundPtr::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundPtr::stop方法的具体用法?C++ SoundPtr::stop怎么用?C++ SoundPtr::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundPtr
的用法示例。
在下文中一共展示了SoundPtr::stop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stopSound
void SoundManager::stopSound(const std::string& soundId)
{
IDMap::iterator it = mLoopedSounds.find(soundId);
if(it != mLoopedSounds.end())
{
SoundPtr snd = it->second.lock();
if(snd) snd->stop();
mLoopedSounds.erase(it);
}
}
示例2: actionPerformed
virtual void actionPerformed(const ActionEventPtr e)
{
TutorialSound->stop(TutorialSoundChannelID);
std::cout << "Stop Action" << std::endl;
NodePtr s = makeTorus(.5, 2, 16, 16);
beginEditCP(scene, Node::ChildrenFieldMask);
while(scene->getNChildren() > 0)
{
scene->subChild(scene->getNChildren()-1);
}
scene->addChild(s);
endEditCP(scene, Node::ChildrenFieldMask);
segUpdate = 0;
}
示例3: clearAll
// Clears all the sub-elements of a given iterator, and then
// removes it from 'sounds'.
void clearAll(PtrMap::iterator it)
{
IDMap::iterator sit = it->second.begin();
while(sit != it->second.end())
{
// Get sound pointer, if any
SoundPtr snd = sit->second.lock();
// Stop the sound
if(snd) snd->stop();
sit++;
}
// Remove the ptr reference
sounds.erase(it);
}
示例4: remove
// Stop a sound and remove it from the list. If id="" then
// remove the entire object and stop all its sounds.
void remove(MWWorld::Ptr ptr, const std::string &id = "")
{
PtrMap::iterator it = sounds.find(ptr);
if(it != sounds.end())
{
if(id == "")
// Kill all references to 'ptr'
clearAll(it);
else
{
// Only find the id we're looking for
IDMap::iterator it2 = it->second.find(id);
if(it2 != it->second.end())
{
// Stop the sound and remove it from the list
SoundPtr snd = it2->second.lock();
if(snd) snd->stop();
it->second.erase(it2);
}
}
}
}