예제 #1
0
        private static void OnMasterVolumeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PresetItem D = d as PresetItem;

            //D.volumeChangeTimer.Stop();
            D.volumeChangeTimer.Start();
        }
예제 #2
0
 /// <summary>
 /// Copies this preset into specified preset object.
 /// </summary>
 public void SaveAs(PresetItem dst)
 {
     dst.Name         = Name;
     dst.MasterVolume = MasterVolume;
     dst.Files.Clear();
     foreach (var item in Files)
     {
         dst.Files.Add(item.Clone());
     }
 }
예제 #3
0
        private void LoadPresetButton_Click(object sender, RoutedEventArgs e)
        {
            string     Result = SelectPresetWindow.InstanceLoad(this, config.Presets);
            PresetItem Preset = GetPresetByName(Result);

            if (Preset != null)
            {
                Preset.SaveAs(config.Current);
                config.Current.MasterVolume = -1;
                config.Current.MasterVolume = Preset.MasterVolume;
            }
        }
예제 #4
0
        private void SavePresetButton_Click(object sender, RoutedEventArgs e)
        {
            string Result = SelectPresetWindow.InstanceSave(this, config.Presets);

            if (!string.IsNullOrEmpty(Result))
            {
                PresetItem Preset = GetPresetByName(Result);
                if (Preset == null)
                {
                    Preset = new PresetItem();
                    config.Presets.Add(Preset);
                }
                config.Current.SaveAs(Preset);
                Preset.Name = Result;
                config.Save();
            }
        }