public void Play(ScoreDetail scoreDetail) { positions = new int[numberOfTracks]; SetTimeBetweenFrames(Convert.ToInt32(ConfigurationManager.AppSettings["Bpm"])); PlayScoreStart(scoreDetail.Creator); PlayScore(scoreDetail); PlayScoreEnd(); }
public ActionResult Create(ScoreDetail scoreDetail) { scoreDetail.Created = DateTime.Now; if (ContainsBadWords(scoreDetail.Creator)) scoreDetail.Played = DateTime.Now; if (ModelState.IsValid) { db.ScoreDetails.Add(scoreDetail); db.SaveChanges(); return RedirectToAction("Index"); } return View(scoreDetail); }
private void PlayScore(ScoreDetail scoreDetail) { var stopwatch = new Stopwatch(); stopwatch.Start(); for (var beatCount = 0; beatCount < Convert.ToInt32(ConfigurationManager.AppSettings["BarsToPlay"]) * 4; beatCount++) { Wait(stopwatch, millisecondsBetweenBeats); PlayNextBeat(scoreDetail); stopwatch.Restart(); } }
private void PlayNextBeat(ScoreDetail scoreDetail) { var score = scoreDetail.Score; SendMessage(m => BuildBeatMessage(score, m)); }