// this part of the code will play the sound in the recouces when the picurebox rolls over the new label System.Media.SoundPlayer player = new System.Media.SoundPlayer(); private void BeatDetector_Move(object sender, EventArgs e) { //timeline timing if (timer1.Enabled == true) { } else { if (secs == 0) { mins -= 1; secs = 59; } else if (secs == 59) { mins += 1; secs = 0; } if (lastLocation.X > BeatDetector.Location.X) { secs -= 1; lastLocation.X = BeatDetector.Location.X; } if (lastLocation.X < BeatDetector.Location.X) { secs += 1; lastLocation.X = BeatDetector.Location.X; } TimeSong.Text = mins + ":" + secs + " / " + Mins.Text + ":" + Secs.Text; //making the label beats Label label = new Label(); if (panel1.Contains(label)) { if (BeatDetector.Location.X == label.Location.X) { // this needs to be fixed bool containsLetter = false; string phoneNumber = label.Text.Trim(); for (int i = 0; i < phoneNumber.Length; i++) { if (!char.IsNumber(phoneNumber[i])) { int anInteger; anInteger = Convert.ToInt32(label.Text); anInteger = int.Parse(label.Text); move = anInteger; containsLetter = true; } } if (containsLetter) { // do whatever you want with the error label if (label.Text == "KICK2") { SoundPlayer player = new SoundPlayer(Properties.Resources.KICK2); player.Play(); } } } } } }
// moves timer1 and timer2 and moves the betadetector int move = 1; private void timer2_Tick_1(object sender, EventArgs e) { BeatDetector.Location = new Point(BeatDetector.Location.X + move, BeatDetector.Location.Y); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)