public List <Chord> FindChord(List <Note> notesEntered) { unknownChord.ChordNoteList = notesEntered; if (notesEntered.Count == 0) { message = "Notes are empty"; } else { unknownChord.RootNote = notesEntered[0]; unknownChord.NoteDifference = Chord.FindNoteRelationship(notesEntered); ChordCacheLoad(unknownChord); if (unknownChord.ChordName == null) { chordsReturned = dao.FindAChord(unknownChord); if (chordsReturned.Count == 1) { chordsReturned[0].Message = "We found your chord!"; } else if (chordsReturned.Count > 1) { chordsReturned[0].Message = "Your chord may be an inversion of one of these chords"; } else { Chord chord = new Chord(); //empty chord to return a message chordsReturned.Add(chord); chordsReturned[0].Message = "Either this is not a formal chord, or we don't have it in our system yet."; } } else { Chord chord = new Chord(); //empty chord to return a message chordsReturned.Add(chord); chordsReturned[0].Message = "Either this is not a formal chord, or we don't have it in our system yet."; } } return(chordsReturned); }
private bool IsNewChord(Chord chord) { chord.RootNote = chord.ChordNoteList[0]; chord.NoteDifference = Chord.FindNoteRelationship(chord.ChordNoteList); if ((chordList == null) || (!chordList.Any())) { chordsReturned = dao.FindAChord(chord); } //I just picked an element that will be there everytime foreach (Chord co in chordsReturned) { if (co.ChordName == null) { return(true); } } return(false); }