From 65aa4c0680487483a0f6b9b995f89465f5aaee6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E5=88=9A?= <1219318552@qq.com> Date: Mon, 10 Jun 2024 04:32:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpart=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/PropertySideBarContentProvider.cs | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/TuneLab/Views/PropertySideBarContentProvider.cs b/TuneLab/Views/PropertySideBarContentProvider.cs index 706497d..c2862ba 100644 --- a/TuneLab/Views/PropertySideBarContentProvider.cs +++ b/TuneLab/Views/PropertySideBarContentProvider.cs @@ -70,7 +70,7 @@ public void SetPart(MidiPart? part) mPartPropertiesController.ValueCommited.Subscribe(OnPartValueCommited, s); mPart.Notes.SelectionChanged.Subscribe(OnNoteSelectionChanged, s); - mPart.Notes.Any(note => note.Properties.PropertyModified).Subscribe(OnNotePropertyChanged, s); + mPart.Notes.Any(note => note.Properties.PropertyModified).Subscribe(OnNotePropertyModified, s); mNotePropertiesController.ValueCommited.Subscribe(OnNoteValueCommited, s); Setup(mPart); @@ -111,7 +111,7 @@ void OnNoteSelectionChanged() RefreshNotePropertiesController(); } - void OnNotePropertyChanged(PropertyPath path) + void OnNotePropertyModified(PropertyPath path) { RefreshNotePropertiesController(); } @@ -212,13 +212,7 @@ void DisplaySelectedNotesProperties(IReadOnlyCollection notes, ObjectConf void OnPartPropertyModified(PropertyPath path) { - if (mPart == null) - return; - - var key = path.GetKey(); - var value = mPart.Properties.GetValue(key); - - mPartPropertiesController.Display(key, value); + RefreshPartPropertiesController(); } void OnPartValueCommited(PropertyPath path, PropertyValue value) @@ -241,13 +235,7 @@ void OnNoteValueCommited(PropertyPath path, PropertyValue value) void OnAutomationDefaultValueModified() { - if (mPart == null) - return; - - foreach (var kvp in mPart.Automations) - { - mAutomationController.Display(new PropertyPath(kvp.Key).GetKey(), kvp.Value.DefaultValue.Value); - } + RefreshAutomationController(); } Head mAutomationHead;