[banshee] [Equalizer] copy EQ of current preset to new
- From: Aaron Bockover <abock src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [Equalizer] copy EQ of current preset to new
- Date: Thu, 11 Feb 2010 00:32:55 +0000 (UTC)
commit 298012980a39b4c7c9b01f11cec5385479546b41
Author: Aaron Bockover <abockover novell com>
Date: Wed Feb 10 19:32:45 2010 -0500
[Equalizer] copy EQ of current preset to new
When creating a new preset, copy the levels from the current preset to
the new preset, since cloning is probably more useful than zeroing, and
I don't want to introduce more UI.
Also fix a bug where the preset name is not focused when creating a new
preset.
.../Banshee.Equalizer/EqualizerSetting.cs | 8 ++++++++
.../Banshee.Equalizer.Gui/EqualizerWindow.cs | 5 +++--
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerSetting.cs b/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerSetting.cs
index 7f2cd7d..d41bb68 100644
--- a/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerSetting.cs
+++ b/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerSetting.cs
@@ -136,6 +136,14 @@ namespace Banshee.Equalizer
OnChanged ();
}
+ public void SetFrom (EqualizerSetting eq)
+ {
+ if (eq != null) {
+ amp = eq.amp;
+ eq.bands.CopyTo (bands, 0);
+ }
+ }
+
protected virtual void OnChanged ()
{
EventHandler handler = Changed;
diff --git a/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerWindow.cs b/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerWindow.cs
index 748bba6..9675b0f 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerWindow.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerWindow.cs
@@ -141,11 +141,12 @@ namespace Banshee.Equalizer.Gui
private void OnNewPreset (object o, EventArgs args)
{
- EqualizerSetting eq = new EqualizerSetting (EqualizerManager.Instance,
- Catalog.GetString ("New Preset"));
+ var eq = new EqualizerSetting (EqualizerManager.Instance, Catalog.GetString ("New Preset"));
+ eq.SetFrom (eq_preset_combo.ActiveEqualizer);
EqualizerManager.Instance.Add (eq);
eq_preset_combo.ActiveEqualizer = eq;
eq_preset_combo.Entry.SelectRegion (0, eq_preset_combo.Entry.Text.Length);
+ eq_preset_combo.Entry.HasFocus = true;
}
private void OnDeletePreset (object o, EventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]