FSO.HIT.HITThread.NoteLoop C# (CSharp) Method

NoteLoop() public method

Plays the current patch and loops it.
public NoteLoop ( ) : int
return int
        public int NoteLoop()
        {
            var sound = audContent.GetSFX(Patch);

            if (sound != null)
            {
                var instance = sound.CreateInstance();
                instance.Volume = Volume;
                instance.Pan = Pan;
                instance.Play();

                var entry = new HITNoteEntry(instance, Patch);
                Notes.Add(entry);
                NotesByChannel.Add(instance, entry);
                return Notes.Count - 1;
            }
            else
            {
                Debug.WriteLine("HITThread: Couldn't find sound: " + Patch.ToString());
            }
            return -1;
        }

Usage Example

Ejemplo n.º 1
0
        public static HITResult NoteOnLoop(HITThread thread) //0x60
        {
            var dest = thread.ReadByte();

            thread.WriteVar(dest, thread.NoteLoop());
            return(HITResult.HALT);
        }
All Usage Examples Of FSO.HIT.HITThread::NoteLoop