本文整理汇总了C++中SoundChannel::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundChannel::stop方法的具体用法?C++ SoundChannel::stop怎么用?C++ SoundChannel::stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundChannel
的用法示例。
在下文中一共展示了SoundChannel::stop方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void SoundDevice::update(float timeElapsed)
{
std::vector<SoundChannel*>::iterator it = m_activeChannels.begin();
while(it != m_activeChannels.end())
{
SoundChannel* channel = *it;
if (channel->isPlaying() == false)
{
++it;
continue;
}
channel->update();
if (channel->getActiveBuffersCount() < m_numBuffersUsed)
{
channel->loadNextSample();
}
if (channel->getActiveBuffersCount() == 0)
{
channel->stop();
it = m_activeChannels.erase(it);
delete channel;
}
else
{
++it;
}
}
}
示例2: test_loadPlayWithFade
void test_loadPlayWithFade()
{
xtime xt;
Ogre::ResourceManager::ResourceMapIterator it =
SoundManager::getSingleton().getResourceIterator();
while (it.hasMoreElements())
{
SoundResourcePtr soundres = it.getNext();
SoundStream *sound = new SoundStream(soundres);
SoundChannel *channel = new SoundChannel(sound, soundres->getName());
if (channel)
{
channel->play();
xtime_get(&xt, boost::TIME_UTC);
xt.sec += 10;
thread::sleep(xt);
channel->stop();
xtime_get(&xt, boost::TIME_UTC);
xt.sec += 5;
thread::sleep(xt);
}
}
CPPUNIT_ASSERT(true);
}
示例3: releaseAllChannels
void SoundDevice::releaseAllChannels()
{
while(m_activeChannels.size() > 0)
{
SoundChannel* channel = m_activeChannels.back();
channel->stop();
delete channel;
m_activeChannels.pop_back();
}
}
示例4:
/**
* @author JoSch
* @date 03-11-2005
*/
SoundObject::~SoundObject()
{
if (mMovableObject)
{
SoundChannel *sc = dynamic_cast<SoundChannel*>(mMovableObject);
if (sc)
{
sc->stop();
}
delete mMovableObject;
}
}
示例5: stop
void SoundPool::stop(int channelID)
{
ALOGV("stop(%d)", channelID);
Mutex::Autolock lock(&mLock);
SoundChannel* channel = findChannel(channelID);
if (channel) {
channel->stop();
} else {
channel = findNextChannel(channelID);
if (channel)
channel->clearNextEvent();
}
}
示例6: run
int SoundPool::run()
{
mRestartLock.lock();
while (!mQuit) {
mCondition.wait(mRestartLock);
ALOGV("awake");
if (mQuit) break;
while (!mStop.empty()) {
SoundChannel* channel;
ALOGV("Getting channel from stop list");
List<SoundChannel* >::iterator iter = mStop.begin();
channel = *iter;
mStop.erase(iter);
mRestartLock.unlock();
if (channel != 0) {
Mutex::Autolock lock(&mLock);
channel->stop();
}
mRestartLock.lock();
if (mQuit) break;
}
while (!mRestart.empty()) {
SoundChannel* channel;
ALOGV("Getting channel from list");
List<SoundChannel*>::iterator iter = mRestart.begin();
channel = *iter;
mRestart.erase(iter);
mRestartLock.unlock();
if (channel != 0) {
Mutex::Autolock lock(&mLock);
channel->nextEvent();
}
mRestartLock.lock();
if (mQuit) break;
}
}
mStop.clear();
mRestart.clear();
mCondition.signal();
mRestartLock.unlock();
ALOGV("goodbye");
return 0;
}