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

C++ Mix_ResumeMusic函数代码示例

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

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



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

示例1: toluaI_sound_sound_resume_music00

/* function: Mix_ResumeMusic */
static int toluaI_sound_sound_resume_music00(lua_State* tolua_S)
{
 if (
 !tolua_isnoobj(tolua_S,1)
 )
 goto tolua_lerror;
 else
 {
 {
  Mix_ResumeMusic();
 }
 }
 return 0;
tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'resume_music'.");
 return 0;
}
开发者ID:jcubic,项目名称:ToME,代码行数:18,代码来源:w_sound.c


示例2: jhi_replay_music

void jhi_replay_music(JHI_Music *music, int loop)
{
	if (Mix_PausedMusic() == 1)
	{
		Mix_ResumeMusic();
	}

	if (Mix_PlayingMusic() != 0) 
	{
		jhi_stop_music();
	}

	jhi_free_music(music);
	jhi_load_music(music, music->filename);

	jhi_play_music(music, loop);
}
开发者ID:joaogf,项目名称:libjhi-sdl,代码行数:17,代码来源:jhi_sound.c


示例3: handleKey

void handleKey(SDL_KeyboardEvent key) {
	switch(key.keysym.sym) {
	case SDLK_p:
		shoot(phaser, NULL, key.type);
		break;
	case SDLK_1:
		shoot(one, oneEnd, key.type);
		break;
	case SDLK_2:
		shoot(two, twoEnd, key.type);
		break;
	case SDLK_3:
		shoot(three, threeEnd, key.type);
		break;
	case SDLK_4:
		shoot(four, fourEnd, key.type);
		break;
	case SDLK_5:
		shoot(five, fiveEnd, key.type);
		break;
	case SDLK_6:
		shoot(six, sixEnd, key.type);
		break;
	case SDLK_m:
		if(key.state == SDL_PRESSED) {
			if(music == NULL) {
				music = Mix_LoadMUS("music.ogg");
				Mix_PlayMusic(music, 0);
				Mix_HookMusicFinished(musicDone);
			}
			if (!musicPlaying) {
				printf("Play\n");
				musicPlaying = 1;
				Mix_ResumeMusic();
			} else {
				printf("Pause\n");
				musicPlaying = 0;
				Mix_PauseMusic();
				//Mix_HaltMusic();
				//Mix_FreeMusic(music);
				//music = NULL;
			}
		}
		break;
	}
}
开发者ID:knickers,项目名称:binauralAlgorithms,代码行数:46,代码来源:mixer.c


示例4: Mix_ResumeMusic

//----------------------------------------------------------------------------------------------------------------------
void Game::update()
{
  // only update if game is acutally playing
  if(m_playing)
  {
    // if the music is paused when changing levels
    if(Mix_PausedMusic()==1)
    {
      // play the music
      Mix_ResumeMusic();
    }
    // update all the game's systems
    m_controlSys.update(m_rotX, m_rotY);
    m_sensorSys.update();
    m_autoSys.update();
    // get rid of dead boids
    cleanup();
    m_flightSys.update();
    m_combatSys.update();
    // check if vulnerable boid lists are empty
    if(m_world->m_stdBoids.empty() && m_world->m_ldrBoids.empty())
    {
      // increment the level
      ++m_level;
      // if level is still within max levels
      if(m_level<m_maxLevels)
      {
        // congratulations for beating level, loading new level
        Mix_PauseMusic();
        // load next level after reset
        m_world->resetWorld();
        loadLevel(m_levelList[m_level]);
      }
      else
      {
        // finished the game, return to menu
        gameover();
      }
    }
    if(m_world->m_player->m_auto.m_dead)
    {
      // gameover, return to menu
      gameover();
    }
  }
}
开发者ID:ryanchanwo,项目名称:Kinobird,代码行数:47,代码来源:Game.cpp


示例5: Mix_PauseMusic

void CSound::SetPause (bool Pause)
{
    // If the sound works
    if (m_SoundOK)
    {    
        if (Pause)
        {    
            Mix_PauseMusic();
        }
        else
        {
            Mix_ResumeMusic();	
        }

        m_GlobalPause = Pause;
    }
}
开发者ID:Enucatl,项目名称:bombermaaan-x,代码行数:17,代码来源:CSound.cpp


示例6: Mix_ResumeMusic

void music_muter::handle_window_event(const SDL_Event& event)
{
	if (preferences::stop_music_in_background() && preferences::music_on())
	{
		if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
		{
			Mix_ResumeMusic();
		}
		else if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST)
		{
			if (Mix_PlayingMusic())
			{
				Mix_PauseMusic();
			}
		}
	}
}
开发者ID:aquileia,项目名称:wesnoth,代码行数:17,代码来源:sound.cpp


示例7: Mix_ResumeMusic

void cMusicSDL2::Play(int _repeat, int fade){
	if(music != NULL){
		if(Mix_PlayingMusic() > 0){	//Music is already playing
			if(isPaused){
				Mix_ResumeMusic();
				isPaused = false;
				return;
			}else if(Mix_FadingMusic() == MIX_FADING_OUT){
				Mix_HaltMusic();
			}else{
				return;
			}
		}
		if(Mix_FadeInMusic(music, _repeat, fade) < 0){
			StormPrintLog(STORM_LOG_ERROR, "cMusicSDL2", "Error %s", Mix_GetError());
		}
	}
}
开发者ID:master312,项目名称:quantum-kidney,代码行数:18,代码来源:cMusicSDL2.cpp


示例8: Mix_ResumeMusic

void Player::Play() {
	if (MusicPaused) {
		Mix_ResumeMusic();
		MusicPaused = false;
	} else {
		//Get first song to play

		//TEMP: just grab test song
		current = Mix_LoadMUS("song.flac");
		next = Mix_LoadMUS("next.flac");
		if (!current) {
			fprintf(stderr, "Error opening music file: %s\n", SDL_GetError());
			exit(1);
		}

		playCurrent();
	}
}
开发者ID:raemarks,项目名称:Crescendo,代码行数:18,代码来源:player.cpp


示例9: one_iter

void one_iter() {
  static int frames = 0;
  frames++;
  
  switch( frames ) {
    case 1:
      soundChannel = Mix_PlayChannel(-1, sound, 0);
      printf("channel = %d", soundChannel);
      assert(soundChannel != -1 && soundChannel != 0);
      break;
    case 2:
      printf("channel %d is playing = %d", soundChannel, Mix_Playing(soundChannel));
      assert(Mix_Playing(soundChannel));
      break;
    case 30:
      Mix_Pause(soundChannel);
      Mix_PlayMusic(music, 1);
      break;
    case 31:
      assert(Mix_Paused(soundChannel));
      assert(Mix_PlayingMusic());
      break;
    case 60:
      Mix_Resume(soundChannel);
      Mix_PauseMusic();
      break;
    case 61:
      assert(Mix_Playing(soundChannel));
      assert(Mix_PausedMusic());
      break;
    case 90:
      Mix_ResumeMusic();
      break;
    case 91:
      assert(Mix_PlayingMusic());
      break;
    case 120:
      Mix_HaltChannel(soundChannel);
      Mix_HaltMusic();
      int result = 1;
      REPORT_RESULT();
      break;
  };
}
开发者ID:13609594236,项目名称:CrossApp,代码行数:44,代码来源:sdl_audio_mix.c


示例10: applySurface

    bool Tela::showConfScreen() {
        bool quit = false, execute = true;

        if(audio) {
            applySurface( 0, 0, telaConfigSound_ON, screen );
            SDL_Flip( screen );
        } else {
            applySurface( 0, 0, telaConfigSound_OFF, screen );
            SDL_Flip( screen );
        }

        while( execute ) {

            if( SDL_PollEvent( &event ) ) {
                Ponto tmp;

                if( event.type == SDL_MOUSEBUTTONDOWN && event.button.button == SDL_BUTTON_LEFT) {
                    tmp.x = event.button.x;
                    tmp.y = event.button.y;
                    if((tmp.x >= 590 && tmp.x <= 645) && (tmp.y >= 100 && tmp.y <= 160)) {
                        execute = false;
                    } else if((tmp.x >= 140 && tmp.x <= 660) && (tmp.y >= 60 && tmp.y <= 580)) {
                        if(audio) {
                            applySurface( 0, 0, telaConfigSound_OFF, screen );
                            SDL_Flip( screen );
                            audio = false;
                            Mix_PauseMusic();
                        } else {
                            applySurface( 0, 0, telaConfigSound_ON, screen );
                            SDL_Flip( screen );
                            audio = true;
                            Mix_ResumeMusic();
                        }
                    }
                } else if( (event.type == SDL_QUIT)  || (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE)) {
                    //Encerra programa
                    quit = true;
                    return quit;
                }
            }
        }
        return execute;
    }
开发者ID:jefferssongalvao,项目名称:JewelrySpace,代码行数:43,代码来源:Tela.cpp


示例11: Mix_PauseMusic

//Checks if music is on
void Application::checkMusic()
{
    if (isMusicOn)
    {
        isMusicOn = false;
        Mix_PauseMusic();
    }
    else
    {
        isMusicOn = true;
        if (Mix_PausedMusic() == 1)
        {
            Mix_ResumeMusic();
        }
        else
        {
            Mix_PlayMusic(menuBackgroundSound, 10);
        }
    }
}
开发者ID:gody93,项目名称:Rally,代码行数:21,代码来源:Application.cpp


示例12: DrawText

void GameThroneMode::GameOver()
{
	const int fontSize = 60;
	int middleX=(int) RESX/2;
	int middleY=(int) RESY/2;
	if(snake1->GetDead())
	{
		player2Score++;
		DrawText(middleX-250,middleY-10,"Player  WASD  WIN",fontSize,250,152,5);
	}
	if(snake2->GetDead())
	{
		player1Score++;
		DrawText(middleX-250,middleY-10,"Player  ULDR  WIN",fontSize,250,152,5);
	}
	SDL_Flip(screen);
	
	Mix_PauseMusic();
	Mix_PlayChannel(-1,sounds[4],0);
	SDL_Delay(4500);
	Mix_ResumeMusic();

	for(int i=0;i<65;i++)
	{
		for(int j=0;j<35;j++)
		{
			Converter.CreateConvert<CellEmpty>(i,j);
		}
	}
	Converter.Convert();

	delete snake1;
	delete snake2;

	snake1=new Snake(Left,"Snake1",CellStruct(61,17),CellStruct(62,17),CellStruct(63,17));
	snake2=new Snake(Right,"Snake2",CellStruct(3,18),CellStruct(2,18),CellStruct(1,18),1);

	SDL_PumpEvents();
	SDL_Event event[30];
	SDL_PeepEvents(event,30,SDL_GETEVENT,SDL_KEYDOWNMASK);
}
开发者ID:Jeky-v,项目名称:Snake,代码行数:41,代码来源:GameThroneMode.cpp


示例13: SDLH_Play

void SDLH_Play(void)
{
    musicMutex = !songs.empty();
    while (musicMutex)
    {
        HIDUSER_GetSoundVolume(&currentVolume);
        if (!Mix_PlayingMusic() || (currentVolume == 0 && songs.size() > 1))
        {
            if (song)
            {
                Mix_FreeMusic(song);
                song = nullptr;
            }
            if (Configuration::getInstance().randomMusic())
            {
                currentSong = randomNumbers() % songs.size();
            }
            else
            {
                currentSong = (currentSong + 1) % songs.size();
            }
            song = Mix_LoadMUS(songs[currentSong].c_str());
            Mix_PlayMusic(song, 1);
        }
        if (currentVolume == 0)
        {
            Mix_PauseMusic();
        }
        while (currentVolume == 0 && musicMutex)
        {
            HIDUSER_GetSoundVolume(&currentVolume);
            svcSleepThread(250000000);
        }
        if (Mix_PausedMusic() && musicMutex)
        {
            Mix_ResumeMusic();
        }
        svcSleepThread(250000000);
    }
    donePlaying = true;
}
开发者ID:BernardoGiordano,项目名称:EventAssistant,代码行数:41,代码来源:mixer.cpp


示例14: startStopSound

void startStopSound()
{
    if( Mix_PlayingMusic() == 0 )
    {
        Mix_PlayMusic( gMusic, -1 );
        chunk = true;
    }
    else
    {
        if( Mix_PausedMusic() == 1 )
        {
            Mix_ResumeMusic();
            chunk = true;
        }
        else
        {
            Mix_PauseMusic();
            chunk = false;
        }
    }
}
开发者ID:rosen90,项目名称:GitHub,代码行数:21,代码来源:main.cpp


示例15: audio_set_music_on_off

void
audio_set_music_on_off (int on)
{
#ifdef USE_AUDIO
  if (!sound_supported) return;
    if (on) {
        if (Mix_PausedMusic()) Mix_ResumeMusic();
        else
        {
            while (Mix_FadingMusic() == MIX_FADING_OUT) SDL_Delay(100);
        }
        if (music[currentMus])
            Mix_FadeInMusic (music[currentMus], -1, 1000);
    }
    else {
        while (Mix_FadingMusic() == MIX_FADING_IN) SDL_Delay(100);
        Mix_FadeOutMusic (1000);
    }
    music_on = on;
#endif
}
开发者ID:gp2xdev,项目名称:gp2x-flobopuyo,代码行数:21,代码来源:audio.c


示例16: Menu

void Menu(void)
{
	char buf[10];

	printf("Available commands: (p)ause (r)esume (h)alt > ");
	fflush(stdin);
	scanf("%s",buf);
	switch(buf[0]){
	case 'p': case 'P':
		Mix_PauseMusic();
		break;
	case 'r': case 'R':
		Mix_ResumeMusic();
		break;
	case 'h': case 'H':
		Mix_HaltMusic();
		break;
	}
	printf("Music playing: %s Paused: %s\n", Mix_PlayingMusic() ? "yes" : "no", 
		   Mix_PausedMusic() ? "yes" : "no");
}
开发者ID:Jay-Jay-OPL,项目名称:ps2sdk-ports,代码行数:21,代码来源:playmus.c


示例17: Mix_ResumeMusic

int BEE::Sound::resume() {
	if (!is_loaded) {
		if (!has_play_failed) {
			game->messenger_send({"engine", "sound"}, BEE_MESSAGE_WARNING, "Failed to resume sound \"" + name + "\" because it is not loaded");
			has_play_failed = true;
		}
		return 1;
	}

	if (is_music) {
		Mix_ResumeMusic();
	} else {
		for (auto i=current_channels.begin(); i != current_channels.end(); ++i) {
			Mix_Resume(*i);
		}
	}

	is_playing = true;

	return 0;
}
开发者ID:piluke,项目名称:BasicEventEngine,代码行数:21,代码来源:sound.cpp


示例18: Mix_PlayMusic

void Sound::playMusic(Mix_Music *song)
{
	//If no Music is playing
	if (Mix_PlayingMusic() == 0)
	{
		//Play the music
		Mix_PlayMusic(goneFishing, -1);
	}
	else
	{
		//If music is paused
		if (Mix_PausedMusic() == 1)
		{
			//Resume the music
			Mix_ResumeMusic();
		}


	}
	

}
开发者ID:Rapture686,项目名称:RPG,代码行数:22,代码来源:Sound.cpp


示例19: Mix_ResumeMusic

void MusicSound::Play(int loopCount)
{

    if(Mix_PausedMusic())
    {
        Mix_ResumeMusic();
    }
    else
    {
        if(Mix_PlayMusic(MusicAudio, loopCount)==-1)
        {
    #ifdef DEBUG_MODE
                printf("Mix_LoadPlay Error: %s\n", Mix_GetError());
    #endif
        }

        if(loopCount == -1)
        {
            looping = true;
        }
    }
}
开发者ID:Samurai336,项目名称:HHRLinux,代码行数:22,代码来源:MusicSound.cpp


示例20: Mix_Resume

void Music::pauseResume() {
	if(tipo == SOM) {
		if(Mix_Paused(0)) {
			Mix_Resume(0);
		} else if(Mix_Playing(0)) {
			Mix_Pause(0);
		}

		if(Mix_Paused(1)) {
			Mix_Resume(1);
		} else if(Mix_Playing(1)) {
			Mix_Pause(1);
		}
	} else {
		if(Mix_PausedMusic()) {
			Mix_ResumeMusic();
		} else {
			Mix_PauseMusic();
		}
	}


}
开发者ID:slumki,项目名称:Gameka,代码行数:23,代码来源:Music.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Mix_SetError函数代码示例发布时间:2022-05-30
下一篇:
C++ Mix_QuerySpec函数代码示例发布时间: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