Esempio n. 1
0
 public bool InitSound(Camera cam)
 {
     try
     {
         if (!hasMusic && !hasSound)
         {
             return(false);
         }
         soundEngine = MogreFreeSL.SoundManager.Instance;
         soundEngine.InitializeSound(FSL_SOUND_SYSTEM.FSL_SS_DIRECTSOUND, cam);
         var tracks = modData.MusicInfos;
         foreach (var track in tracks)
         {
             GameSound music = new GameSound();
             music.AddSound(soundEngine.CreateAmbientSound(findMusicFileByID(track.ID), track.ID, true, false));
             music.PlayType = track.PlayType;
             musicLst.Add(music);
         }
         return(true);
     }
     catch (Exception ex)
     {
         EngineManager.Instance.log.LogMessage(ex.Message, LogMessage.LogType.Error);
         return(false);
     }
 }
Esempio n. 2
0
 public bool InitSound(Camera cam, Mods.ModData modData)
 {
     try
     {
         this.modData = modData;
         if (!hasMusic && !hasSound)
         {
             return(false);
         }
         soundEngine = MogreFreeSL.SoundManager.Instance;
         soundEngine.InitializeSound(FSL_SOUND_SYSTEM.FSL_SS_DIRECTSOUND, cam);
         var tracks = modData.MusicInfos;
         foreach (var track in tracks)
         {
             GameSound music = new GameSound();
             music.AddSound(soundEngine.CreateAmbientSound(findMusicFileByID(track.Id), track.Id, true, false));
             music.PlayType = track.PlayType;
             musicLst.Add(music);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }