예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         var guitarTune = new GuitarTune(textBox1.Text.Split(' ')
                                         .Select <string, int>(noteName => StaticUsefulStuff.ConvertToNoteIndex(noteName))
                                         .ToArray());
         var notes = StaticUsefulStuff.GetNotes();
         foreach (var desiredNoteIndex in guitarTune.StringTunes)
         {
             if (desiredNoteIndex < 0 || desiredNoteIndex >= notes.Count)
             {
                 throw new Exception();
             }
         }
         tablatureProcessor.ChangeTune(guitarTune);
     }
     catch
     {
         MessageBox.Show("Wrong syntax of desired tune, thus tune was not updated", "Error!");
     }
 }
예제 #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     tablatureProcessor.ChangeTune(GuitarTune.GetDefaultGuitarTune());
     UpdateText();
 }
예제 #3
0
 public void ChangeTuneToThis(GuitarTune newTune)
 {
     this.StringTunes = newTune.StringTunes.Select(x => x).ToArray();
 }
예제 #4
0
 public void ChangeTune(GuitarTune guitarTune)
 {
     this.Tune.ChangeTuneToThis(guitarTune);
 }
예제 #5
0
 public StringRelatedChord(GuitarTune tune, List <int?> frets = null)
 {
     Tune  = tune;
     Frets = frets ?? new List <int?>();
 }
예제 #6
0
 public TablatureProcessor(GuitarTune guitarTune = null)
 {
     this.Tune = guitarTune ?? GuitarTune.GetDefaultGuitarTune();
 }