示例#1
0
 private IEnumerable <MediaFileInfo> GetFilteredFileData(ComponentRole role)
 {
     // SP-2171: i.MediaFilePath will be empty if the file is zero length (see MediaFileInfo.GetInfo()). This happens often with the generated oral annotation file.
     return(_backgroundStatisticsGather.GetAllFileData()
            .Where(i => !string.IsNullOrEmpty(i.MediaFilePath) && !i.MediaFilePath.EndsWith(Settings.Default.OralAnnotationGeneratedFileSuffix) &&
                   role.IsMatch(i.MediaFilePath)));
 }
示例#2
0
        /// ------------------------------------------------------------------------------------
        public TimeSpan GetRecordingDurations(ComponentRole role)
        {
            var total = _backgroundStatisticsGather.GetAllFileData()
                        .Where(info => role.IsMatch(info.MediaFilePath))
                        .Aggregate(TimeSpan.Zero, (current, info) => current + info.Duration);

            // Trim off the milliseconds so it doesn't get too geeky
            return(new TimeSpan(total.Hours, total.Minutes, total.Seconds));
        }
示例#3
0
        /// ------------------------------------------------------------------------------------
        private long GetTotalComponentRoleFileSizes(ComponentRole role)
        {
            long bytes = 0;

            foreach (var info in _backgroundStatisticsGather.GetAllFileData())
            {
                if (role.IsMatch(info.MediaFilePath))
                {
                    bytes += info.LengthInBytes;
                }
            }

            return(bytes);
        }