コード例 #1
0
        private void ReadTrackEntry(EBMLElement element)
        {
            ulong i = 0;

            while (i < element.DataSize)
            {
                EBMLElement child = new EBMLElement(this, element.DataOffset + i);

                MatroskaID matroska_id = (MatroskaID)child.ID;

                switch (matroska_id)
                {
                case MatroskaID.MatroskaTrackType: {
                    TrackType track_type = (TrackType)child.ReadUInt();

                    switch (track_type)
                    {
                    case TrackType.Video: {
                        VideoTrack track = new VideoTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    case TrackType.Audio: {
                        AudioTrack track = new AudioTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    case TrackType.Subtitle: {
                        SubtitleTrack track = new SubtitleTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    default:
                        break;
                    }
                    break;
                }

                default:
                    break;
                }

                i += child.Size;
            }
        }
コード例 #2
0
ファイル: File.cs プロジェクト: JohnThomson/taglib-sharp
        private void ReadTrackEntry (EBMLElement element)
        {
            ulong i = 0;

            while (i < element.DataSize) {
                EBMLElement child = new EBMLElement (this, element.DataOffset + i);

                MatroskaID matroska_id = (MatroskaID) child.ID;

                switch (matroska_id) {
                    case MatroskaID.MatroskaTrackType: {
                            TrackType track_type = (TrackType) child.ReadUInt ();

                            switch (track_type) {
                                case TrackType.Video: {
                                        VideoTrack track = new VideoTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                case TrackType.Audio: {
                                        AudioTrack track = new AudioTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                case TrackType.Subtitle: {
                                        SubtitleTrack track = new SubtitleTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                default:
                                    break;
                            }
                            break;
                        }
                    default:
                        break;
                }

                i += child.Size;
            }
        }