public static List <EncoderProfile> ImportProfiles(string fileName)
        {
            List <EncoderProfile> importedProfiles = new List <EncoderProfile>();

            XmlSerializer serializer    = new XmlSerializer(typeof(XmlProfiles));
            XmlTextReader xmlTextReader = new XmlTextReader(fileName);
            XmlProfiles   xmlProfiles   = (XmlProfiles)serializer.Deserialize(xmlTextReader);


            StreamCopyProfile copyProfile = new StreamCopyProfile();

            importedProfiles.Add(copyProfile);

            xmlProfiles.QuickSelectProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.QuickSelectProfiles);

            xmlProfiles.X264Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.X264Profiles);

            xmlProfiles.HcEncProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.HcEncProfiles);

            xmlProfiles.VP8Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.VP8Profiles);

            xmlProfiles.AC3Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.AC3Profiles);

            xmlProfiles.OggProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.OggProfiles);

            xmlProfiles.MP3Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.MP3Profiles);

            xmlProfiles.AACProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.AACProfiles);
            xmlTextReader.Close();

            return(importedProfiles);
        }
Example #2
0
        public static List<EncoderProfile> ImportProfiles(string fileName)
        {
            List<EncoderProfile> importedProfiles = new List<EncoderProfile>();

            XmlSerializer serializer = new XmlSerializer(typeof(XmlProfiles));
            XmlTextReader xmlTextReader = new XmlTextReader(fileName);
            XmlProfiles xmlProfiles = (XmlProfiles)serializer.Deserialize(xmlTextReader);

            StreamCopyProfile copyProfile = new StreamCopyProfile();
            importedProfiles.Add(copyProfile);

            xmlProfiles.QuickSelectProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.QuickSelectProfiles);

            xmlProfiles.X264Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.X264Profiles);

            xmlProfiles.HcEncProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.HcEncProfiles);

            xmlProfiles.VP8Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.VP8Profiles);

            xmlProfiles.AC3Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.AC3Profiles);

            xmlProfiles.OggProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.OggProfiles);

            xmlProfiles.MP3Profiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.MP3Profiles);

            xmlProfiles.AACProfiles.Sort((p1, p2) => String.Compare(p1.Name, p2.Name, StringComparison.Ordinal));
            importedProfiles.AddRange(xmlProfiles.AACProfiles);
            xmlTextReader.Close();

            return importedProfiles;
        }