您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ stopMusic函数代码示例

51自学网 2021-06-03 08:24:08
  C++
这篇教程C++ stopMusic函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中stopMusic函数的典型用法代码示例。如果您正苦于以下问题:C++ stopMusic函数的具体用法?C++ stopMusic怎么用?C++ stopMusic使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了stopMusic函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: color_abc

bool DrasculaEngine::confirmExit() {	byte key = 0;	color_abc(kColorRed);	updateRoom();	centerText(_textsys[1], 160, 87);	updateScreen();	delay(100);	while (!shouldQuit()) {		key = getScan();		if (key != 0)			break;		// This gives a better feedback to the user when he is asked to		// confirm whether he wants to quit. It now still updates the room and		// shows mouse cursor movement. Hopefully it will work in all		// locations of the game.		updateRoom();		color_abc(kColorRed);		centerText(_textsys[1], 160, 87);		updateScreen();	}	if (key == Common::KEYCODE_ESCAPE || shouldQuit()) {		stopMusic();		return false;	}	return true;}
开发者ID:olegtc,项目名称:scummvm,代码行数:31,


示例2: _index

cGame::~cGame(){	int playerindex = _index(_pplayer);	if (playerindex == cBiota::NOINDEX) //player won't be deleted by cBiota destructor	{		delete _pplayer; /* I need to do this while the _pbiota is still good,			as the delete _pplayer will call the ~cCritter, which will use			_pbiota to find the pgame to call fixPointerRefs with. */		_pplayer = NULL;	}	delete _pskybox;	_pskybox = NULL;	delete _pbiota;	_pbiota = NULL;	delete _pcollider;	_pcollider = NULL;	delete _pcontroller;	_pcontroller = NULL;	delete _plightingmodel;	_plightingmodel = NULL;/* At game exit, we release any of the shared cSpriteQuake model resources that we'veallocated from within the quakeMD2model.cpp file. I might have expected todo this in the ~PopApp destructor in pop.cpp, but for some reason when Iget to that destructor, the information in the two static _map... fields has beenlost track of without being deleted. */	cTextureInfo::_mapFilenameToTextureInfo.free();	cMD2Model::_mapFilenameToMD2Info.free();	stopMusic();}
开发者ID:jstty,项目名称:OlderProjects,代码行数:29,


示例3: initSoundEngine

void SoundProcessor::setSoundConfiguration(const boost::shared_ptr<const SoundConfiguration> soundConfiguration){	this->soundConfiguration = soundConfiguration;	// ------ SOUND ENGINE -------	if((soundConfiguration->isSound() || soundConfiguration->isMusic()) && (!soundInitialized))	{		try {			initSoundEngine();		} catch(SDLException e) {			soundInitialized = false;			toInfoLog(TextStorage::instance().get(IDS::START_INIT_NOSOUND_TEXT_ID)->getText());		}	} else if(!soundConfiguration->isSound() && !soundConfiguration->isMusic() && soundInitialized) {		// sound was deactivated		releaseSoundEngine();	} else 		if(!soundInitialized) {			if(!soundConfiguration->isMusic()) {				stopMusic();			}			if(soundConfiguration->isSound()) {				process();			} else {				clearSoundChannels();			}#ifdef _FMOD_SOUND			soundEngine->update();#endif		}		clearSoundsToPlay();}
开发者ID:LodePublishing,项目名称:GUI,代码行数:33,


示例4: IGLog

void Sounds::startMusicGameplay() {	if(Settings::getInstance()->musicEnabled == false)		return;	if(s3eIOSBackgroundMusicAvailable() == S3E_TRUE)		if(s3eIOSBackgroundMusicGetInt(S3E_IOSBACKGROUNDMUSIC_PLAYBACK_STATE) == S3E_IOSBACKGROUNDMUSIC_PLAYBACK_PLAYING)			return;	IGLog("Sounds starting gameplay music");		// if gameplay music is already playing, only change song if it's been playing for a full minute	if(gameplayPlaying) {		if(s3eTimerGetMs() - gameplayStart <= 60000)			return;	}	gameplayPlaying = true;	gameplayStart = s3eTimerGetMs();	stopMusic();	char buffer[100];	int randomSong = gameplayMusicNum;	while(randomSong == gameplayMusicNum)		randomSong = rand()%3;	switch(randomSong) {		default:		case 0: sprintf(buffer, "gameplay1.mp3"); break;		case 1: sprintf(buffer, "gameplay2.mp3"); break;		case 2: sprintf(buffer, "gameplay3.mp3"); break;	}	if(s3eAudioIsCodecSupported(S3E_AUDIO_CODEC_MP3))		s3eAudioPlay(buffer, 0);}
开发者ID:ppiecuch,项目名称:Skeleton-Key-Marmalade,代码行数:31,


示例5: save_click_cb

static void save_click_cb( button_t *button, void *userdata ){    check_assertion( userdata == NULL, "userdata is not null" );    cur_sound = listbox_get_current_item( sound_listbox );    int snd = *((int*) get_list_elem_data( cur_sound ));    cur_video = listbox_get_current_item( video_listbox );    int vid = *((int*) get_list_elem_data( cur_video ));    setparam_sound_enabled(snd);    if (getparam_music_enabled() == 1 && snd == 0)        stopMusic();    setparam_music_enabled (snd);        saveparamSoundEnabled(snd);    setparam_video_quality (vid);    set_video_quality(vid);    saveparamVideoQuality(vid);        set_game_mode( GAME_TYPE_SELECT );        ui_set_dirty();}
开发者ID:XiaZhang0414,项目名称:TuxRider,代码行数:27,


示例6: stopAll

	void stopAll() {		for (int i = 0; i < 4; ++i) {			stopSound(i);		}		stopMusic();		stopSfxMusic();	}
开发者ID:vanfanel,项目名称:rawgl,代码行数:7,


示例7: stopMusic

/** * Play music. * @param file path to music file (i.e. *.ogg) * @param finished send this message when music is finished. * If finished is NULL, play music forever. */voidSDLSoundAgent::playMusic(const Path &file,        BaseMsg *finished){    // The same music is not restarted when it is not needed.    if (m_playingPath == file.getPosixName()            && ms_finished == NULL && finished == NULL) {        return;    }    stopMusic();    m_playingPath = file.getPosixName();    if (finished) {        ms_finished = finished;        m_music = Mix_LoadMUS(file.getNative().c_str());        if (m_music && (0 == Mix_PlayMusic(m_music, 1))) {            Mix_HookMusicFinished(musicFinished);        }        else {            LOG_WARNING(ExInfo("cannot play music")                    .addInfo("music", file.getNative())                    .addInfo("Mix", Mix_GetError()));        }    }    else {        m_looper = new SDLMusicLooper(file);        m_looper->setVolume(m_musicVolume);        m_looper->start();    }}
开发者ID:Toast442,项目名称:FilletsNG,代码行数:37,


示例8: initTitleAtr

int initTitleAtr() {  stopMusic();  titleCnt = 0;  slcStg = hiScore.stage;  mnp = 0;  return slcStg;}
开发者ID:kazuya-watanabe,项目名称:noiz2sa,代码行数:7,


示例9: stopMusic

    bool AudioHandler::setMusic(const std::string& musicKey)    {        //Set current music playing.        stopMusic();        if(musicList.find(musicKey) == musicList.end())        {            std::cout << "Music not found";            return true;        }        if(song != NULL) safeDelete(song);        song = new sbe::Music();        if(!song->OpenFromFile(musicList[musicKey]))        {            Logger::writeMsg(1) << "Music could not be loaded!";            safeDelete(song);            return true;        }        song->SetVolume(mVol);        song->Initialize(2, 44100);        song->Play();        Logger::writeMsg(1) << "Music /"" << musicKey << "/" now playing.";        return false;    }
开发者ID:Liag,项目名称:shmup-base-engine,代码行数:26,


示例10: closeAudio

/** * Stop audio. */void closeAudio () {	int count;	stopMusic();#ifdef USE_XMP	xmp_free_context(xmpC);#endif	SDL_CloseAudio();	if (rawSounds) {		for (count = 0; count < nRawSounds; count++) {			delete[] rawSounds[count].data;			delete[] rawSounds[count].name;		}		delete[] rawSounds;	}	if (sounds) {		freeSounds();		delete[] sounds;	}	return;}
开发者ID:przemub,项目名称:openjazz,代码行数:38,


示例11: debugC

bool Music::loadSong(int songNumber) {	debugC(kDebugLevelMusic, "Music: loadSong()");	if(songNumber == 100)		songNumber = 55;	else if(songNumber == 70)		songNumber = 54;	if((songNumber > 60) || (songNumber < 1))		return false;	songNumber = ROOM_SONG[songNumber];	if(songNumber == 0)		songNumber = 12;	if((songNumber > NUM_SONGS) || (songNumber < 1))		return false;	Common::String songName = Common::String(SONG_NAMES[songNumber - 1]);	freeSong();  // free any song that is currently loaded	stopMusic();	if (!playMusic(songName))		return false;	startSong();	return true;}
开发者ID:mdtrooper,项目名称:scummvm,代码行数:30,


示例12: stopMusic

void UIWindow::startMusic (){	if (!_musicFile.empty())		_music = SoundControl.playMusic(_musicFile);	else		stopMusic();}
开发者ID:ptitSeb,项目名称:caveexpress,代码行数:7,


示例13: stopMusic

void AudioManagerImpl::playMusic(MusicName musicName){	stopMusic();	auto music = MusicFilenames.find(musicName);	if (music == MusicFilenames.end())	{		Debug::mention("Audio Manager", "Failed to lookup music ID " +			std::to_string(static_cast<int>(musicName)) + ".");		mCurrentSong = nullptr;	}	else if (!mFreeSources.empty())	{		if (MidiDevice::isInited())			mCurrentSong = MidiDevice::get().open(music->second);		if (!mCurrentSong)		{			Debug::mention("Audio Manager", "Failed to play " + music->second + ".");			return;		}		mSongStream.reset(new OpenALStream(this, mCurrentSong.get()));		if (mSongStream->init(mFreeSources.front(), mMusicVolume))		{			mFreeSources.pop_front();			mSongStream->play();			Debug::mention("Audio Manager", "Playing music " + music->second + ".");		}		else			Debug::mention("Audio Manager", "Failed to init song stream.");	}}
开发者ID:kcat,项目名称:OpenTESArena,代码行数:32,


示例14: stopMusic

MidiPlayer::~MidiPlayer() {	_driver->setTimerCallback(NULL, NULL);	_parser->setMidiDriver(NULL);	stopMusic();	close();	delete _parser;	delete _midiData;}
开发者ID:havlenapetr,项目名称:Scummvm,代码行数:8,


示例15: stopMusic

void Mixer::close(){    stopMusic();    freeSounds();    Mix_CloseAudio();    Mix_Quit();}
开发者ID:argontus,项目名称:3S3K3D,代码行数:8,


示例16: stopMusic

// ***************************************************************************void		CMusicSoundManager::enable(bool enable){	// if disabled, stop any music (without any fade)	if(!enable)		stopMusic(false);	_Enabled= enable;}
开发者ID:mixxit,项目名称:solinia,代码行数:9,


示例17: stopMusic

    void SoundManager::clear()    {        for (SoundMap::iterator iter (mActiveSounds.begin()); iter!=mActiveSounds.end(); ++iter)            iter->first->stop();        mActiveSounds.clear();        stopMusic();    }
开发者ID:poweryang1,项目名称:openmw,代码行数:8,


示例18: stopMusic

AmigaSoundMan_ns::~AmigaSoundMan_ns() {	stopMusic();	stopSfx(0);	stopSfx(1);	stopSfx(2);	stopSfx(3);	delete []beepSoundBuffer;}
开发者ID:peres,项目名称:scummvm,代码行数:9,


示例19: endGame

/* ends the game*/void endGame() {    gamePaused = 0x01;                  // pauses the game    stopMusic();                        // stops the music    gameOver(displayField);             // shows the Game Over field    rollNumber('l', level, 10, 1000);   // display the level    rollNumber('p', score, 10, 1000);   // displays the score    gamePaused = 0x00;                  // unpuse the game}
开发者ID:marcosvalter,项目名称:ArduinoTetris,代码行数:10,


示例20: stopMusic

void Title::play() {	SEQFile::play(true, 0xFFFF, 15);	// After playback, fade out and stop the music	if (!_vm->shouldQuit())		_vm->_palAnim->fade(0, 0, 0);	stopMusic();}
开发者ID:33d,项目名称:scummvm,代码行数:9,


示例21: stopMusic

SoundService::~SoundService(){	stopMusic();	Mix_FreeMusic(_music);	for (auto c : _chunks)	{		Mix_FreeChunk(c.second);	}}
开发者ID:TinyMan,项目名称:warfare-of-heroes,代码行数:9,


示例22: lock

void Player_AD::startSound(int sound) {	Common::StackLock lock(_mutex);	// Setup the sound volume	setupVolume();	// Query the sound resource	const byte *res = _vm->getResourceAddress(rtSound, sound);	assert(res);	if (res[2] == 0x80) {		// Stop the current sounds		stopMusic();		// Lock the new music resource		_musicResource = sound;		_vm->_res->lock(rtSound, _musicResource);		// Start the new music resource		_musicData = res;		startMusic();	} else {		const byte priority = res[0];		// The original specified the channel to use in the sound		// resource. However, since we play as much as possible we sill		// ignore it and simply use the priority value to determine		// whether the sfx can be played or not.		//const byte channel  = res[1];		// Try to allocate a sfx slot for playback.		SfxSlot *sfx = allocateSfxSlot(priority);		if (!sfx) {			::debugC(3, DEBUG_SOUND, "AdLib: No free sfx slot for sound %d", sound);			return;		}		// Try to start sfx playback		sfx->resource = sound;		sfx->priority = priority;		if (startSfx(sfx, res)) {			// Lock the new resource			_vm->_res->lock(rtSound, sound);		} else {			// When starting the sfx failed we need to reset the slot.			sfx->resource = -1;			for (int i = 0; i < ARRAYSIZE(sfx->channels); ++i) {				sfx->channels[i].state = kChannelStateOff;				if (sfx->channels[i].hardwareChannel != -1) {					freeHWChannel(sfx->channels[i].hardwareChannel);					sfx->channels[i].hardwareChannel = -1;				}			}		}	}}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:57,


示例23: stopMusic

//-----------------------------------------------------------------SDLSound::~SDLSound(){    stopMusic();    Mix_CloseAudio();    for (chunks_t::iterator i = m_chunks.begin(); i != m_chunks.end(); i++) {        Mix_FreeChunk(i->second);    }    SDL_QuitSubSystem(SDL_INIT_AUDIO);}
开发者ID:BackupTheBerlios,项目名称:netpanzer-svn,代码行数:11,


示例24: playMusic

	void playMusic(const char *path) {		stopMusic();		_music = Mix_LoadMUS(path);		if (_music) {			Mix_VolumeMusic(MIX_MAX_VOLUME / 2);			Mix_PlayMusic(_music, 0);		} else {			warning("Failed to load music '%s', %s", path, Mix_GetError());		}	}
开发者ID:vanfanel,项目名称:rawgl,代码行数:10,


示例25: freeSong

bool Music::loadSong(const Common::String &songName) {	freeSong();  // free any song that is currently loaded	stopMusic();	if (!playMusic(songName))		return false;	startSong();	return true;}
开发者ID:mdtrooper,项目名称:scummvm,代码行数:10,


示例26: testmusic

void testmusic(){	while(1){				playMusic();		for(int i=0;i<100000000;i++);			setMusicVolume(140);		for(int i=0;i<100000000;i++);		stopMusic();		for(int i=0;i<100000000;i++);	}}
开发者ID:JizhouZhang,项目名称:stm32f4-labs,代码行数:10,



注:本文中的stopMusic函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ stopPoolMining函数代码示例
C++ stopExecutor函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。