示例#1
0
        internal AudioPlayable(IAudio audio, IAudioStorage storage, IWebDownloader downloader, Uri url)
        {
            __Audio = audio;
            __Storage = storage;
            __Downloader = downloader;
            __Url = url;

            __BassFileProcs = new BASS_FILEPROCS(user => { },
                                                 user => 
                                                     __CacheStream.AudioSize,
                                                 BassReadProc,
                                                 (offset, user) => true);

            __EndStreamProc = (handle, channel, data, user) =>
            {
                __RequestTasksStop = true;
                CleanActions();
                OnAudioNaturallyEnded();
            };

            if (storage.CheckCached(audio))
            {
                DownloadedFracion = 1.0;
            }
        }
示例#2
0
        internal AudioPlayable(IAudio audio, IAudioStorage storage, IWebDownloader downloader, Uri url)
        {
            __Audio      = audio;
            __Storage    = storage;
            __Downloader = downloader;
            __Url        = url;

            __BassFileProcs = new BASS_FILEPROCS(user => { },
                                                 user =>
                                                 __CacheStream.AudioSize,
                                                 BassReadProc,
                                                 (offset, user) => true);

            __EndStreamProc = (handle, channel, data, user) =>
            {
                __RequestTasksStop = true;
                CleanActions();
                OnAudioNaturallyEnded();
            };

            if (storage.CheckCached(audio))
            {
                DownloadedFracion = 1.0;
            }
        }
 public TrackFileQueryHandler(
     IRepository <Entities.Track> repository,
     IAudioStorage audioStorage
     )
 {
     this._repository   = repository;
     this._audioStorage = audioStorage;
 }
示例#4
0
 public AudioInfoCacheOnlyProvider(AudioInfo.AudioInfoFactory infoFactory,
                                   IAudioStorage cache,
                                   long userId,
                                   PlayingStateChangedEventHandler optionalStateChangedHandler = null)
 {
     __InfoFactory = infoFactory;
     __Cache       = cache;
     __UserId      = userId;
     __OptionalStateChangedHandler = optionalStateChangedHandler;
 }
 public UploadFileCommandHandler(
     IMediator mediator,
     IAudioUploadingMessageBroker audioUploadingMessageBroker,
     IAudioStorage audioStorage
     )
 {
     this._mediator = mediator;
     this._audioUploadingMessageBroker = audioUploadingMessageBroker;
     this._audioStorage = audioStorage;
 }
示例#6
0
        internal AudioPlayableMediator(IAudioStorage storage, IWebDownloader downloader, IAudio audio, Uri url)
        {
            __InternalPlayable = new AudioPlayable(audio, storage, downloader, url);
            __InternalPlayable.DownloadedFracionChanged += OnPercentsDownloadedChanged;
            __InternalPlayable.AudioNaturallyEnded      += WhenStop;

            __Duration = audio.Duration;
            __PlaybackTimer.Elapsed  += (sender, args) => OnSecondsPlayedChanged();
            __PlaybackTimer.AutoReset = true;
        }
示例#7
0
        internal AudioPlayableMediator(IAudioStorage storage, IWebDownloader downloader, IAudio audio, Uri url)
        {
            __InternalPlayable = new AudioPlayable(audio, storage, downloader, url);
            __InternalPlayable.DownloadedFracionChanged += OnPercentsDownloadedChanged;
            __InternalPlayable.AudioNaturallyEnded += WhenStop;

            __Duration = audio.Duration;
            __PlaybackTimer.Elapsed += (sender, args) => OnSecondsPlayedChanged();
            __PlaybackTimer.AutoReset = true;
        }
示例#8
0
        private AudioInfo(IAudioStorage storage, IWebDownloader downloader,
                          long audioId, long userId, string title, string artist, int duration, int index, Uri url)
        {
            __AudioId  = audioId;
            __UserId   = userId;
            __Title    = title;
            __Artist   = artist;
            __Duration = duration;
            __Index    = index;

            __Playable = new AudioPlayableMediator(storage, downloader, this, url);
        }
示例#9
0
        private AudioInfo(IAudioStorage storage, IWebDownloader downloader,
            long audioId, long userId, string title, string artist, int duration, int index, Uri url)
        {
            __AudioId = audioId;
            __UserId = userId;
            __Title = title;
            __Artist = artist;
            __Duration = duration;
            __Index = index;

            __Playable = new AudioPlayableMediator(storage, downloader, this, url);
        }
示例#10
0
 public AudioInfoFactory(IAudioStorage storage, IWebDownloader downloader)
 {
     __Storage    = storage;
     __Downloader = downloader;
 }
示例#11
0
 public Account(IFileStorage storage)
 {
     __AudioStorage = new CacheStorage.CacheStorage(storage);
 }
示例#12
0
 public AudioInfoFactory(IAudioStorage storage, IWebDownloader downloader)
 {
     __Storage = storage;
     __Downloader = downloader;
 }
示例#13
0
 public Account(IFileStorage storage)
 {
     __AudioStorage = new CacheStorage.CacheStorage(storage);
 }