Ejemplo n.º 1
0
        /// <summary>
        /// Plays the current patch and loops it.
        /// </summary>
        /// <returns>-1 if unsuccessful, or the id of the note played.</returns>
        public int NoteLoop() //todo, make loop again.
        {
            var sound = audContent.GetSFX(Patch);

            if (sound != null)
            {
                var instance = sound.CreateInstance();
                instance.Volume = Volume;
                if (Emitter3D == null)
                {
                    instance.Pan = Pan;
                }
                else
                {
                    Apply3D(instance);
                }
                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");
            }
            return(-1);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Plays the current patch and loops it indefinitely.
        /// </summary>
        /// <returns>-1 if unsuccessful, or the id of the note played.</returns>
        public int NoteLoop() //todo, make loop again.
        {
            var sound = audContent.GetSFX(Patch);

            if (sound != null)
            {
                switch (sound.Name)
                {
                case "FX":
                    VolGroup = Model.HITVolumeGroup.FX; break;

                case "MUSIC":
                    VolGroup = Model.HITVolumeGroup.MUSIC; break;

                case "VOX":
                    VolGroup = Model.HITVolumeGroup.VOX; break;
                }
                RecalculateVolume();

                var instance = sound.CreateInstance();
                instance.Volume = Volume;
                if (Emitter3D == null)
                {
                    instance.Pan = Pan;
                }
                else
                {
                    Apply3D(instance);
                }
                instance.IsLooped = true;
                //instance.Play();

                var entry = new HITNoteEntry(sound, instance, Patch, TickN);
                VM.QueuePlay(entry);
                Notes.Add(entry);
                NotesByChannel.Add(instance, entry);
                return(Notes.Count - 1);
            }
            else
            {
                Debug.WriteLine("HITThread: Couldn't find sound");
            }
            return(-1);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Plays the current patch.
        /// </summary>
        /// <returns>-1 if unsuccessful, or the id of the note played.</returns>
        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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Plays the current patch.
        /// </summary>
        /// <returns>-1 if unsuccessful, or the id of the note played.</returns>
        public int NoteOn()
        {
            var sound = audContent.GetSFX(Patch);

            if (sound != null)
            {
                switch (sound.Name)
                {
                case "FX":
                    VolGroup = Model.HITVolumeGroup.FX; break;

                case "MUSIC":
                    VolGroup = Model.HITVolumeGroup.MUSIC; break;

                case "VOX":
                    VolGroup = Model.HITVolumeGroup.VOX; break;
                }
                RecalculateVolume();

                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");
            }

            return(-1);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Plays the current patch.
        /// </summary>
        /// <returns>-1 if unsuccessful, or the id of the note played.</returns>
        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;
        }
Ejemplo n.º 6
0
 public void QueuePlay(HITNoteEntry note)
 {
     PlayQueue.Add(note);
 }