Skip to content

Commit

Permalink
Added additional objects detection settings to ManageNotes/ManageChor…
Browse files Browse the repository at this point in the history
…ds methods
  • Loading branch information
melanchall committed Aug 10, 2024
1 parent 3d41e0b commit 6cbb5d6
Show file tree
Hide file tree
Showing 12 changed files with 850 additions and 114 deletions.
16 changes: 0 additions & 16 deletions DryWetMidi.Tests/Interaction/Chords/ChordTestUtilities.cs

This file was deleted.

23 changes: 23 additions & 0 deletions DryWetMidi.Tests/Interaction/Chords/ChordTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,29 @@ public void CheckChordOffVelocity()

#endregion

#region GetMusicTheoryChord

[Test]
public void GetMusicTheoryChord()
{
var chord = new Chord(
new Note(DryWetMidi.MusicTheory.NoteName.C, 2),
new Note(DryWetMidi.MusicTheory.NoteName.A, 1),
new Note(DryWetMidi.MusicTheory.NoteName.DSharp, 2));

Assert.AreEqual(
new DryWetMidi.MusicTheory.Chord(new[]
{
DryWetMidi.MusicTheory.NoteName.A,
DryWetMidi.MusicTheory.NoteName.C,
DryWetMidi.MusicTheory.NoteName.DSharp
}),
chord.GetMusicTheoryChord(),
"Chord is invalid.");
}

#endregion

#endregion

#region Private methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ public override bool Equals(object obj)

#region Constants

private static readonly ChordMethods ChordMethods = new ChordMethods();
private static readonly Func<TimedEventData, CustomTimedEvent> CustomTimedEventConstructor =
data => new CustomTimedEvent(
data.Event,
data.Time,
data.EventsCollectionIndex,
data.EventIndex);

private static readonly TimedEventDetectionSettings CustomEventSettings = new TimedEventDetectionSettings
{
Constructor = data => new CustomTimedEvent(data.Event, data.Time, data.EventsCollectionIndex, data.EventIndex)
Constructor = CustomTimedEventConstructor
};

private static readonly Func<NoteData, Note> CustomNoteConstructor =
Expand Down
Loading

0 comments on commit 6cbb5d6

Please sign in to comment.