• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Mix_PauseMusic函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: pause

	void pause()
	{
		// Pause all sound
		Mix_Pause(-1);

		// Pause music
		Mix_PauseMusic();
	}
开发者ID:icedman,项目名称:lov8,代码行数:8,代码来源:love_sdlmixer.cpp


示例2: Mix_ResumeMusic

void SoundBank::PauseOrResume() {
	if (Mix_PausedMusic()) {
		Mix_ResumeMusic();
	}
	else {
		Mix_PauseMusic();
	}
}
开发者ID:mjowned,项目名称:GameDev,代码行数:8,代码来源:SoundBank.cpp


示例3: Mix_PauseMusic

void GsMusic::pause(void)
{
    if (!Mix_PlayingMusic())
        return;
    if (Mix_PausedMusic())
        return;
    Mix_PauseMusic();
}
开发者ID:rxtsolar,项目名称:engine2d,代码行数:8,代码来源:sound.cpp


示例4: Mix_PauseMusic

	void Music::Pause()
	{
		if (Audio::GetInstance()->GetCurrentMusic() != this)
			return;

		if (Mix_PausedMusic() == 0)
			Mix_PauseMusic();
	}
开发者ID:SZSilence06,项目名称:THXYY,代码行数:8,代码来源:THMusic.cpp


示例5: Mix_PauseMusic

void SDL::pauseMusic()
{
    if (!(SDL::startedAudio))
        return;

    if (SDL::musicPlaying())
        Mix_PauseMusic();
}
开发者ID:alexdantas,项目名称:terminus,代码行数:8,代码来源:SDL.cpp


示例6: Mix_PauseMusic

void SoundManager::toggleSound() {
	notmute = !notmute;
	if(!notmute)
		Mix_PauseMusic();
	else if(Mix_PausedMusic())
		Mix_ResumeMusic();

}
开发者ID:dhagandev,项目名称:GTA2_BallGame,代码行数:8,代码来源:SoundManager.cpp


示例7: Mix_ResumeMusic

void GsMusic::toggle(void)
{
    if (!Mix_PlayingMusic())
        return;
    if (Mix_PausedMusic())
        Mix_ResumeMusic();
    else
        Mix_PauseMusic();
}
开发者ID:rxtsolar,项目名称:engine2d,代码行数:9,代码来源:sound.cpp


示例8: Mix_ResumeMusic

void Music::PauseMusic() {
	if(Mix_PausedMusic() == 1) {
		Mix_ResumeMusic();
		musicStopped = false;
	} else {
		Mix_PauseMusic();
		musicStopped = true;
	}
}
开发者ID:Fighter19,项目名称:uMario_Jakowski,代码行数:9,代码来源:Music.cpp


示例9: Mix_ResumeMusic

void Audio::pauseTrack()
{
    //std::cout << "pauseTrack()" << std::endl;
    if (!_opt._bMusic) return;

    if (Mix_Paused(-1))
        Mix_ResumeMusic();
    else
        Mix_PauseMusic();
}
开发者ID:PurplePup,项目名称:Reword,代码行数:10,代码来源:audio.cpp


示例10: freeSounds

Audio::~Audio() {
    if (SOUND) {
        freeSounds();
        Mix_PauseMusic();
        Mix_VolumeMusic(previous_volume);
        Mix_HaltMusic();
        Mix_FreeMusic(music);
        Mix_CloseAudio();
    }
}
开发者ID:eduardok,项目名称:Zelda3T,代码行数:10,代码来源:Audio.cpp


示例11: Mix_ResumeMusic

void MySoundEffect::resumeMusic()
{
	if (Mix_PausedMusic() == 1) {
		Mix_ResumeMusic();
	}
	else
	{
		Mix_PauseMusic();
	}
}
开发者ID:nguyenchiemminhvu,项目名称:OpenGL_Learning,代码行数:10,代码来源:MySoundEffect.cpp


示例12: LOG_WARNING

void Mixer::PauseMusic()
{
   if (!theBgMusic)
   {
      LOG_WARNING() << "Trying to pause music, but never loaded any";
      return;
   }

   Mix_PauseMusic();
}
开发者ID:mwales,项目名称:education,代码行数:10,代码来源:Mixer.cpp


示例13: Mix_PauseMusic

bool	Sounds::pause_audio_player(void)
{
	if (Mix_PausedMusic() != 1)
	{
		Mix_PauseMusic();
		Mix_Pause(1);
		return (true);
	}
	return (false);
}
开发者ID:antoinechene,项目名称:FPS-openGL,代码行数:10,代码来源:Sounds_mix.cpp


示例14: BGS_Pause

void SdlAudio::BGM_Pause() {
	// Midi pause is not supported... (for some systems -.-)
#if SDL_MAJOR_VERSION>1
	// SDL2_mixer bug, see above
	if (Mix_GetMusicType(bgm.get()) == MUS_WAV) {
		BGS_Pause();
		return;
	}
#endif
	Mix_PauseMusic();
}
开发者ID:gadesx,项目名称:Player,代码行数:11,代码来源:sdl_audio.cpp


示例15: Mix_PauseMusic

/**
 * Pauses music playback when game loses focus.
 */
void Music::pause()
{
#ifndef __NO_MUSIC
	if (!Options::mute)
	{
		Mix_PauseMusic();
		if (Mix_GetMusicType(0) == MUS_NONE)
			Mix_HookMusic(NULL, NULL);
	}
#endif
}
开发者ID:AngledStream,项目名称:OpenXcom,代码行数:14,代码来源:Music.cpp


示例16: playing

void SDLAudio::toggleMusic()      // returns true or false based on if the music was currently playing ( true if it was, false if it was muted );
{
  if ( Mix_PausedMusic() == 1 )
  {
    Mix_ResumeMusic();
  }
  else
  {
    Mix_PauseMusic();
  }
}
开发者ID:justfielding,项目名称:elle-legacy,代码行数:11,代码来源:SDLAudio.cpp


示例17: Mix_PlayMusic

void Tetris::run()
{
    SDL_Texture* background_ = nullptr;
    SDL_Event event;
    bool playGame = false;
    bool exitGame = false;

    // Start playing music.
    Mix_PlayMusic( music_, -1 );

    while( !exitGame ){
        // Load the main menu background and display it.
        background_ = resourceLoader_.loadImage( "menu_background.png", renderer_ );
        SDL_RenderCopy( renderer_, background_, nullptr, nullptr );
        SDL_RenderPresent( renderer_ );

        // Initialize the available options: play the game or exit it.
        playGame = false;
        exitGame = false;

        // Wait for user to decide if he/she plays or exits the game.
        do{
            SDL_WaitEvent( &event );

            switch( event.type ){
                case SDL_KEYDOWN:
                    if( event.key.keysym.sym == SDLK_RETURN ){
                        playGame = true;
                    }else if( event.key.keysym.sym == SDLK_ESCAPE ){
                        exitGame = true;
                    }else if( event.key.keysym.sym == SDLK_m ){
                        if( Mix_PausedMusic() ){
                            Mix_ResumeMusic();
                        }else{
                            Mix_PauseMusic();
                        }
                    }
                break;
                case SDL_QUIT:
                    exitGame = true;
                break;
            }
        }while( !playGame && !exitGame );

        // Free resources.
        SDL_DestroyTexture( background_ );

        // Start the game if player wants to.
        if( playGame ){
            game_->run();
        }
    }
}
开发者ID:moisesjbc,项目名称:moblok,代码行数:53,代码来源:tetris.cpp


示例18: Mix_ResumeMusic

void Music::PlayPause(int loops)
{
	if(Mix_PlayingMusic())
	{
		if(Mix_PausedMusic())
			Mix_ResumeMusic();
		else
			Mix_PauseMusic();
	}
	else
		Mix_PlayMusic(music, loops);
}
开发者ID:DanteX95X,项目名称:engine,代码行数:12,代码来源:sounds.cpp


示例19: PauseMusic

void cAudio :: PauseMusic( void )
{
	if( !bMusic || !bInitialised )
	{
		return;
	}

	if( Mix_PlayingMusic() )// Check if music is currently playing
	{
		Mix_PauseMusic();
	}
}
开发者ID:Arikado,项目名称:Wii-Homebrew,代码行数:12,代码来源:audio.cpp


示例20: I_PauseSong

void I_PauseSong (int handle)
{
	if(!music_initialized)
		return;

    curpause = 1;
    I_SetMusicVolume (0.0);

#ifndef OSX
	Mix_PauseMusic();
#endif
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:12,代码来源:i_music.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Mix_PausedMusic函数代码示例发布时间:2022-05-30
下一篇:
C++ Mix_OpenAudio函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap