From 5f056f04321717fece2a469840f7a83d7a175df6 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 20 May 2020 18:20:58 -0400 Subject: [PATCH] reorganization: rename PianoRollEditor to SynthesizedAudioEditor; the piano roll is supposed to be one of several switchable EditorViews for the SynthesizedAudioEditor --- .../Synthesized/{PianoRoll => }/MenuBar.uexml | 2 +- .../Synthesized/{PianoRoll => }/Toolbox.uexml | 2 +- ...lEditor.Content.PlatformIndependent.csproj | 5 +- .../Dialogs/NotePropertiesDialog.cs | 2 +- .../{PianoRoll => }/QuantizationMode.cs | 2 +- ....cs => SynthesizedAudioEditor.Designer.cs} | 14 ++-- ...ollEditor.cs => SynthesizedAudioEditor.cs} | 10 +-- ....cs => SynthesizedAudioEditorSelection.cs} | 9 ++- .../PianoRoll}/PianoRollView.cs | 68 +++++++++++++------ .../PianoRoll/PianoRollViewSelectionMode.cs} | 4 +- ...or.Plugins.Multimedia.UserInterface.csproj | 20 +++--- 11 files changed, 79 insertions(+), 59 deletions(-) rename Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/{PianoRoll => }/MenuBar.uexml (99%) rename Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/{PianoRoll => }/Toolbox.uexml (91%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll => }/Dialogs/NotePropertiesDialog.cs (96%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll => }/QuantizationMode.cs (92%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll/PianoRollEditor.Designer.cs => SynthesizedAudioEditor.Designer.cs} (83%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll/PianoRollEditor.cs => SynthesizedAudioEditor.cs} (89%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRollEditorSelection.cs => SynthesizedAudioEditorSelection.cs} (83%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll/Views => Views/PianoRoll}/PianoRollView.cs (95%) rename Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/{PianoRoll/PianoRollSelectionMode.cs => Views/PianoRoll/PianoRollViewSelectionMode.cs} (89%) diff --git a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/MenuBar.uexml b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/MenuBar.uexml similarity index 99% rename from Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/MenuBar.uexml rename to Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/MenuBar.uexml index 21a22fa0..b4d8b4dc 100644 --- a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/MenuBar.uexml +++ b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/MenuBar.uexml @@ -1,6 +1,6 @@  - + diff --git a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/Toolbox.uexml b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/Toolbox.uexml similarity index 91% rename from Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/Toolbox.uexml rename to Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/Toolbox.uexml index 20d13ae1..72f90454 100644 --- a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/PianoRoll/Toolbox.uexml +++ b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Multimedia/Audio/Synthesized/Toolbox.uexml @@ -1,6 +1,6 @@  - + diff --git a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj index 46481a56..89ad8546 100644 --- a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj +++ b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj @@ -606,7 +606,6 @@ - @@ -736,6 +735,8 @@ + + @@ -754,7 +755,6 @@ - @@ -837,7 +837,6 @@ - diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Dialogs/NotePropertiesDialog.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Dialogs/NotePropertiesDialog.cs similarity index 96% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Dialogs/NotePropertiesDialog.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Dialogs/NotePropertiesDialog.cs index 26d45f9f..ce2d58f8 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Dialogs/NotePropertiesDialog.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Dialogs/NotePropertiesDialog.cs @@ -25,7 +25,7 @@ using MBS.Framework.UserInterface.Controls; using MBS.Framework.UserInterface.Layouts; using UniversalEditor.ObjectModels.Multimedia.Audio.Synthesized; -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Dialogs +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Dialogs { /// /// Provides a UWT -based that modifies the properties of a diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/QuantizationMode.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/QuantizationMode.cs similarity index 92% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/QuantizationMode.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/QuantizationMode.cs index 889442cc..46d4ce94 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/QuantizationMode.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/QuantizationMode.cs @@ -19,7 +19,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System; -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized { public enum QuantizationMode { diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.Designer.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.Designer.cs similarity index 83% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.Designer.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.Designer.cs index eb95c936..fefb213f 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.Designer.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.Designer.cs @@ -26,13 +26,11 @@ using UniversalEditor.UserInterface; using UniversalEditor.ObjectModels.Multimedia.Audio.Synthesized; -using UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views; - -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized { - partial class PianoRollEditor : Editor + partial class SynthesizedAudioEditor : Editor { - public PianoRollEditor() + public SynthesizedAudioEditor() { InitializeComponent(); } @@ -51,10 +49,10 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll return _er; } - private PianoRollView PianoRoll = null; + private Views.PianoRoll.PianoRollView PianoRoll = null; /// - /// UWT designer initialization for . + /// UWT designer initialization for . /// /// /// UWT designer initialization in code is deprecated; continue improving the cross-platform Glade XML parser for ! @@ -63,7 +61,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll { this.Layout = new BoxLayout(Orientation.Vertical); - PianoRoll = new PianoRollView(this); + PianoRoll = new Views.PianoRoll.PianoRollView(this); this.Controls.Add(PianoRoll, new BoxLayout.Constraints(true, true)); } } diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs similarity index 89% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs index ce4c89b9..22da5a25 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollEditor.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditor.cs @@ -23,19 +23,19 @@ using System; using UniversalEditor.ObjectModels.Multimedia.Audio.Synthesized; using UniversalEditor.UserInterface; -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized { /// /// Provides a UWT-based piano roll-style for a . /// - public partial class PianoRollEditor + public partial class SynthesizedAudioEditor { public override void UpdateSelections() { Selections.Clear(); if (PianoRoll.SelectedCommands.Count > 0) { - PianoRollEditorSelection sel = new PianoRollEditorSelection(this, PianoRoll); + SynthesizedAudioEditorSelection sel = new SynthesizedAudioEditorSelection(this, PianoRoll); for (int i = 0; i < PianoRoll.SelectedCommands.Count; i++) { sel.Commands.Add(PianoRoll.SelectedCommands[i]); @@ -103,12 +103,12 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll { case "ToolboxItem_Select": { - PianoRoll.SelectionMode = PianoRollSelectionMode.Select; + PianoRoll.SelectionMode = Views.PianoRoll.PianoRollViewSelectionMode.Select; break; } case "ToolboxItem_Insert": { - PianoRoll.SelectionMode = PianoRollSelectionMode.Insert; + PianoRoll.SelectionMode = Views.PianoRoll.PianoRollViewSelectionMode.Insert; break; } } diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRollEditorSelection.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditorSelection.cs similarity index 83% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRollEditorSelection.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditorSelection.cs index c9a68d1e..4681872f 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRollEditorSelection.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/SynthesizedAudioEditorSelection.cs @@ -18,17 +18,16 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . -using System; -using UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll; + using UniversalEditor.ObjectModels.Multimedia.Audio.Synthesized; using UniversalEditor.UserInterface; namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized { - public class PianoRollEditorSelection : EditorSelection + public class SynthesizedAudioEditorSelection : EditorSelection { - private PianoRoll.Views.PianoRollView _parent = null; - internal PianoRollEditorSelection(Editor editor, PianoRoll.Views.PianoRollView parent) : base(editor) + private Views.PianoRoll.PianoRollView _parent = null; + internal SynthesizedAudioEditorSelection(Editor editor, Views.PianoRoll.PianoRollView parent) : base(editor) { _parent = parent; } diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Views/PianoRollView.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollView.cs similarity index 95% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Views/PianoRollView.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollView.cs index 043d69e1..d4eb6cb3 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/Views/PianoRollView.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollView.cs @@ -31,11 +31,11 @@ using MBS.Framework.UserInterface.Input.Keyboard; using MBS.Framework.UserInterface.Input.Mouse; using MBS.Framework.UserInterface.Layouts; -using UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Dialogs; +using UniversalEditor.Editors.Multimedia.Audio.Synthesized.Dialogs; using UniversalEditor.ObjectModels.Multimedia.Audio.Synthesized; using UniversalEditor.UserInterface; -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Views.PianoRoll { /// /// Provides a UWT-based for manipulating s in a piano roll style. @@ -45,6 +45,8 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views private TextBox txt = null; private SynthesizedAudioCommandNote _EditingNote = null; + private const double MAXSCROLLHEIGHT = 4096; + public PianoRollView(Editor parentEditor) : base(parentEditor) { Layout = new AbsoluteLayout(); @@ -335,15 +337,15 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views private void ContextMenuArrow_Click(object sender, EventArgs e) { - SelectionMode = PianoRollSelectionMode.Select; + SelectionMode = PianoRollViewSelectionMode.Select; } private void ContextMenuPencil_Click(object sender, EventArgs e) { - SelectionMode = PianoRollSelectionMode.Insert; + SelectionMode = PianoRollViewSelectionMode.Insert; } private void ContextMenuErase_Click(object sender, EventArgs e) { - SelectionMode = PianoRollSelectionMode.Delete; + SelectionMode = PianoRollViewSelectionMode.Delete; } private void ContextMenuToggleGridLines_Click(object sender, EventArgs e) { @@ -353,8 +355,8 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views private bool _ShowGridLines = false; public bool ShowGridLines { get { return _ShowGridLines; } set { _ShowGridLines = value; Refresh(); } } - private PianoRollSelectionMode _SelectionMode; - public PianoRollSelectionMode SelectionMode + private PianoRollViewSelectionMode _SelectionMode; + public PianoRollViewSelectionMode SelectionMode { get { return _SelectionMode; } set @@ -362,17 +364,17 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views _SelectionMode = value; switch (_SelectionMode) { - case PianoRollSelectionMode.Insert: + case PianoRollViewSelectionMode.Insert: { Cursor = Cursors.Pencil; break; } - case PianoRollSelectionMode.Select: + case PianoRollViewSelectionMode.Select: { Cursor = Cursors.Default; break; } - case PianoRollSelectionMode.Delete: + case PianoRollViewSelectionMode.Delete: { Cursor = Cursors.Eraser; break; @@ -414,7 +416,26 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views public SynthesizedAudioTrack SelectedTrack { get { return _SelectedTrack; } - set { _SelectedTrack = value; Refresh(); } + set + { + _SelectedTrack = value; + + if (IsCreated) + { + ScrollBounds = new MBS.Framework.Drawing.Dimension2D(GetMaxWidth(), MAXSCROLLHEIGHT); + VerticalAdjustment.Value = MAXSCROLLHEIGHT / 2; + } + + Refresh(); + } + } + + protected override void OnCreated(EventArgs e) + { + base.OnCreated(e); + + ScrollBounds = new MBS.Framework.Drawing.Dimension2D(GetMaxWidth(), MAXSCROLLHEIGHT); + VerticalAdjustment.Value = MAXSCROLLHEIGHT / 2; } public Dimension2D NoteSize { get; set; } = new Dimension2D(12, 16); @@ -565,7 +586,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views { Cursor = Cursors.Default; } - else if (SelectionMode == PianoRollSelectionMode.Insert) + else if (SelectionMode == PianoRollViewSelectionMode.Insert) { Cursor = Cursors.Pencil; } @@ -579,10 +600,10 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views if (ShowKeyboard && dx < KeyboardWidth) dx = KeyboardWidth; - if (draggingCommand == null && (SelectionMode == PianoRollSelectionMode.Select || SelectionMode == PianoRollSelectionMode.Insert)) + if (draggingCommand == null && (SelectionMode == PianoRollViewSelectionMode.Select || SelectionMode == PianoRollViewSelectionMode.Insert)) { drag_CurrentLocation = Quantize(new Vector2D(dx, drag_OriginalLocation.Y), QuantizationMode.Length); - if (SelectionMode == PianoRollSelectionMode.Select) + if (SelectionMode == PianoRollViewSelectionMode.Select) { Rectangle rectSelection = new Rectangle(cx, cy, dx - cx, dy - cy); SynthesizedAudioCommand[] cmds = HitTest(rectSelection); @@ -662,7 +683,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views */ draggingCommand = null; } - else if (SelectionMode == PianoRollSelectionMode.Insert) + else if (SelectionMode == PianoRollViewSelectionMode.Insert) { if (drag_CurrentLocation.X - drag_OriginalLocation.X > 0) { @@ -808,13 +829,12 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views private Rectangle GetKeyboardRect() { - Rectangle keyboardRect = new Rectangle(0, 0, Size.Width, Size.Height); // ClientRectangle - keyboardRect.Width = mvarKeyboardWidth; + Rectangle keyboardRect = new Rectangle(0, 0, mvarKeyboardWidth, ScrollBounds.Height); // ClientRectangle return keyboardRect; } private Rectangle GetGridRect() { - Rectangle gridRect = new Rectangle(0, 0, Size.Width + HorizontalAdjustment.Value, Size.Height); // ClientRectangle; + Rectangle gridRect = new Rectangle(0, 0, Size.Width + HorizontalAdjustment.Value, ScrollBounds.Height); // ClientRectangle; if (mvarShowKeyboard) { Rectangle keyboardRect = GetKeyboardRect(); @@ -858,6 +878,10 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views if (cx > width) width += cx + cw; } + if (width < HorizontalAdjustment.Value + Size.Width) + { + width = (int)(HorizontalAdjustment.Value + (Size.Width * 2)); + } return width; } @@ -892,7 +916,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views SolidBrush sbScaleHighlight = new SolidBrush(SystemColors.HighlightBackground.Alpha(0.25)); SolidBrush sbBlackKeyHighlight = new SolidBrush(Colors.Gray.Alpha(0.125)); - for (int i = 0; i < Size.Height; i += gridHeight) + for (int i = 0; i < ScrollBounds.Height; i += gridHeight) { int noteValue = (int)(((double)i / gridHeight) % 12); string noteName = noteNames[noteValue]; @@ -988,12 +1012,12 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views } else if (m_selecting) { - if (SelectionMode == PianoRollSelectionMode.Select) + if (SelectionMode == PianoRollViewSelectionMode.Select) { e.Graphics.DrawRectangle(pSelectionBorder, new Rectangle(cx, cy, dx - cx, dy - cy)); e.Graphics.FillRectangle(bSelectionFill, new Rectangle(cx, cy, dx - cx, dy - cy)); } - else if (SelectionMode == PianoRollSelectionMode.Insert) + else if (SelectionMode == PianoRollViewSelectionMode.Insert) { Rectangle dragrect = new Rectangle(drag_OriginalLocation.X * PositionQuantization, drag_OriginalLocation.Y * NoteHeight, (drag_CurrentLocation.X * GetLengthQuantization()) - (drag_OriginalLocation.X * GetLengthQuantization()), NoteHeight); if (mvarShowKeyboard) @@ -1006,7 +1030,7 @@ namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll.Views } } - ScrollBounds = new MBS.Framework.Drawing.Dimension2D(GetMaxWidth(), 0); + ScrollBounds = new MBS.Framework.Drawing.Dimension2D(GetMaxWidth(), MAXSCROLLHEIGHT); /* // draw grids for (int i = 0; i < Size.Width; i += (int) NoteSize.Width) diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollSelectionMode.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollViewSelectionMode.cs similarity index 89% rename from Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollSelectionMode.cs rename to Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollViewSelectionMode.cs index 7ef19213..f5ed6dbb 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/PianoRoll/PianoRollSelectionMode.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/Editors/Multimedia/Audio/Synthesized/Views/PianoRoll/PianoRollViewSelectionMode.cs @@ -19,12 +19,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.PianoRoll +namespace UniversalEditor.Editors.Multimedia.Audio.Synthesized.Views.PianoRoll { /// /// Indicates the current selection mode for a . /// - public enum PianoRollSelectionMode + public enum PianoRollViewSelectionMode { Select, Insert, diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj index b80eacac..dd7bd1f8 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj +++ b/Plugins.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface/UniversalEditor.Plugins.Multimedia.UserInterface.csproj @@ -35,11 +35,6 @@ - - - - - @@ -48,8 +43,13 @@ - - + + + + + + + @@ -60,13 +60,13 @@ - - - + + +