Beispiel #1
0
        public override async Task <IOutputStream> Load(PlaylistItem playlistItem, bool immidiate)
        {
            if (!this.IsStarted)
            {
                await this.Start().ConfigureAwait(false);
            }
            if (BassOutputStreams.Contains(playlistItem.FileName))
            {
                Logger.Write(this, LogLevel.Warn, "The stream is already loaded: {0} => {1}", playlistItem.Id, playlistItem.FileName);
            }
            Logger.Write(this, LogLevel.Debug, "Loading stream: {0} => {1}", playlistItem.Id, playlistItem.FileName);
            var flags = BassFlags.Default;

            if (this.Float)
            {
                flags |= BassFlags.Float;
            }
            var stream = this.StreamFactory.CreateInteractiveStream(playlistItem, immidiate, flags);

            if (stream.IsEmpty)
            {
                return(null);
            }
            var outputStream = new BassOutputStream(this, this.PipelineManager, stream, playlistItem);

            outputStream.InitializeComponent(this.Core);
            this.OnLoaded(outputStream);
            return(outputStream);
        }
Beispiel #2
0
 public override bool IsLoaded(string fileName)
 {
     return(this.IsStarted && BassOutputStreams.Contains(fileName));
 }