Example #1
0
 public AudioInfoCacheOnlyProvider(AudioInfo.AudioInfoFactory infoFactory,
                                   IAudioStorage cache,
                                   long userId,
                                   PlayingStateChangedEventHandler optionalStateChangedHandler = null)
 {
     __InfoFactory = infoFactory;
     __Cache       = cache;
     __UserId      = userId;
     __OptionalStateChangedHandler = optionalStateChangedHandler;
 }
Example #2
0
 public AudioInfoProvider(Func <long, int, int, ReadOnlyCollection <Audio> > getAudio,
                          Func <long, int> getCount,
                          AudioInfo.AudioInfoFactory infoFactory,
                          long userId,
                          PlayingStateChangedEventHandler optionalStateChangedHandler = null)
 {
     __GetAudio    = getAudio;
     __GetCount    = getCount;
     __InfoFactory = infoFactory;
     __UserId      = userId;
     __OptionalStateChangedHandler = optionalStateChangedHandler;
 }
Example #3
0
        private AudioInfo.AudioInfoFactory GetFactory(IWebDownloader downloader, out PlayingStateChangedEventHandler handler)
        {
            var factory = new AudioInfo.AudioInfoFactory(__AudioStorage, downloader);

            handler = playable =>
            {
                if (__IsDisposingNow == 0)
                {
                    if (playable.State == PlayingState.Playing)
                    {
                        __OpenedChannels.Add(playable);
                    }
                    else if (playable.State == PlayingState.Stopped)
                    {
                        __OpenedChannels.Remove(playable);
                    }
                }
            };
            return(factory);
        }
Example #4
0
 private AudioInfo.AudioInfoFactory GetFactory(IWebDownloader downloader, out PlayingStateChangedEventHandler handler)
 {
     var factory = new AudioInfo.AudioInfoFactory(__AudioStorage, downloader);
     handler = playable =>
     {
         if (__IsDisposingNow == 0)
         {
             if (playable.State == PlayingState.Playing)
                 __OpenedChannels.Add(playable);
             else if (playable.State == PlayingState.Stopped)
                 __OpenedChannels.Remove(playable);
         }
     };
     return factory;
 }