public SceneCommandInfo Load(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; }
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); } }
public static ScenePlayCommandInfo FromXml(XElement node) { var info = new ScenePlayCommandInfo(); info.Track = node.GetInteger("track"); return info; }