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

            //D.volumeChangeTimer.Stop();
            D.volumeChangeTimer.Start();
        }
Beispiel #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());
     }
 }
Beispiel #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;
            }
        }
Beispiel #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();
            }
        }