public override bool Remove(BassOutputStream stream, Action <BassOutputStream> callBack) { if (!this.Queue.Contains(stream.ChannelHandle)) { Logger.Write(this, LogLevel.Debug, "Stream is not enqueued: {0}", stream.ChannelHandle); return(false); } Logger.Write(this, LogLevel.Debug, "Removing stream from the queue: {0}", stream.ChannelHandle); //If there's only one stream in the queue then we're stopping. //Block so the fade out behaviour can be applied before Reset is called. if (this.Queue.Count() == 1) { BassUtils.OK(BassCrossfade.StreamReset(this.Behaviour.Stop)); callBack(stream); return(true); } //Fork so fade out doesn't block the next track being enqueued. this.Dispatch(() => { BassUtils.OK(BassCrossfade.ChannelRemove(stream.ChannelHandle)); callBack(stream); }); return(true); }