public void Kill() { if (fscMode) { HITVM.Get().StopFSC(fsc); } else { inst.Stop(); inst.Dispose(); sfx.Dispose(); } }
public HITThread(uint TrackID, HITVM VM, HITResourceGroup Src) { this.VM = VM; ResGroup = Src; Owners = new List <int>(); Notes = new List <HITNoteEntry>(); NotesByChannel = new Dictionary <SoundEffectInstance, HITNoteEntry>(); audContent = Content.Content.Get().Audio; SetTrack(TrackID); SimpleMode = true; PlaySimple = true; //play next frame, so we have time to set volumes. }
public void Kill() { if (fscMode) { HITVM.Get().StopFSC(fsc); } else { inst.Stop(); inst.Dispose(); HITVM.Get().AmbLoops.Remove(inst); sfx.Dispose(); } }
private bool SimpleMode; //certain sounds play with no HIT. #endregion Fields #region Constructors public HITThread(HITFile Src, HITVM VM) { this.Src = Src; this.VM = VM; Registers = new int[16]; Registers[1] = 12; //gender (offset into object var table) LocalVar = new int[54]; ObjectVar = new int[29]; Notes = new List<HITNoteEntry>(); NotesByChannel = new Dictionary<SoundEffectInstance, HITNoteEntry>(); Owners = new List<int>(); Stack = new Stack<int>(); audContent = Content.Content.Get().Audio; }
public HITThread(HITFile Src, HITVM VM) { this.Src = Src; this.VM = VM; Registers = new int[16]; Registers[1] = 12; //gender (offset into object var table) LocalVar = new int[54]; ObjectVar = new int[29]; Notes = new List <HITNoteEntry>(); NotesByChannel = new Dictionary <SoundEffectInstance, HITNoteEntry>(); Owners = new List <int>(); Stack = new Stack <int>(); audContent = Content.Content.Get().Audio; }
public AmbiencePlayer(Ambience amb) { if (amb.Loop) { byte[] data = new XAFile(FSO.Content.Content.Get().GetPath(amb.Path)).DecompressedData; var stream = new MemoryStream(data); sfx = SoundEffect.FromStream(stream); stream.Close(); inst = sfx.CreateInstance(); inst.IsLooped = true; inst.Play(); fscMode = false; } else { fsc = HITVM.Get().PlayFSC(FSO.Content.Content.Get().GetPath(amb.Path)); fsc.SetVolume(0.33f); //may need tweaking fscMode = true; } }
public static void Init() { INSTANCE = new HITVM(); }
public static void Init() { DISABLE_SOUND = FSOEnvironment.NoSound; INSTANCE = new HITVM(); }
private void NextNote() { if (LoopCount == -1) { var note = fsc.Notes[CurrentPosition++]; if (note.Rand || CurrentPosition >= fsc.Notes.Count) { RestartFSC(); //current random segment ended. jump to another. note = fsc.Notes[CurrentPosition]; } if (note.Filename != "NONE") { bool play; if (note.Prob > 0) { play = (new Random().Next(16) < note.Prob); } else { play = true; } if (play) { float volume = (note.Volume / 1024.0f) * (fsc.MasterVolume / 1024.0f) * Volume * HITVM.Get().GetMasterVolume(Model.HITVolumeGroup.AMBIENCE); var sound = LoadSound(note.Filename); if (sound != null) { var instance = sound.CreateInstance(); instance.Volume = volume; instance.Pan = (note.LRPan / 512.0f) - 1; instance.Play(); SoundEffects.Add(instance); } } LoopCount = (short)(note.Loop - 1); } } else { LoopCount--; } }