Skip to content

Commit

Permalink
修复part属性错误的刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed Jun 9, 2024
1 parent 4dde3b6 commit 65aa4c0
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions TuneLab/Views/PropertySideBarContentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -111,7 +111,7 @@ void OnNoteSelectionChanged()
RefreshNotePropertiesController();
}

void OnNotePropertyChanged(PropertyPath path)
void OnNotePropertyModified(PropertyPath path)
{
RefreshNotePropertiesController();
}
Expand Down Expand Up @@ -212,13 +212,7 @@ void DisplaySelectedNotesProperties(IReadOnlyCollection<INote> 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)
Expand All @@ -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;
Expand Down

0 comments on commit 65aa4c0

Please sign in to comment.