private void ReadProfile(string profileName) { Profile profile = null; if ((this.readAvsCfg || this.readVideoCfg) || ((this.readAudioCfg || this.readJobCfg) || this.readSubCfg)) { profile = new Profile(profileName); } if (this.readAvsCfg) { this._avsConfig = profile.AvsConfig; this.readAvsCfg = false; } if (this.readVideoCfg) { this._videoEncConfig = profile.VideoEncConfig; this.readVideoCfg = false; } if (this.readAudioCfg) { this._audioEncConfig = profile.AudioEncConfig; this.readAudioCfg = false; } if (this.readJobCfg) { this._jobConfig = profile.JobConfig; this.readJobCfg = false; } if (this.readSubCfg) { this._subtitleConfig = profile.SubtitleConfig; this.readSubCfg = false; } }
public static void Save(string profileName, JobItemConfig jobConfig, AvisynthConfig avsConfig, VideoEncConfigBase videoEncConfig, AudioEncConfigBase audioEncConfig, Cxgui.Avisynth.SubtitleConfig subtitleConfig) { BinaryFormatter formatter = new BinaryFormatter(); string path = Path.Combine(_profileDir, profileName + ".profile"); Profile graph = new Profile(false); graph._jobConfig = jobConfig; graph._videoEncConfig = (x264Config)videoEncConfig; graph._audioEncConfig = (NeroAacConfig)audioEncConfig; graph._avsConfig = avsConfig; graph._subtitleConfig = subtitleConfig; FileStream serializationStream = new FileStream(path, FileMode.Create); formatter.Serialize(serializationStream, graph); serializationStream.Close(); }