Example #1
0
            public int InsertPaddingChapters()
            {
                int chCount = Chapters.Count;

                if (chCount == 0)
                {
                    return(0);
                }

                var ch = Chapters.First();

                if (ch.Time.Begin > TimeSpan.Zero && !ch.IsPaddingChapter)
                {
                    var preChapter = new Chapter(ch.Time.Begin)
                    {
                        IsPaddingChapter = true
                    };
                    Chapters.Insert(0, preChapter);
                }

                ch = Chapters.Last();
                if (ch.Time.End < this.Duration && !ch.IsPaddingChapter)
                {
                    var postChapter = new Chapter(ch.Time.End, this.Duration)
                    {
                        IsPaddingChapter = true
                    };
                    Chapters.Add(postChapter);
                }

                return(Chapters.Count - chCount);
            }