static void LoadIntroGame() { _game_mode = GM_MENU; ResetGRFConfig(false); /* Setup main window */ ResetWindowSystem(); SetupColoursAndInitialWindow(); /* Load the default opening screen savegame */ if (SaveOrLoad("opntitle.dat", SL_LOAD, DATA_DIR) != SL_OK) { GenerateWorld(GWM_EMPTY, 64, 64); // if failed loading, make empty world. WaitTillGeneratedWorld(); SetLocalCompany(COMPANY_SPECTATOR); } else { SetLocalCompany(COMPANY_FIRST); } _pause_mode = PM_UNPAUSED; _cursor.fix_at = false; CheckForMissingSprites(); CheckForMissingGlyphsInLoadedLanguagePack(); /* Play main theme */ if (_music_driver->IsSongPlaying()) ResetMusic(); }
Audio::~Audio() { for (int sound_id = 0; sound_id < MAX_SOUND; sound_id++) { if (IsSound(sound_id)) { ResetSound(sound_id); } } for (int music_id = 0; music_id < MAX_MUSIC; music_id++) { if (IsMusic(music_id)) { ResetMusic(music_id); } } }
void AOrionMusicManager::PlaySong() { if (!NextSong) { ResetMusic(); return; } MusicComponent->SetSound(NextSong); MusicComponent->FadeIn(2.0f, VolumeMax); CurrentSong = NextSong; GetWorldTimerManager().SetTimer(MusicTimer, this, &AOrionMusicManager::ResetMusic, FMath::Max(1.0f, NextSong->Duration - 2.0f), false); }
void MusicLoop() { if (!_settings_client.music.playing && _song_is_active) { StopMusic(); } else if (_settings_client.music.playing && !_song_is_active) { PlayPlaylistSong(); } if (!_song_is_active) return; if (!MusicDriver::GetInstance()->IsSongPlaying()) { if (_game_mode != GM_MENU) { StopMusic(); SkipToNextSong(); PlayPlaylistSong(); } else { ResetMusic(); } } }
void MusicLoop() { if (!_msf.playing && _song_is_active) { StopMusic(); } else if (_msf.playing && !_song_is_active) { PlayPlaylistSong(); } if (!_song_is_active) return; if (!_music_driver->IsSongPlaying()) { if (_game_mode != GM_MENU) { StopMusic(); SkipToNextSong(); PlayPlaylistSong(); } else { ResetMusic(); } } }
int SoundManager::StopMusic(int snd){ if(snd<0 && snd>=nMusics) return -1; ResetMusic(snd); return 0; }
void Audio::StopMusic(const int& music_id) { assert(IsMusic(music_id)); ResetMusic(music_id); }