Пример #1
0
        public Profile(string profileName)
        {
            FileStream      stream = null;
            Profile         profile;
            string          path      = Path.Combine(_profileDir, profileName + ".profile");
            BinaryFormatter formatter = new BinaryFormatter();

            if (!File.Exists(path))
            {
                throw new ProfileNotFoundException("profile文件未找到");
            }
            try
            {
                stream  = new FileStream(path, FileMode.Open);
                profile = formatter.Deserialize(stream) as Profile;
                stream.Close();
            }
            catch (Exception)
            {
                stream.Close();
                throw new ProfileNotFoundException("profile文件损坏");
            }
            this._avsConfig      = profile._avsConfig;
            this._videoEncConfig = profile._videoEncConfig;
            this._audioEncConfig = profile._audioEncConfig;
            this._jobConfig      = profile._jobConfig;
            this._subtitleConfig = profile._subtitleConfig;
        }
Пример #2
0
 public Profile(bool initializeConfig)
 {
     if (initializeConfig)
     {
         this._avsConfig      = new AvisynthConfig();
         this._videoEncConfig = new x264Config();
         this._audioEncConfig = new NeroAacConfig();
         this._jobConfig      = new JobItemConfig();
         this._subtitleConfig = new Cxgui.Avisynth.SubtitleConfig();
     }
 }