private static void TunePlay2(object tuneObj) { Tune tune = (Tune)tuneObj; foreach (Note note in tune.notes) { PlayNote(note); if (Stop) { break; } } Paused = false; Stopped2 = true; }
private static void TunePlay(object tuneObj) { Tune tune = (Tune)tuneObj; if (tune.Loop) { while (!Stop) { foreach (Note note in tune.notes) { while (Paused) { ; } PlayNote(note); if (Stop) { break; } } } } else { foreach (Note note in tune.notes) { while (Paused) { ; } PlayNote(note); if (Stop) { break; } } } Stopped = true; }