Ejemplo n.º 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!");
     }
 }
Ejemplo n.º 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     tablatureProcessor.ChangeTune(GuitarTune.GetDefaultGuitarTune());
     UpdateText();
 }
Ejemplo n.º 3
0
 public void ChangeTuneToThis(GuitarTune newTune)
 {
     this.StringTunes = newTune.StringTunes.Select(x => x).ToArray();
 }
Ejemplo n.º 4
0
 public void ChangeTune(GuitarTune guitarTune)
 {
     this.Tune.ChangeTuneToThis(guitarTune);
 }
Ejemplo n.º 5
0
 public StringRelatedChord(GuitarTune tune, List <int?> frets = null)
 {
     Tune  = tune;
     Frets = frets ?? new List <int?>();
 }
Ejemplo n.º 6
0
 public TablatureProcessor(GuitarTune guitarTune = null)
 {
     this.Tune = guitarTune ?? GuitarTune.GetDefaultGuitarTune();
 }