예제 #1
0
 private void OnSoundFinished(FMODChannel channel)
 {
     if (this.PlayComplete != null)
     {
         this.PlayComplete.BeginInvoke(channel, new AsyncCallback(iar => this.PlayComplete.EndInvoke(iar)), null);
     }
 }
예제 #2
0
 private void OnSoundProgress(FMODChannel channel)
 {
     if (this.PlayProgress != null)
     {
         this.PlayProgress.BeginInvoke(channel, new AsyncCallback(iar => this.PlayProgress.EndInvoke(iar)), null);
     }
 }
예제 #3
0
        private FMODChannel PlayFile(string file, bool play)
        {
            if (string.IsNullOrEmpty(file) || !System.IO.File.Exists(file))
            {
                throw new System.IO.FileNotFoundException("Can't find file", file ?? string.Empty);
            }
            FMOD.Sound sound = this.CreateSoundFromFile(file);

            FMODChannel container = new FMODChannel(this, this.PlaySound(sound, play), Guid.NewGuid());

            lock (this.playingChannels)
                this.playingChannels.Add(container);
            return(container);
        }
예제 #4
0
 /// <summary>
 /// Removes the specified ChannelContainer and nulls it (for garbage collection)
 /// </summary>
 /// <param name="container"></param>
 internal void RemoveContainer(FMODChannel container)
 {
     this.playingChannels.RemoveAll(c => c.ID == container.ID);
 }