public MKVMergeBatchFileWriteForEncodeService(BatchGuyEAC3ToSettings batchGuyEAC3ToSettings, IDirectorySystemService directorySystemService, IAudioService audioService, AbstractEAC3ToOutputNamingService eac3ToOutputNamingService, IEAC3ToCommonRulesValidatorService eac3ToCommonRulesValidatorService) { _batchGuyEAC3ToSettings = batchGuyEAC3ToSettings; _bluRayDiscInfoList = _batchGuyEAC3ToSettings.BluRayDiscs; _eac3toConfiguration = _batchGuyEAC3ToSettings.EAC3ToSettings; _directorySystemService = directorySystemService; _audioService = audioService; _eac3ToOutputNamingService = eac3ToOutputNamingService; _eac3ToCommonRulesValidatorService = eac3ToCommonRulesValidatorService; _errors = new ErrorCollection(); }
public void Save(string settingsFile, BatchGuyEAC3ToSettings batchGuyEAC3ToSettings) { try { _jsonSerializationService.WriteToJsonFile(settingsFile, batchGuyEAC3ToSettings, false); } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = "There was a problem saving the BatchGuy eac3to Settings File" }); } }
public BatchGuyEAC3ToSettings GetBatchGuyEAC3ToSettings(string settingsFile) { BatchGuyEAC3ToSettings batchGuyEAC3ToSettings = null; try { batchGuyEAC3ToSettings = _jsonSerializationService.ReadFromJsonFile <BatchGuyEAC3ToSettings>(settingsFile); } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = "There was a problem loading the BatchGuy eac3to Settings File" }); } return(batchGuyEAC3ToSettings); }
private void HandlesLoadToolStripMenuItemClick(string settingsFile) { try { if (!string.IsNullOrEmpty(settingsFile)) { IJsonSerializationService <BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService <BatchGuyEAC3ToSettings>(); IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService); _batchGuyEAC3ToSettings = batchGuyEAC3ToSettingsService.GetBatchGuyEAC3ToSettings(settingsFile); if (batchGuyEAC3ToSettingsService.Errors.Count() > 0) { MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (_batchGuyEAC3ToSettings.EAC3ToSettings.IsExtractForRemux) { MessageBox.Show("You cannot load a (.batchGuyEac3toSettings) file that is for Remuxing!", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { this._encodeTypeChangedBecauseOfSettingsLoad = true; this.LoadEpisodeNumbers(); this.LoadScreen(); gbScreen.SetEnabled(true); saveToolStripMenuItem.Enabled = true; createX264BatchFileToolStripMenuItem.Enabled = true; createMkvmergeBatchFileToolStripMenuItem.Enabled = true; } } } catch (Exception ex) { _displayErrorMessageService.LogAndDisplayError(new ErrorMessage() { DisplayMessage = "There was an error trying to load the eac3to Settings File!", DisplayTitle = "Error.", Exception = ex, MethodNameWhereExceptionOccurred = MethodBase.GetCurrentMethod().Name }); } }
private void HandlesLoadToolStripMenuItemClick(string settingsFile) { if (!string.IsNullOrEmpty(settingsFile)) { IJsonSerializationService <BatchGuyEAC3ToSettings> jsonSerializationService = new JsonSerializationService <BatchGuyEAC3ToSettings>(); IBatchGuyEAC3ToSettingsService batchGuyEAC3ToSettingsService = new BatchGuyEAC3ToSettingsService(jsonSerializationService); _batchGuyEAC3ToSettings = batchGuyEAC3ToSettingsService.GetBatchGuyEAC3ToSettings(settingsFile); if (batchGuyEAC3ToSettingsService.Errors.Count() > 0) { MessageBox.Show(batchGuyEAC3ToSettingsService.Errors.GetErrorMessage(), "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (_batchGuyEAC3ToSettings.EAC3ToSettings.IsExtractForRemux) { MessageBox.Show("You cannot load a (.batchGuyEac3toSettings) file that is for Remuxing!", "Error Occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { this.LoadScreen(); gbScreen.SetEnabled(true); saveToolStripMenuItem.Enabled = true; createAviSynthavsFilesToolStripMenuItem.Enabled = true; } } }