public AudioInfoCacheOnlyProvider(AudioInfo.AudioInfoFactory infoFactory, IAudioStorage cache, long userId, PlayingStateChangedEventHandler optionalStateChangedHandler = null) { __InfoFactory = infoFactory; __Cache = cache; __UserId = userId; __OptionalStateChangedHandler = optionalStateChangedHandler; }
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; }
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); }
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; }