public void BanjoNotesConstructorTest() { BanjoNotes target = new BanjoNotes(); Assert.Inconclusive("TODO: Implement code to verify target"); }
private void update_arrangement(CheckState AutoTrans) { //TODO : Remove all this stuff out of the form and into a class //Open Status dlg screen Logging.Open_Dlg(); txtNoteMatch.Clear(); txtNotes.Clear(); txtNoteMatch.Text = null; txtNotes.Text = null; string referencepath = @""; String filepath1 = Path.GetFullPath(Path.Combine(referencepath, @"..\..\TestFiles\" + txtFileName.Text)); Logging.Update_Status("Loading File : " + filepath1); MidiFileClass MidiControlObject = new MidiFileClass(); ICollection<MidiNotes> MidiObject = new List<MidiNotes>(); int trackNumber; if (Int32.TryParse(txtTrackNumber.Text, out trackNumber)) MidiControlObject.ConvertFile(filepath1, 1, trackNumber, MidiObject); //Note track number 0 being used for the current file else throw new System.ArgumentException("Invalid Track Number. Music be numeric", "Error"); // Create the banjo object BanjoNotes banjoobject = new BanjoNotes(Convert.ToInt16(txtMaxFrets.Text)); //Define the matches structure List<MatchNote> matches = new List<MatchNote>(); //Get the last note position for arrangements MatchNotes.last_note_position = MidiObject.Last().position; int tempo = MidiControlObject.tempo; int timeSig1 = MidiControlObject.timesig1; int timeSig2 = MidiControlObject.timesig2; Arrangemenet_engine.original_note_count = MidiObject.Count(); lblOriginalNotes.Text = Arrangemenet_engine.original_note_count.ToString(); Logging.Update_Status("Starting arrangement Process"); Logging.Update_Status("========================"); Logging.Update_Status("Transpose Offset = " + txtTranspose.Text); Logging.Update_Status("Time Sig = " + timeSig1 + "/" + timeSig2); //Populate the matches bool AutoTrans_ = false; if (AutoTrans == CheckState.Checked) { AutoTrans_ = true; } try { matches = MatchNotes.Find_Matching_Notes(MidiObject, banjoobject, Convert.ToInt16(txtTranspose.Text), Convert.ToInt16(txtMaxFrets.Text),AutoTrans_ ); } catch (Exception Ex) { Logging.Update_Status("Error processing matches"); throw new System.ArgumentException("Error processing matches" + Ex.ToString()); } //TODO All the stuff below is rubbish - General re-wite required for this + move out to a class foreach (MidiNotes temp in MidiObject) { // Pass the current note numbe to the arrangenote object to match txtNotes.Text += "Note Number : " + temp.noteNumber + " Note name:" + temp.noteName + " Note Postion:" + temp.position + "\r\n"; }; int index; foreach (MatchNote temp in matches) { index = matches.IndexOf(temp); // Write the matched note position to the screen txtNoteMatch.Text += "Current Index : " + index + " Position " + temp.position.ToString() + ":" + "Note Number : " + temp.notenumber + ": String Number " + temp.banjoString + ":" + "Fret Number " + temp.fret + " Note name:" + temp.notename + "\r\n"; }; MatchNotes.set_last_match(); }