void pause() { // Pause all sound Mix_Pause(-1); // Pause music Mix_PauseMusic(); }
void SoundBank::PauseOrResume() { if (Mix_PausedMusic()) { Mix_ResumeMusic(); } else { Mix_PauseMusic(); } }
void GsMusic::pause(void) { if (!Mix_PlayingMusic()) return; if (Mix_PausedMusic()) return; Mix_PauseMusic(); }
void Music::Pause() { if (Audio::GetInstance()->GetCurrentMusic() != this) return; if (Mix_PausedMusic() == 0) Mix_PauseMusic(); }
void SoundEngine::PauseMusic() { if (nosound) { return; } Mix_PauseMusic(); }
void SDL::pauseMusic() { if (!(SDL::startedAudio)) return; if (SDL::musicPlaying()) Mix_PauseMusic(); }
void SoundManager::toggleSound() { notmute = !notmute; if(!notmute) Mix_PauseMusic(); else if(Mix_PausedMusic()) Mix_ResumeMusic(); }
void GsMusic::toggle(void) { if (!Mix_PlayingMusic()) return; if (Mix_PausedMusic()) Mix_ResumeMusic(); else Mix_PauseMusic(); }
void Music::PauseMusic() { if(Mix_PausedMusic() == 1) { Mix_ResumeMusic(); musicStopped = false; } else { Mix_PauseMusic(); musicStopped = true; } }
void Audio::pauseTrack() { //std::cout << "pauseTrack()" << std::endl; if (!_opt._bMusic) return; if (Mix_Paused(-1)) Mix_ResumeMusic(); else Mix_PauseMusic(); }
Audio::~Audio() { if (SOUND) { freeSounds(); Mix_PauseMusic(); Mix_VolumeMusic(previous_volume); Mix_HaltMusic(); Mix_FreeMusic(music); Mix_CloseAudio(); } }
void MySoundEffect::resumeMusic() { if (Mix_PausedMusic() == 1) { Mix_ResumeMusic(); } else { Mix_PauseMusic(); } }
void Mixer::PauseMusic() { if (!theBgMusic) { LOG_WARNING() << "Trying to pause music, but never loaded any"; return; } Mix_PauseMusic(); }
bool Sounds::pause_audio_player(void) { if (Mix_PausedMusic() != 1) { Mix_PauseMusic(); Mix_Pause(1); return (true); } return (false); }
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(); }
/** * 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 }
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(); } }
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(); } } }
void Music::PlayPause(int loops) { if(Mix_PlayingMusic()) { if(Mix_PausedMusic()) Mix_ResumeMusic(); else Mix_PauseMusic(); } else Mix_PlayMusic(music, loops); }
void cAudio :: PauseMusic( void ) { if( !bMusic || !bInitialised ) { return; } if( Mix_PlayingMusic() )// Check if music is currently playing { Mix_PauseMusic(); } }
void I_PauseSong (int handle) { if(!music_initialized) return; curpause = 1; I_SetMusicVolume (0.0); #ifndef OSX Mix_PauseMusic(); #endif }
// Pauses music, if play() was not called, return false bool AudioHandler::pause() { if (!Mix_PlayingMusic()) { return false; } if (!Mix_PausedMusic()) { Mix_PauseMusic(); } return true; }
void ChannelInternalState::RealChannelPause() { assert(is_real()); if (IsStream()) { #ifdef PINDROP_MULTISTREAM Mix_PauseMusicCh(channel_id_); #else Mix_PauseMusic(); #endif // PINDROP_MULTISTREAM } else { Mix_Pause(channel_id_); } }
void cAudio :: Pause_Music( void ) const { if( !m_music_enabled || !m_initialised ) { return; } // if music is playing if( Mix_PlayingMusic() ) { Mix_PauseMusic(); } }
void snd_pause(int on) { if (!sound_on) return; if (on) { Mix_Pause(-1); Mix_PauseMusic(); } else { Mix_Resume(-1); Mix_ResumeMusic(); } return; }
void PauseWave ( int no ) { switch ( s_iYGSSoundType[no] ) { case YGS_SOUNDTYPE_WAV: Mix_Pause(no); break; case YGS_SOUNDTYPE_MUS: Mix_PauseMusic(); break; } }
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); noiseLoopChannel = Mix_PlayChannel(-1, noiseLoop, -1); printf("noiseLoopChannel = %d", noiseLoopChannel); assert(noiseLoopChannel != -1 && noiseLoopChannel != 0); // set noiseLoopChannel to half volume Mix_Volume(noiseLoopChannel,MIX_MAX_VOLUME/10); 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(); #ifdef REPORT_RESULT REPORT_RESULT(1); #endif break; }; }
void Room_MainParent::setMusic(const char *path, bool play) { music = Mix_LoadMUS(path); if (music == NULL) { std::cout << "Could not play music with path '" << path << "'!" << endl; } else { Mix_PlayMusic(music, -1); if (!play) Mix_PauseMusic(); } }
void GameApplication::startStopSound() { if (Mix_PlayingMusic() == 0) { Mix_PlayMusic(music, -1); chunk = true; } else { if (Mix_PausedMusic() == 1) { Mix_ResumeMusic(); chunk = true; } else { Mix_PauseMusic(); chunk = false; } } }
void cSound::pauseSound(string name) { map<string, Mix_Chunk*>::iterator iterChunk = m_Chunks.find(name); map<string, Mix_Music*>::iterator iterMusic = m_Music.find(name); if (iterChunk != m_Chunks.end()) { Mix_HaltChannel(1); } else if(iterMusic != m_Music.end()) { Mix_PauseMusic(); } }