Ejemplo n.º 1
0
        private ICacheStream LocateCacheStream(JsonAudioModel audio)
        {
            var          isoStream = __Storage.OpenFile(MakeFileName(audio), FileMode.Open);
            ICacheStream s         = new CacheStream(isoStream, audio);

            s.AudioSize = audio.AudioSize;
            s.Position  = isoStream.Length;
            return(s);
        }
Ejemplo n.º 2
0
        private ICacheStream CreateCacheStream(IAudio audio)
        {
            var audioModel = new JsonAudioModel()
            {
                Artist   = audio.Artist,
                AudioId  = audio.AudioId,
                Duration = audio.Duration,
                Title    = audio.Title,
                UserId   = audio.UserId,
                Index    = audio.Index
            };

            __AudioDict.Add(audioModel.AudioId, audioModel);

            if (!__AudioIdList.ContainsKey(audio.UserId))
            {
                __AudioIdList.Add(audio.UserId, new SortedList <int, long>());
            }

            __AudioIdList[audioModel.UserId].Add(audioModel.Index, audioModel.AudioId);
            ICacheStream s = new CacheStream(__Storage.CreateFile(MakeFileName(audioModel)), audioModel);

            return(s);
        }
Ejemplo n.º 3
0
        private ICacheStream CreateCacheStream(IAudio audio)
        {
            var audioModel = new JsonAudioModel()
            {
                Artist = audio.Artist,
                AudioId = audio.AudioId,
                Duration = audio.Duration,
                Title = audio.Title,
                UserId = audio.UserId,
                Index = audio.Index
            };

            __AudioDict.Add(audioModel.AudioId, audioModel);

            if (!__AudioIdList.ContainsKey(audio.UserId))
                __AudioIdList.Add(audio.UserId, new SortedList<int, long>());

            __AudioIdList[audioModel.UserId].Add(audioModel.Index, audioModel.AudioId);
            ICacheStream s = new CacheStream(__Storage.CreateFile(MakeFileName(audioModel)), audioModel);

            return s;
        }
Ejemplo n.º 4
0
        private ICacheStream LocateCacheStream(JsonAudioModel audio)
        {
            var isoStream = __Storage.OpenFile(MakeFileName(audio), FileMode.Open);
            ICacheStream s = new CacheStream(isoStream, audio);

            s.AudioSize = audio.AudioSize;
            s.Position = isoStream.Length;
            return s;
        }