//Returns a new SongProfile based on values of given form controls private SongProfile GetSongFromParams(TextBox pathTextBox, TrackBar volumeTrackbar, TextBox startTextBox) { SongProfile newSong = new SongProfile(pathTextBox.Text, volumeTrackbar.Value); newSong.Start = startTextBox.Enabled ? int.Parse(startTextBox.Text) : 0; return(newSong); }
//Play song with a determined amount of time in seconds public void PlaySong(SongProfile song, bool loop, int duration) { PlaySong(song, loop); timerCount = 0; timerGoal = duration; isPlaying = true; }
//Sets parameters of controls from song private void SetParamsFromSong(SongProfile songProfile, TextBox pathTextBox, TrackBar volumeTrackbar, TextBox startTextBox) { pathTextBox.Text = songProfile.Path; volumeTrackbar.Value = songProfile.Volume; startTextBox.Text = songProfile.Start.ToString(); }
public MusicKit(string name) { Name = name; freezeSong = new SongProfile(); startSong = new SongProfile(); bombSong = new SongProfile(); winSong = new SongProfile(); loseSong = new SongProfile(); MVPSong = new SongProfile(); bombTenSecSong = new SongProfile(); roundTenSecSong = new SongProfile(); mainMenuSong = new SongProfile(); }
//Play song for length or loop indefinitely public void PlaySong(SongProfile song, bool loop) { if (song.Path == "") { return; } float volume = ((float)Properties.MasterVolume / 100) * (float)song.Volume * active; currentSong = song; player.settings.volume = (int)volume; player.URL = song.Path; player.controls.currentPosition = song.Start; player.controls.play(); player.settings.setMode("loop", loop); }