public void PlayNewSong(string name, float fadeDuration, bool interrupt) { if (SoundManager.NoMusic) { return; } TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong; if (!interrupt) { this.ShelvedSong = this.ActiveSong; } else if (this.ActiveSong != null) { this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration); } if (string.IsNullOrEmpty(name)) { this.ActiveSong = (ActiveTrackedSong)null; } else { TrackedSong song = this.CMProvider.CurrentLevel.Load <TrackedSong>("Music/" + name); song.Initialize(); ServiceHelper.AddComponent((IGameComponent)(this.ActiveSong = new ActiveTrackedSong(this.Game, song, this.LevelManager.MutedLoops))); } if (currentlyPlayingSong == this.CurrentlyPlayingSong) { return; } this.SongChanged(); }
public void PlayNewSong(float fadeDuration) { if (SoundManager.NoMusic) { return; } TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong; if (this.ActiveSong != null) { this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration); } if (this.LevelManager.Song == null) { this.ActiveSong = (ActiveTrackedSong)null; } else { ServiceHelper.AddComponent((IGameComponent)(this.ActiveSong = new ActiveTrackedSong(this.Game))); } if (currentlyPlayingSong == this.CurrentlyPlayingSong) { return; } this.SongChanged(); }
public void UnshelfSong() { if (this.ShelvedSong == null) { return; } this.ActiveSong = this.ShelvedSong; this.ShelvedSong = (ActiveTrackedSong)null; }
public void Stop() { if (this.ActiveSong != null) { ServiceHelper.RemoveComponent <ActiveTrackedSong>(this.ActiveSong); } if (this.ActiveAmbience != null) { ServiceHelper.RemoveComponent <ActiveAmbience>(this.ActiveAmbience); } this.ActiveSong = (ActiveTrackedSong)null; this.ActiveAmbience = (ActiveAmbience)null; this.MusicVolumeFactor = 1f; }
public void Stop() { if (this.ActiveSong != null) ServiceHelper.RemoveComponent<ActiveTrackedSong>(this.ActiveSong); if (this.ActiveAmbience != null) ServiceHelper.RemoveComponent<ActiveAmbience>(this.ActiveAmbience); this.ActiveSong = (ActiveTrackedSong) null; this.ActiveAmbience = (ActiveAmbience) null; this.MusicVolumeFactor = 1f; }
public void UnshelfSong() { if (this.ShelvedSong == null) return; this.ActiveSong = this.ShelvedSong; this.ShelvedSong = (ActiveTrackedSong) null; }
public void PlayNewSong(string name, float fadeDuration, bool interrupt) { if (SoundManager.NoMusic) return; TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong; if (!interrupt) this.ShelvedSong = this.ActiveSong; else if (this.ActiveSong != null) this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration); if (string.IsNullOrEmpty(name)) { this.ActiveSong = (ActiveTrackedSong) null; } else { TrackedSong song = this.CMProvider.CurrentLevel.Load<TrackedSong>("Music/" + name); song.Initialize(); ServiceHelper.AddComponent((IGameComponent) (this.ActiveSong = new ActiveTrackedSong(this.Game, song, this.LevelManager.MutedLoops))); } if (currentlyPlayingSong == this.CurrentlyPlayingSong) return; this.SongChanged(); }
public void PlayNewSong(float fadeDuration) { if (SoundManager.NoMusic) return; TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong; if (this.ActiveSong != null) this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration); if (this.LevelManager.Song == null) this.ActiveSong = (ActiveTrackedSong) null; else ServiceHelper.AddComponent((IGameComponent) (this.ActiveSong = new ActiveTrackedSong(this.Game))); if (currentlyPlayingSong == this.CurrentlyPlayingSong) return; this.SongChanged(); }