Beispiel #1
0
 public void SetActiveSoundType(SoundProfileType type)
 {
     if (this.activeSound != null)
     {
         SoundLib.StopMusic();
         this.IsPlay = false;
     }
     this.activeType      = type;
     this.currentPlaylist = 0;
     this.GeneratePlaylistData(this.currentPlaylist);
     if (this.playlist != null)
     {
         if (this.playlist.Count > 0)
         {
             this.activeSound = this.playlist[0];
         }
     }
     else
     {
         SoundLib.LogWarning("SetActiveSoundType, playlist is null!");
     }
     if (type == SoundProfileType.Sfx)
     {
     }
 }
Beispiel #2
0
 private void GeneratePlaylistData(Int32 playlistIndex)
 {
     this.playlist = this.GetPlaylist(this.currentPlaylist);
     if (this.playlist == null)
     {
         SoundLib.LogWarning("GeneratePlaylistData, playlist is null!");
         return;
     }
     this.SetPlaylistInfo(this.playlist);
 }
Beispiel #3
0
 public static void StopAllSounds()
 {
     try
     {
         SoundLib.musicPlayer.StopMusic();
         SoundLib.soundEffectPlayer.StopAllSoundEffects();
         SoundLib.songPlayer.StopAllSoundEffects();
         SoundLib.movieAudioPlayer.StopMusic();
         SoundLib.allSoundDispatchPlayer.StopAllSounds();
         SoundLib.sfxSoundPlayer.StopAllSounds();
     }
     catch (Exception message)
     {
         SoundLib.LogWarning(message);
     }
 }
Beispiel #4
0
        private List <SoundProfile> GetPlaylist(Int32 playListIndex)
        {
            List <Int32> list = null;

            if (this.activeType == SoundProfileType.Music)
            {
                list = this.allMusicIndex;
            }
            else if (this.activeType == SoundProfileType.SoundEffect)
            {
                list = this.allSoundEffectIndex;
            }
            else if (this.activeType == SoundProfileType.Song)
            {
                list = this.allSongIndex;
            }
            else if (this.activeType == SoundProfileType.Sfx)
            {
                SoundLib.LogWarning("GetPlaylist does not support SoundProfileType.Sfx");
            }
            else if (this.activeType == SoundProfileType.MovieAudio)
            {
                list = this.allMovieAudioIndex;
            }
            if (list == null)
            {
                return(null);
            }
            if (this.currentPlaylist < 0)
            {
                return(null);
            }
            if (this.currentPlaylist > list.Count)
            {
                return(null);
            }
            Int32 num = this.currentPlaylist * 100;
            List <SoundProfile> list2 = new List <SoundProfile>();
            Int32 num2 = num;

            while (num2 < num + 100 && num2 < list.Count)
            {
                list2.Add(SoundMetaData.GetSoundProfile(list[num2], this.activeType));
                num2++;
            }
            return(list2);
        }
Beispiel #5
0
 private void BuildSoundName()
 {
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (GUILayout.Button("Back", new GUILayoutOption[0]))
     {
         this.Exit();
     }
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     if (this.soundViewController != null && this.soundViewController.GetActiveSound() != null)
     {
         GUILayout.Label(this.soundViewController.GetActiveSound().Name, new GUILayoutOption[0]);
     }
     GUILayout.EndHorizontal();
     if (this.isEnableSound)
     {
         if (GUILayout.Button("Suspend SEAD", new GUILayoutOption[0]))
         {
             if (ISdLibAPIProxy.Instance.SdSoundSystem_Suspend() == 0)
             {
                 this.isEnableSound = false;
             }
             else
             {
                 SoundLib.LogWarning("SdSoundSystem_Suspend failure");
             }
         }
     }
     else if (GUILayout.Button("Resume SEAD", new GUILayoutOption[0]))
     {
         if (ISdLibAPIProxy.Instance.SdSoundSystem_Resume() == 0)
         {
             this.isEnableSound = true;
         }
         else
         {
             SoundLib.LogWarning("SdSoundSystem_Resume failure");
         }
     }
     GUILayout.EndHorizontal();
 }
Beispiel #6
0
        public void NextPlayList()
        {
            List <Int32> list = null;

            if (this.activeType == SoundProfileType.Music)
            {
                list = this.allMusicIndex;
            }
            else if (this.activeType == SoundProfileType.SoundEffect)
            {
                list = this.allSoundEffectIndex;
            }
            else if (this.activeType == SoundProfileType.Song)
            {
                list = this.allSongIndex;
            }
            else if (this.activeType == SoundProfileType.Sfx)
            {
                SoundLib.LogWarning("Does not support SoundProfileType.Sfx");
            }
            else if (this.activeType == SoundProfileType.MovieAudio)
            {
                list = this.allMovieAudioIndex;
            }
            Int32 num  = (Int32)((list.Count % 100 != 0) ? 1 : 0);
            Int32 num2 = list.Count / 100 + num;

            if (this.currentPlaylist < num2 - 1)
            {
                this.currentPlaylist++;
            }
            this.GeneratePlaylistData(this.currentPlaylist);
            if (this.playlist.Count > 0)
            {
                this.activeSound = this.playlist[0];
            }
        }
Beispiel #7
0
        private void SetPlaylistInfo(List <SoundProfile> allSoundProfile)
        {
            List <Int32> list = null;

            if (this.activeType == SoundProfileType.Music)
            {
                list = this.allMusicIndex;
            }
            else if (this.activeType == SoundProfileType.SoundEffect)
            {
                list = this.allSoundEffectIndex;
            }
            else if (this.activeType == SoundProfileType.Song)
            {
                list = this.allSongIndex;
            }
            else if (this.activeType == SoundProfileType.Sfx)
            {
                SoundLib.LogWarning("SetPlaylistInfo does not support SoundProfileType.Sfx");
            }
            else if (this.activeType == SoundProfileType.MovieAudio)
            {
                list = this.allMovieAudioIndex;
            }
            this.PlaylistInfo = this.currentPlaylist + 1 + "/" + (list.Count / 100 + 1);
            Int32 num = this.currentPlaylist * 100;

            this.PlaylistDetail = String.Concat(new Object[]
            {
                num + 1,
                "-",
                num + allSoundProfile.Count,
                " of ",
                list.Count
            });
        }