这篇教程C++ stopSound函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stopSound函数的典型用法代码示例。如果您正苦于以下问题:C++ stopSound函数的具体用法?C++ stopSound怎么用?C++ stopSound使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stopSound函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: stopSoundvoid AsScene3011Symbol::stopSymbolSound() { if (_isNoisy) { stopSound(1); } else { stopSound(0); }}
开发者ID:SinSiXX,项目名称:scummvm,代码行数:7,
示例2: getControllervoid LeprechaunSound::update(const GameTime& gameTime){ SoundComponent::update(gameTime); LeprechaunController& leprechaun = getController(); setEmitter(leprechaun.getPosition(), leprechaun.getForward(), Vector3::up); if (leprechaun.isBeginKick() || leprechaun.isBeginCaneAnimation() || leprechaun.isBeginHatAnimation()) play3DSound("hey"); if (leprechaun.isBeginCaneHit() || leprechaun.isBeginFly() || leprechaun.isBeginStoneHit()) play3DSound("punch"); if (!leprechaun.isLocal()) return; if (leprechaun.hasUsedItem()) { stopSound("yes hahaha"); playSound("yes hahaha"); //play3DSound("yes hahaha"); } if (leprechaun.hasCollectedItem()) { stopSound("door slamming"); playSound("door slamming"); //play3DSound("door slamming"); }}
开发者ID:steinbergerbernd,项目名称:Lucky-Leprechauns,代码行数:30,
示例3: stopSoundAmbientSoundsManager::~AmbientSoundsManager(){ for(int i = 0; i < NR_OF_THUNDER_SOUNDS; i++) { stopSound(m_thunderSounds[i]); deactivateSound(m_thunderSounds[i]); } for(int i = 0; i < NR_OF_SCREAM_SOUNDS; i++) { stopSound(m_screamSounds[i]); deactivateSound(m_screamSounds[i]); }}
开发者ID:qwexsugare,项目名称:Spelprojekt,代码行数:13,
示例4: blendFinishstatic void blendFinish(){ Entity *e; self->thinkTime--; if (self->thinkTime <= 0) { self->health = 0; stopSound(self->mental); playSoundToMap("sound/item/ping", -1, self->x, self->y, 0); e = addPermanentItem(self->requires, self->x + self->w / 2, self->y + self->h / 2); e->x -= e->w / 2; e->dirY = ITEM_JUMP_HEIGHT; self->action = &entityWait; setEntityAnimation(self, "ATTACK_1"); }}
开发者ID:LibreGames,项目名称:edgar,代码行数:25,
示例5: stopSound int Soloud::play(AudioSource &aSound, float aVolume, float aPan, int aPaused, int aBus) { if (aSound.mFlags & AudioSource::SINGLE_INSTANCE) { // Only one instance allowed, stop others stopSound(aSound); } if (mLockMutexFunc) mLockMutexFunc(mMutex); int ch = findFreeVoice(); if (ch < 0) { if (mUnlockMutexFunc) mUnlockMutexFunc(mMutex); return -1; } if (!aSound.mAudioSourceID) { aSound.mAudioSourceID = mAudioSourceID; mAudioSourceID++; aSound.mSoloud = this; } mVoice[ch] = aSound.createInstance(); mVoice[ch]->mAudioSourceID = aSound.mAudioSourceID; mVoice[ch]->mBusHandle = aBus; mVoice[ch]->init(mPlayIndex, aSound.mBaseSamplerate, aSound.mChannels, aSound.mFlags); mPlayIndex++; if (aPaused) { mVoice[ch]->mFlags |= AudioSourceInstance::PAUSED; } setVoicePan(ch, aPan); setVoiceVolume(ch, aVolume); setVoiceRelativePlaySpeed(ch, 1); int i; for (i = 0; i < FILTERS_PER_STREAM; i++) { if (aSound.mFilter[i]) { mVoice[ch]->mFilter[i] = aSound.mFilter[i]->createInstance(); } } int scratchneeded = SAMPLE_GRANULARITY * mVoice[ch]->mChannels; mVoice[ch]->mResampleData[0]->mBuffer = new float[scratchneeded]; mVoice[ch]->mResampleData[1]->mBuffer = new float[scratchneeded]; // First buffer will be overwritten anyway; the second may be referenced by resampler memset(mVoice[ch]->mResampleData[0]->mBuffer, 0, sizeof(float) * scratchneeded); memset(mVoice[ch]->mResampleData[1]->mBuffer, 0, sizeof(float) * scratchneeded); if (mUnlockMutexFunc) mUnlockMutexFunc(mMutex); int handle = getHandleFromVoice(ch); return handle; }
开发者ID:djdduty,项目名称:LD29,代码行数:60,
示例6: riftWaitstatic void riftWait(){ self->thinkTime--; if (self->thinkTime <= 0) { stopSound(self->health); self->action = &riftClose; self->thinkTime = 20; } else { if (collision(self->x - self->mental, self->y - self->mental, self->mental * 2, self->mental * 2, player.x, player.y, player.w, player.h) == 1) { setCustomAction(&player, &attract, 5, 0, (player.x < (self->x + self->w / 2) ? 2 : -2)); } if (prand() % 3 == 0) { addRiftEnergy(self->x + self->w / 2, self->y + self->h / 2); } }}
开发者ID:LibreGames,项目名称:edgar,代码行数:26,
示例7: stopAll void stopAll() { for (int i = 0; i < 4; ++i) { stopSound(i); } stopMusic(); stopSfxMusic(); }
开发者ID:vanfanel,项目名称:rawgl,代码行数:7,
示例8: burnstatic void burn(){ self->action = &burn; setEntityAnimation(self, "JUMP"); self->thinkTime--; if (self->thinkTime <= 0) { if (self->startY == -1) { stopSound(self->startX); } self->frameSpeed = -1; setEntityAnimation(self, "WALK"); self->thinkTime = self->maxThinkTime; self->animationCallback = &entityWait; self->action = &burnWait; }}
开发者ID:LibreGames,项目名称:edgar,代码行数:26,
示例9: stopSoundvoid Object::playSound(const Common::UString &sound, bool pitchVariance) { stopSound(); if (sound.empty()) return; _sound = ::Engines::playSound(sound, Sound::kSoundTypeVoice, false, 1.0f, pitchVariance);}
开发者ID:ehalls,项目名称:xoreos,代码行数:7,
示例10: riftWaitstatic void riftWait(){ int x, y; self->thinkTime--; if (self->thinkTime <= 0 || self->head->health <= 0) { stopSound(self->health); self->action = &riftClose; self->thinkTime = 20; } else { x = self->x + self->w / 2; y = self->y + self->h / 2; if (collision(x - self->speed, y - self->speed, self->speed * 2, self->speed * 2, player.x, player.y, player.w, player.h) == 1) { setCustomAction(&player, &attract, 5, 0, (player.x < (self->x + self->w / 2) ? player.speed - 0.25 : -(player.speed - 0.25))); } if (prand() % 3 == 0) { addRiftEnergy(self->x + self->w / 2, self->y + self->h / 2); } } checkToMap(self);}
开发者ID:polluks,项目名称:edgar,代码行数:33,
示例11: playSoundstatic void playSound(void) { if (Machine->gamedrv->flags & GAME_NO_SOUND) return; if (atarilocals.sound & 0x02) { // noise on int i; for (i=0; i < sizeof(noiseWave); i++) noiseWave[i] = (UINT8)(rand() % 256); stopNoise(); mixer_set_volume(atarilocals.noisechannel, atarilocals.volume*4); mixer_play_sample(atarilocals.noisechannel, (signed char *)noiseWave, sizeof(noiseWave), ATARI_SNDFREQ / (16-atarilocals.frequency) * (1 << atarilocals.octave), 1); } if (atarilocals.sound & 0x01) { // wave on stopSound(); mixer_set_volume(atarilocals.channel, atarilocals.volume*4); if (atarilocals.waveform < 4) mixer_play_sample(atarilocals.channel, (signed char *)squareWave, sizeof(squareWave), 2 * ATARI_SNDFREQ / (16-atarilocals.frequency) * (1 << atarilocals.octave), 1); else if (atarilocals.waveform < 8) mixer_play_sample(atarilocals.channel, (signed char *)triangleWave, sizeof(triangleWave), 2 * ATARI_SNDFREQ / (16-atarilocals.frequency) * (1 << atarilocals.octave), 1); else if (atarilocals.waveform < 12) mixer_play_sample(atarilocals.channel, (signed char *)sineWave, sizeof(sineWave), 2 * ATARI_SNDFREQ / (16-atarilocals.frequency) * (1 << atarilocals.octave), 1); else mixer_play_sample(atarilocals.channel, (signed char *)sawtoothWave, sizeof(sawtoothWave), 2 * ATARI_SNDFREQ / (16-atarilocals.frequency) * (1 << atarilocals.octave), 1); }}
开发者ID:Bremma,项目名称:pinmame,代码行数:30,
示例12: flameWaitstatic void flameWait(){ if (self->face == RIGHT) { self->x = self->head->x + self->head->w; self->y = self->head->y + (self->head->mental == 1 ? self->head->offsetY : self->head->offsetX); } else { self->x = self->head->x - self->w; self->y = self->head->y + (self->head->mental == 0 ? self->head->offsetY : self->head->offsetX); } self->startX--; if (self->startX <= 0) { self->startX = 0; } self->thinkTime--; if (self->thinkTime <= 0 || self->head->health <= 0) { stopSound(self->endY); self->inUse = FALSE; }}
开发者ID:LibreGames,项目名称:edgar,代码行数:32,
示例13: disintegrationSpellAttackstatic void disintegrationSpellAttack(){ Entity *temp; self->thinkTime--; if (self->thinkTime <= 0) { self->head->mental = 0; self->inUse = FALSE; if (self->mental == 2) { /* Gib the player */ temp = self; self = &player; freeEntityList(playerGib()); self = temp; } stopSound(BOSS_CHANNEL); } self->endX = player.x + player.w / 2; self->endY = player.y + player.h / 2; self->x = self->endX; self->y = self->endY;}
开发者ID:revcozmo,项目名称:edgar,代码行数:34,
示例14: doFades void doFades(float dtime) { m_fade_delay += dtime; if (m_fade_delay < 0.1f) return; float chkGain = 0; for (std::unordered_map<int, FadeState>::iterator i = m_sounds_fading.begin(); i != m_sounds_fading.end();) { if (i->second.step < 0.f) chkGain = -(i->second.current_gain); else chkGain = i->second.current_gain; if (chkGain < i->second.target_gain) { i->second.current_gain += (i->second.step * m_fade_delay); i->second.current_gain = rangelim(i->second.current_gain, 0, 1); updateSoundGain(i->first, i->second.current_gain); ++i; } else { if (i->second.target_gain <= 0.f) stopSound(i->first); m_sounds_fading.erase(i++); } } m_fade_delay = 0; }
开发者ID:EXio4,项目名称:minetest,代码行数:30,
示例15: debugC/** * Start playing a sound resource. The logic here is that when the sound is * finished we set the given flag to be true. This way the condition can be * detected by the game. On the other hand, if the game wishes to start * playing a new sound before the current one is finished, we also let it * do that. * @param resnum the sound resource number * @param flag the flag that is wished to be set true when finished */void SoundMgr::startSound(int resnum, int flag) { debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d)", resnum, flag); if (_vm->_game.sounds[resnum] == NULL) // Is this needed at all? return; stopSound(); AgiSoundEmuType type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type(); if (type != AGI_SOUND_SAMPLE && type != AGI_SOUND_MIDI && type != AGI_SOUND_4CHN) return; debugC(3, kDebugLevelSound, " type = %d", type); _vm->_game.sounds[resnum]->play(); _playingSound = resnum; _soundGen->play(resnum); // Reset the flag _endflag = flag; if (_vm->getVersion() < 0x2000) { _vm->_game.vars[_endflag] = 0; } else { _vm->setFlag(_endflag, false); }}
开发者ID:letup,项目名称:scummvm,代码行数:35,
示例16: stopSoundbool CEnterSecClassState::StatusChangeMsg(CStatusChangeMsg *msg) { stopSound(_soundHandle); if (msg->_newStatus == _mode || (_mode == 2 && msg->_newStatus == 3)) { if (_mode == 2) { _soundHandle = queueSound("b#36.wav", _soundHandle); } else { _soundHandle = queueSound("b#31.wav", _soundHandle); } if (msg->_newStatus == 3) msg->_newStatus = 2; } else { changeView("SecClassLittleLift.Node 1.N"); if (msg->_newStatus == 1) { _soundHandle = queueSound("b#32.wav", _soundHandle); } else if (msg->_newStatus == 2) { _soundHandle = queueSound("b#25.wav", _soundHandle); } else if (msg->_newStatus == 3) { _soundHandle = queueSound("b#33.wav", _soundHandle); msg->_newStatus = 2; } } if (msg->_newStatus != 3) { if (msg->_newStatus == 2 && _mode == 1) playMovie(0, 10, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); else if (msg->_newStatus == 1) playMovie(11, 21, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); } _cursorId = msg->_newStatus == 2 ? CURSOR_MOVE_FORWARD : CURSOR_INVALID; _mode = msg->_newStatus; return true;}
开发者ID:86400,项目名称:scummvm,代码行数:34,
示例17: mainint main(){ int i = 0; PLL_Init(); SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); // 50 MHz DisableInterrupts(); SYSCTL_RCGC1_R |= SYSCTL_RCGC1_TIMER0;// activate timer0 SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOF+SYSCTL_RCGC2_GPIOG; // activate ports F and G Output_Init(); SysTick_InitSeconds(1); PolledButtons_Init(); EnableInterrupts(); displayMode = 0; ringAlarms = 0; timeMode = 0; while(1){ if (ringAlarms && !soundPlaying && (alarmActive || timeMode == 4)) { playSound(); } else if ((ringAlarms==0 || !alarmActive) && soundPlaying) { stopSound(); } if(displayMode==0) { displayClock(); } else if(displayMode==1){ displaySet(); } }}
开发者ID:glockwork,项目名称:EE445L,代码行数:31,
示例18: stopSoundvoid SoundMgr::startSound(int resnum, int flag) { AgiSoundEmuType type; if (_vm->_game.sounds[resnum] != NULL && _vm->_game.sounds[resnum]->isPlaying()) return; stopSound(); if (_vm->_game.sounds[resnum] == NULL) // Is this needed at all? return; type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type(); if (type != AGI_SOUND_SAMPLE && type != AGI_SOUND_MIDI && type != AGI_SOUND_4CHN) return; _vm->_game.sounds[resnum]->play(); _playingSound = resnum; debugC(3, kDebugLevelSound, "startSound(resnum = %d, flag = %d) type = %d", resnum, flag, type); _soundGen->play(resnum); _endflag = flag; // Nat Budin reports that the flag should be reset when sound starts _vm->setflag(_endflag, false);}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:28,
示例19: scytheMovestatic void scytheMove(){ if (self->face == LEFT) { if (self->dirX < 0 && self->x <= self->targetX) { self->dirX *= -1; } else if (self->dirX > 0 && self->x >= self->startX) { self->head->thinkTime = 0; if (self->head->mental == 0) { self->action = &scytheWait; self->touch = NULL; } stopSound(self->endX); } } else { if (self->dirX > 0 && self->x >= self->targetX) { self->dirX *= -1; } else if (self->dirX < 0 && self->x <= self->startX) { self->head->thinkTime = 0; if (self->head->mental == 0) { self->action = &scytheWait; self->touch = NULL; } stopSound(self->endX); } } checkToMap(self);}
开发者ID:LibreGames,项目名称:edgar,代码行数:46,
示例20: playSound void playSound(uint8_t channel, int volume, Mix_Chunk *chunk, int loops = 0) { stopSound(channel); if (chunk) { Mix_PlayChannel(channel, chunk, loops); } setChannelVolume(channel, volume); _sounds[channel] = chunk; }
开发者ID:vanfanel,项目名称:rawgl,代码行数:8,
示例21: qDebugvoid ReminderSettings::playSound() { qDebug( "ReminderSettings::playSound" ); // stop the previous sound to play another (or the same from beginning) stopSound(); m_sound = Phonon::createPlayer( Phonon::MusicCategory, Phonon::MediaSource( ui.soundPathEdit->text() ) ); m_sound->play();}
开发者ID:jajcek,项目名称:DoForMe,代码行数:8,
示例22: musicOffWLAudio::~WLAudio(){ musicOff(); stopSound(); free(m_digiList); delete m_soundServer;}
开发者ID:korbatit,项目名称:qtwolf3d,代码行数:8,
示例23: beamDisappearFinishstatic void beamDisappearFinish(){ self->head->mental = 0; self->inUse = FALSE; stopSound(self->targetX);}
开发者ID:LibreGames,项目名称:edgar,代码行数:8,
示例24: stopSoundbool Sound::loadSound( char *filename ) { stopSound(); sound = Mix_LoadWAV(filename); return true ;}
开发者ID:zephyrz4,项目名称:pongGame,代码行数:10,
示例25: stopSoundvoid Sound::playSoundSegment(uint32 start, uint32 end) { if (!isSoundLoaded()) return; stopSound(); Audio::AudioStream *subStream = new Audio::SubSeekableAudioStream(_stream, Audio::Timestamp(0, start, 600), Audio::Timestamp(0, end, 600), DisposeAfterUse::NO); g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_handle, subStream, -1, _volume, 0, DisposeAfterUse::YES);}
开发者ID:AlbanBedel,项目名称:scummvm,代码行数:10,
示例26: stopSoundvoid Sound::playLoadedSound(int bufNum, WaitType waitType) { if (IS_SERRATED_SCALPEL) { if (_mixer->isSoundHandleActive(_scalpelEffectsHandle) && (_curPriority > _vm->_scene->_sounds[bufNum]._priority)) return; stopSound(); } playSound(_vm->_scene->_sounds[bufNum]._name, waitType, _vm->_scene->_sounds[bufNum]._priority);}
开发者ID:djkimgo,项目名称:scummvm,代码行数:10,
示例27: playSoundvoid playSound(int sid,int repeat){ char cmdStr[32]; stopSound(sid); if(repeat) sprintf(cmdStr,"play S%d from 0 repeat",sid); else sprintf(cmdStr,"play S%d from 0",sid); mciSendStringA(cmdStr,NULL,0,NULL);}
开发者ID:Gnnng,项目名称:LaserTank,代码行数:10,
示例28: stopSoundint16 ScriptFunctions::sfClearScreen(int16 argc, int16 *argv) { if (_vm->_screen->isScreenLocked()) return 0; if (_vm->_autoStopSound) { stopSound(); _vm->_autoStopSound = false; } _vm->_screen->clearScreen(); return 0;}
开发者ID:project-cabal,项目名称:cabal,代码行数:10,
注:本文中的stopSound函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ stopThread函数代码示例 C++ stopServer函数代码示例 |