コード例 #1
0
        public E <LocalStr> Enqueue(InvokerData invoker, string message, string audioType = null, MetaData meta = null)
        {
            var result = resourceResolver.Load(message, audioType);

            if (!result)
            {
                return(result.Error);
            }
            return(Enqueue(invoker, new PlaylistItem(result.Value.BaseData, meta)));
        }
コード例 #2
0
        /// <summary>
        /// Goes through a list of <see cref="AudioLogEntry"/> and checks if the contained <see cref="AudioResource"/>
        /// is playable/resolvable.
        /// </summary>
        /// <param name="list">The list to iterate.</param>
        /// <returns>A new list with all working items.</returns>
        private List <AudioLogEntry> FilterList(ResourceResolver resourceFactory, IReadOnlyCollection <AudioLogEntry> list)
        {
            int userNotifyCnt = 0;
            var nextIter      = new List <AudioLogEntry>(list.Count);

            foreach (var entry in list)
            {
                var result = resourceFactory.Load(entry.AudioResource);
                if (!result)
                {
                    Log.Debug("Cleaning: ({0}) Reason: {1}", entry.AudioResource.UniqueId, result.Error);
                    nextIter.Add(entry);
                }

                if (++userNotifyCnt % 100 == 0)
                {
                    Log.Debug("Clean in progress {0}", new string('.', userNotifyCnt / 100 % 10));
                }
            }
            return(nextIter);
        }