diff --git a/OpenUtau.Core/Util/PianoRollEditTool.cs b/OpenUtau.Core/Util/PianoRollEditTool.cs new file mode 100644 index 000000000..5917ad0fa --- /dev/null +++ b/OpenUtau.Core/Util/PianoRollEditTool.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Newtonsoft.Json; + +namespace OpenUtau.Core.Util { + public enum EditTools { + CursorTool = 0, + PenTool = 10, + PenPlusTool = 11, + EraserTool = 20, + DrawPitchTool = 30, + OverwritePitchTool = 31, + DrawLinePitchTool = 40, + OverwriteLinePitchTool = 41, + KnifeTool = 50 + } + + public class EditTool { + public int BaseTool { get; set; } = 1; + public int PenToolVariation { get; set; } = 0; + public int DrawPitchToolVariation { get; set; } = 0; + public int DrawLinePitchToolVariation { get; set; } = 0; + + [JsonIgnore] + public EditTools CurrentTool { + get { + switch (BaseTool) { + case 1: + if (PenToolVariation == 1) { + return EditTools.PenPlusTool; + } else { + return EditTools.PenTool; + } + case 3: + if (DrawPitchToolVariation == 1) { + return EditTools.OverwritePitchTool; + } else { + return EditTools.DrawPitchTool; + } + case 4: + if (DrawLinePitchToolVariation == 1) { + return EditTools.OverwriteLinePitchTool; + } else { + return EditTools.DrawLinePitchTool; + } + default: + return (EditTools)(BaseTool * 10); + } + } + } + [JsonIgnore] public bool IsPitchTool => BaseTool == 3 || BaseTool == 4; + public bool IsMatch(IEnumerable tools) => tools.Contains(CurrentTool); + } +} diff --git a/OpenUtau.Core/Util/Preferences.cs b/OpenUtau.Core/Util/Preferences.cs index f9b8d4e4e..8dcc79bc5 100644 --- a/OpenUtau.Core/Util/Preferences.cs +++ b/OpenUtau.Core/Util/Preferences.cs @@ -143,7 +143,6 @@ public class SerializablePreferences { public bool ShowPrefs = true; public bool ShowTips = true; public string ThemeName = "Light"; - public bool PenPlusDefault = false; public int DegreeStyle; public bool UseTrackColor = false; public bool ClearCacheOnQuit = false; @@ -181,6 +180,7 @@ public class SerializablePreferences { public bool ShowPortrait = true; public bool ShowIcon = true; public bool ShowGhostNotes = true; + public EditTool EditTool = new EditTool(); public bool PlayTone = true; public bool ShowVibrato = true; public bool ShowPitch = true; diff --git a/OpenUtau/Controls/PianoRoll.axaml b/OpenUtau/Controls/PianoRoll.axaml index a89b2bb0c..a6cd21fe0 100644 --- a/OpenUtau/Controls/PianoRoll.axaml +++ b/OpenUtau/Controls/PianoRoll.axaml @@ -340,6 +340,7 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -657,62 +574,18 @@ PointerPressed="ExpCanvasPointerPressed" PointerMoved="ExpCanvasPointerMoved" PointerReleased="ExpCanvasPointerReleased"/> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + View Vibrato (U) View Waveform (W) View Expressions (L) - Line Draw Pitch Tool (Shift + 4) + Line Draw Pitch Tool (5) Left click to draw (draw straight line) Right click to reset Hold Ctrl to select @@ -514,13 +514,12 @@ Warning: this option removes custom presets. Hold Alt to smoothen Eraser Tool (3) Knife Tool (5) - Overwrite Pitch Tool (Ctrl + 4) + Overwrite Pitch Tool (4) Left click to draw (overwrites vibrato or mod+) Right click to reset Hold Ctrl to select Hold Alt to smoothen - - Line Draw Pitch Tool (Ctrl + Shift + 4) + Overwrite Line Pitch Tool (5) Left click to draw (draw straight line overwrites the vibrato or mod+) Hold Ctrl to draw sine curve @@ -528,8 +527,7 @@ Warning: this option removes custom presets. Hold Alt to draw S-curve Right click to reset Hold Ctrl to select - Hold Alt to smoothen - + Hold Alt to smoothen Pen Plus Tool (Ctrl + 2) Left click to draw Right click to delete @@ -592,7 +590,6 @@ Warning: this option removes custom presets. Reset Select Singer Path - Set Pen Plus Tool as Default Playback Auto-Scroll Auto-Scroll Mode diff --git a/OpenUtau/Styles/PianoRollStyles.axaml b/OpenUtau/Styles/PianoRollStyles.axaml index 93bd1440b..87529becc 100644 --- a/OpenUtau/Styles/PianoRollStyles.axaml +++ b/OpenUtau/Styles/PianoRollStyles.axaml @@ -32,10 +32,8 @@ - @@ -43,29 +41,36 @@ - - - - - + + @@ -77,6 +82,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +