예제 #1
0
        public bool CopyTo(GlobalPrefs dest)
        {
            bool changed = false;

            Debug.Assert(this.items.Length == dest.items.Length);
            for (int i = 0; i < this.items.Length; i++)
            {
                Debug.Assert(this.items[i].GetType() == dest.items[i].GetType());
                changed = this.items[i].CopyTo(dest.items[i]) || changed;
            }
            return(changed);
        }
예제 #2
0
        public GlobalPrefsDialog(GlobalPrefs primaryPrefs)
        {
            this.primaryPrefs = primaryPrefs;
            localPrefs        = new GlobalPrefs();
            primaryPrefs.CopyTo(localPrefs);

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            devices = OutputDeviceEnumerator.EnumerateAudioOutputDeviceIdentifiers();
            for (int i = 0; i < devices.Length; i++)
            {
                comboBoxOutputDevice.Items.Add(devices[i].Value);
                if (String.Equals(devices[i].Key, localPrefs.OutputDevice))
                {
                    comboBoxOutputDevice.SelectedIndex = i;
                }
            }

            for (int i = 0; i < Priorities.Length; i++)
            {
                comboBoxPriority.Items.Add(Priorities[i].Key);
                if (Priorities[i].Value == localPrefs.PriorityMode)
                {
                    comboBoxPriority.SelectedIndex = i;
                }
            }

            concurrency = localPrefs.Concurrency;
            UpdateConcurrencyEnables();

            bool zoomSet = false;

            for (int i = 0; i < ZoomLevels.Length; i++)
            {
                comboBoxZoom.Items.Add(ZoomLevels[i]);
                if (!zoomSet && (primaryPrefs.AdditionalUIZoom <= ZoomLevels[i]))
                {
                    zoomSet = true;
                    comboBoxZoom.SelectedIndex = i;
                }
            }
            if (!zoomSet)
            {
                comboBoxZoom.SelectedIndex = ZoomLevels.Length - 1;
            }

            globalPrefsBindingSource.Add(localPrefs);
        }