From ebc5352895fbb61f31d7e6f4b48718e5f9be2a0e Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 17 Aug 2011 14:05:33 +0000 Subject: WinGui: Finish migrating the settings over to the new user setting service. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4183 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Controls/AudioPanel.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'win/CS/Controls/AudioPanel.cs') diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index 0d7c1db77..6bfef3cca 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -9,15 +9,18 @@ namespace Handbrake.Controls using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Collections.Specialized; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; + using HandBrake.ApplicationServices; using HandBrake.ApplicationServices.Functions; using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Model.Encoding; using HandBrake.ApplicationServices.Parsing; + using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.ApplicationServices.Utilities; using Handbrake.ToolWindows; @@ -31,6 +34,10 @@ namespace Handbrake.Controls private readonly BindingList audioTracks = new BindingList(); private const string Passthru = "Passthru"; private AdvancedAudio advancedAudio = new AdvancedAudio(); + /// + /// The User Setting Service. + /// + private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService; #endregion #region Constructor and Events @@ -437,7 +444,7 @@ namespace Handbrake.Controls continue; } - if (Properties.Settings.Default.addOnlyOneAudioPerLanguage && currentTrack.TrackDisplay.Contains(sourceTrack.Language)) + if (this.UserSettingService.GetUserSetting(UserSettingConstants.AddOnlyOneAudioPerLanguage) && currentTrack.TrackDisplay.Contains(sourceTrack.Language)) { foundTrack = true; continue; @@ -586,7 +593,7 @@ namespace Handbrake.Controls } // Handle Preferred Language - if (Properties.Settings.Default.NativeLanguage == "Any") + if (this.UserSettingService.GetUserSetting(UserSettingConstants.NativeLanguage) == "Any") { drp_audioTrack.SelectedIndex = 0; foreach (AudioTrack track in this.audioTracks) @@ -603,7 +610,7 @@ namespace Handbrake.Controls { foreach (Audio item in drp_audioTrack.Items) { - if (item.Language.Contains(Properties.Settings.Default.NativeLanguage)) + if (item.Language.Contains(this.UserSettingService.GetUserSetting(UserSettingConstants.NativeLanguage))) { drp_audioTrack.SelectedItem = item; break; @@ -624,11 +631,11 @@ namespace Handbrake.Controls Dictionary languageIndex = new Dictionary(); // Now add any additional Langauges tracks on top of the presets tracks. - int mode = Properties.Settings.Default.DubModeAudio; + int mode = this.UserSettingService.GetUserSetting(UserSettingConstants.DubModeAudio); ArrayList languageOrder = new ArrayList(); // This is used to keep the Prefered Language in the front and the other languages in order. TODO this is no longer required, refactor this. if (mode > 0) { - foreach (string item in Properties.Settings.Default.SelectedLanguages) + foreach (string item in this.UserSettingService.GetUserSetting(UserSettingConstants.SelectedLanguages)) { if (!languageIndex.ContainsKey(item)) { @@ -646,7 +653,7 @@ namespace Handbrake.Controls if (item.ToString().Contains(kvp.Key)) { // Only the first Element if the "Only One Audio"-option is chosen. - if (!Properties.Settings.Default.addOnlyOneAudioPerLanguage || kvp.Value.Count == 0) + if (!this.UserSettingService.GetUserSetting(UserSettingConstants.AddOnlyOneAudioPerLanguage) || kvp.Value.Count == 0) { kvp.Value.Add(i); } -- cgit v1.2.3