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

NoteOn() public method

Plays the current patch.
public NoteOn ( ) : int
return int
        public int NoteOn()
        {
            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
        /// <summary>
        /// Play a note, whose ID resides in the specified variable.
        /// </summary>
        public static HITResult NoteOn(HITThread thread)
        {
            var dest = thread.ReadByte();

            thread.WriteVar(dest, thread.NoteOn());

            return(HITResult.CONTINUE);
        }
All Usage Examples Of FSO.HIT.HITThread::NoteOn