Example #1
0
 private void PlayMusicCommand(ScenePlayCommandInfo command)
 {
     if (command.LoopPath != null)
     {
         string intropath = (command.IntroPath != null) ? command.IntroPath.Absolute : null;
         string looppath  = (command.LoopPath != null) ? command.LoopPath.Absolute : null;
         Engine.Instance.SoundSystem.LoadMusic(intropath, looppath, 1).Play();
     }
     else
     {
         Engine.Instance.SoundSystem.PlayMusicNSF((uint)command.Track);
     }
 }
        private static ScenePlayCommandInfo LoadPlayCommand(XElement node, string basePath)
        {
            var info = new ScenePlayCommandInfo();

            info.Track = node.TryAttribute <int>("nsftrack", node.TryAttribute <int>("track"));

            XElement intro = node.Element("Intro");
            XElement loop  = node.Element("Loop");

            info.IntroPath = (intro != null) ? FilePath.FromRelative(intro.Value, basePath) : null;
            info.LoopPath  = (loop != null) ? FilePath.FromRelative(loop.Value, basePath) : null;

            return(info);
        }