예제 #1
0
        private static ExtractedSoundLanguageDuration ReadSoundLanguageDuration(IReader reader, byte version)
        {
            if (version > 0)
            {
                throw new InvalidOperationException("Unrecognized \"snld\" block version");
            }

            int originalIndex = reader.ReadInt32();
            var lpd           = new ExtractedSoundLanguageDuration(originalIndex);

            int langcount = reader.ReadInt32();

            for (int l = 0; l < langcount; l++)
            {
                ExtractedSoundLanguageDurationInfo info = new ExtractedSoundLanguageDurationInfo();
                info.Durations     = new System.Collections.Generic.List <int>();
                info.LanguageIndex = reader.ReadInt32();

                int durcount = reader.ReadInt32();
                for (int d = 0; d < durcount; d++)
                {
                    info.Durations.Add(reader.ReadInt32());
                }
                lpd.Languages.Add(info);
            }

            return(lpd);
        }
예제 #2
0
 /// <summary>
 ///     Adds information about a sound language duration to the container.
 /// </summary>
 /// <param name="langDuration">The language duration to add.</param>
 public void AddSoundLanguageDuration(ExtractedSoundLanguageDuration langDuration)
 {
     _soundLanguageDurationsByIndex[langDuration.OriginalIndex] = langDuration;
 }