public string GetAudioExtension(EnumAudioType audioType) { string audioExtension = string.Empty; switch (audioType) { case EnumAudioType.AC3: audioExtension = "ac3"; break; case EnumAudioType.FLAC: audioExtension = "flac"; break; case EnumAudioType.TrueHD: audioExtension = "thd"; break; case EnumAudioType.MPA: audioExtension = "mpa"; break; case EnumAudioType.DTSMA: audioExtension = "dtsma"; break; case EnumAudioType.LPCM: audioExtension = "wav"; break; case EnumAudioType.DTSEXPRESS: audioExtension = "dts"; break; case EnumAudioType.M4A: audioExtension = "m4a"; break; default: throw new Exception("Invalid Audio Type"); } return audioExtension; }
public void audioservice_can_get_lpcm_audio_type_name() { //given EnumAudioType audioType = EnumAudioType.LPCM; IAudioService service = new AudioService(); //when string name = service.GetAudioTypeName(audioType); //then name.Should().Be("LPCM"); }
public void audioservice_can_get_truehd_audio_extension() { //given EnumAudioType audioType = EnumAudioType.TrueHD; IAudioService service = new AudioService(); //when string extension = service.GetAudioExtension(audioType); //then extension.Should().Be("thd"); }
public void audioservice_can_get_truehd_audio_type_by_name() { //given string name = "TrueHD"; IAudioService service = new AudioService(); //when EnumAudioType audioType = service.GetAudioTypeByName(name); //then audioType.Should().Be(EnumAudioType.TrueHD); }
public void audioservice_can_get_lpcm_audio_type_by_name() { //given string name = "LPCM"; IAudioService service = new AudioService(); //when EnumAudioType audioType = service.GetAudioTypeByName(name); //then audioType.Should().Be(EnumAudioType.LPCM); }
public void audioservice_can_get_truehd_audio_type_name() { //given EnumAudioType audioType = EnumAudioType.TrueHD; IAudioService service = new AudioService(); //when string name = service.GetAudioTypeName(audioType); //then name.Should().Be("TrueHD"); }
public void audioservice_can_get_dtsexpress_audio_type_by_name() { //given string name = "DTS Express"; IAudioService service = new AudioService(); //when EnumAudioType audioType = service.GetAudioTypeByName(name); //then audioType.Should().Be(EnumAudioType.DTSEXPRESS); }
public void audioservice_can_get_lpcm_audio_extension() { //given EnumAudioType audioType = EnumAudioType.LPCM; IAudioService service = new AudioService(); //when string extension = service.GetAudioExtension(audioType); //then extension.Should().Be("wav"); }
public void audioservice_can_get_dtsexpress_audio_type_name() { //given EnumAudioType audioType = EnumAudioType.DTSEXPRESS; IAudioService service = new AudioService(); //when string name = service.GetAudioTypeName(audioType); //then name.Should().Be("DTS Express"); }
public void audioservice_can_get_dtsma_audio_extension() { //given EnumAudioType audioType = EnumAudioType.DTSMA; IAudioService service = new AudioService(); //when string extension = service.GetAudioExtension(audioType); //then extension.Should().Be("dtsma"); }
private void HandleComboBoxAudioTypeSelectedIndexChanged(string value) { if (_cbAudioTypeChangeTriggeredByDgvAudioCellClick) { _cbAudioTypeChangeTriggeredByDgvAudioCellClick = false; return; } EnumAudioType audioType = _audioService.GetAudioTypeByName(value); _currentBluRayTitleAudio.AudioType = audioType; _currentBluRayTitleAudio.Arguments = ""; }
public string GetAudioTypeName(EnumAudioType audioType) { string name = string.Empty; switch (audioType) { case EnumAudioType.AC3: name = "AC3"; break; case EnumAudioType.FLAC: name = "FLAC"; break; case EnumAudioType.TrueHD: name = "TrueHD"; break; case EnumAudioType.MPA: name = "MPA"; break; case EnumAudioType.DTSMA: name = "DTSMA"; break; case EnumAudioType.LPCM: name = "LPCM"; break; case EnumAudioType.DTSEXPRESS: name = "DTS Express"; break; case EnumAudioType.M4A: name = "M4A"; break; default: throw new Exception("Invalid Audio Type"); } return(name); }
public string GetAudioExtension(EnumAudioType audioType) { string audioExtension = string.Empty; switch (audioType) { case EnumAudioType.AC3: audioExtension = "ac3"; break; case EnumAudioType.FLAC: audioExtension = "flac"; break; case EnumAudioType.TrueHD: audioExtension = "thd"; break; case EnumAudioType.MPA: audioExtension = "mpa"; break; case EnumAudioType.DTSMA: audioExtension = "dtsma"; break; case EnumAudioType.LPCM: audioExtension = "wav"; break; case EnumAudioType.DTSEXPRESS: audioExtension = "dts"; break; case EnumAudioType.M4A: audioExtension = "m4a"; break; default: throw new Exception("Invalid Audio Type"); } return(audioExtension); }
public EnumAudioType GetAudioTypeByName(string name) { EnumAudioType audioType = EnumAudioType.AC3; switch (name) { case "AC3": audioType = EnumAudioType.AC3; break; case "FLAC": audioType = EnumAudioType.FLAC; break; case "TrueHD": audioType = EnumAudioType.TrueHD; break; case "DTSMA": audioType = EnumAudioType.DTSMA; break; case "LPCM": audioType = EnumAudioType.LPCM; break; case "MPA": audioType = EnumAudioType.MPA; break; case "DTS Express": audioType = EnumAudioType.DTSEXPRESS; break; case "M4A": audioType = EnumAudioType.M4A; break; default: throw new Exception("Invalid Audio Type"); } return(audioType); }
/// <summary> /// EA Execution /// </summary> protected override void Execute() { EnumAudioType audioType = EnumAudioType.STEREO; if (_stream is VODAsset) { audioType = (EnumAudioType)Enum.Parse(typeof(EnumAudioType), ((VODAsset)_stream).AudioLanguage[_audioLanguageIndex].Split('-')[1]); } else if (_stream is Service) { audioType = (EnumAudioType)Enum.Parse(typeof(EnumAudioType), ((Service)_stream).AudioLanguage[_audioLanguageIndex].Split('-')[1]); } else { ExceptionUtils.ThrowEx(new EAException(ExitCodes.NoValidParameters, "Wrong type for stream parameter")); } SetReturnValues(new Object[] { audioType }); }
public void SetAudioDefaultSettings() { if (_bluRaySummaryInfo.BluRayTitleInfo.AudioList != null) { foreach (BluRayTitleAudio audio in _bluRaySummaryInfo.BluRayTitleInfo.AudioList) { audio.MKVMergeItem = new MKVMergeItem() { DefaultTrackFlag = "no", ForcedTrackFlag = "no", Language = _languageService.GetLanguageByName(audio.Language), TrackName = "", Compression = "determine automatically" }; } if (_applicationSettings.AudioLanguageAlwaysSelectedEnabled) { foreach (BluRayTitleAudio audio in _bluRaySummaryInfo.BluRayTitleInfo.AudioList.Where(a => a.Text.ToLower().Contains(_applicationSettings.AudioMKVMergeDefaultSettings.DefaultMKVMergeItem.Language.Language.ToLower()))) { if (_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria == "Any Type") { audio.IsSelected = true; this.SetBluRayMKVMergeItemDefaults(audio.MKVMergeItem, _applicationSettings.AudioMKVMergeDefaultSettings.DefaultMKVMergeItem); } else if (_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria == "Lossless") { if (audio.IsLossless) { audio.IsSelected = true; this.SetBluRayMKVMergeItemDefaults(audio.MKVMergeItem, _applicationSettings.AudioMKVMergeDefaultSettings.DefaultMKVMergeItem); } } else { EnumAudioType audioTypeFilter = _audioService.GetAudioTypeByName(_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria); if (audioTypeFilter == audio.OriginalAudioType) { audio.IsSelected = true; this.SetBluRayMKVMergeItemDefaults(audio.MKVMergeItem, _applicationSettings.AudioMKVMergeDefaultSettings.DefaultMKVMergeItem); } } } } } }
private bool SetIsLosslessAudioFlag(EnumAudioType audioType) { bool isLossless = false; switch (audioType) { case EnumAudioType.TrueHD: isLossless = true; break; case EnumAudioType.DTSMA: isLossless = true; break; case EnumAudioType.LPCM: isLossless = true; break; } return(isLossless); }
public EnumAudioType GetAudioType(ProcessOutputLineItem lineItem) { EnumAudioType type = EnumAudioType.AC3; if (this.IsAudioType(lineItem, "dts master audio")) { type = EnumAudioType.DTSMA; } else if (this.IsAudioType(lineItem, "dts express")) { type = EnumAudioType.DTSEXPRESS; } else if (this.IsAudioType(lineItem, "truehd")) { type = EnumAudioType.TrueHD; } else if (this.IsAudioType(lineItem, "pcm")) { type = EnumAudioType.LPCM; } return(type); }
public void SetAudioDefaultSettings() { if (_bluRaySummaryInfo.BluRayTitleInfo.AudioList != null) { foreach (BluRayTitleAudio audio in _bluRaySummaryInfo.BluRayTitleInfo.AudioList) { var defaultSetting = _applicationSettings.BluRayTitleInfoDefaultSettings.Audio.First(a => a.Type == audio.AudioType); audio.Arguments = defaultSetting.Arguments; audio.AudioType = _audioService.GetAudioTypeByName(defaultSetting.DefaultType); } if (_applicationSettings.AudioLanguageAlwaysSelectedEnabled) { foreach (BluRayTitleAudio audio in _bluRaySummaryInfo.BluRayTitleInfo.AudioList.Where(a => a.Text.ToLower().Contains(_applicationSettings.AudioMKVMergeDefaultSettings.DefaultMKVMergeItem.Language.Language.ToLower()))) { if (_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria == "Any Type") { audio.IsSelected = true; } else if (_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria == "Lossless") { if (audio.IsLossless) { audio.IsSelected = true; } } else { EnumAudioType audioTypeFilter = _audioService.GetAudioTypeByName(_applicationSettings.AudioMKVMergeDefaultSettings.AudioTypeFilterCriteria); if (audioTypeFilter == audio.OriginalAudioType) { audio.IsSelected = true; } } } } } }
private bool SetIsLosslessAudioFlag(EnumAudioType audioType) { bool isLossless = false; switch (audioType) { case EnumAudioType.TrueHD: isLossless = true; break; case EnumAudioType.DTSMA: isLossless = true; break; case EnumAudioType.LPCM: isLossless = true; break; } return isLossless; }
public string GetAudioTypeName(EnumAudioType audioType) { string name = string.Empty; switch (audioType) { case EnumAudioType.AC3: name = "AC3"; break; case EnumAudioType.FLAC: name = "FLAC"; break; case EnumAudioType.TrueHD: name = "TrueHD"; break; case EnumAudioType.MPA: name = "MPA"; break; case EnumAudioType.DTSMA: name = "DTSMA"; break; case EnumAudioType.LPCM: name = "LPCM"; break; case EnumAudioType.DTSEXPRESS: name = "DTS Express"; break; case EnumAudioType.M4A: name = "M4A"; break; default: throw new Exception("Invalid Audio Type"); } return name; }