public void SetCurSound(DPanelSound dPanelSound) { soundEngine.Sound(dPanelSound.Path); Time.Content = soundEngine.TimeToString(); DTimeSliderPanel.Maximum = soundEngine.GetTotalTimeMs; ButtonPlayPause.SetIconPause(); if (soundEngine.IS_PLAY == true) { soundEngine.HardPlay(); ButtonPlayPause.SetIconPlay(); } CurnameSound.Content = soundEngine.Name; }
// play \ pause private void DButtonPlayPause_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (soundEngine.IS_PLAY == false) { soundEngine.Play(); ButtonPlayPause.SetIconPlay(); } else { soundEngine.Pause(); ButtonPlayPause.SetIconPause(); } }
private void DButtonBackto_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { // l int c_id = cur_list_sound.FindString(soundEngine.file_) - 1; soundEngine.Sound(cur_list_sound.GetStrID(c_id)); Time.Content = soundEngine.TimeToString(); DTimeSliderPanel.Maximum = soundEngine.GetTotalTimeMs; ButtonPlayPause.SetIconPause(); if (soundEngine.IS_PLAY == true) { soundEngine.HardPlay(); ButtonPlayPause.SetIconPlay(); } CurnameSound.Content = soundEngine.Name; ButtonPlayPause.SetIconPause(); }
private void ButtonNext_Click(object sender, EventArgs e) { // Check if the Current Playing Music isn't the last one on list, and the list isn't clear // and check if the LoopState equale All, to reaPeat the Playlist from the first if (CurrentPlayingMusicIndex != Music.Count - 1 && Music.Count != 0) { MusicInitialize(Music[++CurrentPlayingMusicIndex]); FlowLayoutPanelMusic.ScrollControlIntoView(FlowLayoutPanelMusic.Controls[CurrentPlayingMusicIndex]); } else if (CurrentPlayingMusicIndex == Music.Count - 1) { CurrentPlayingMusicIndex = 0; MusicInitialize(Music[CurrentPlayingMusicIndex]); if (LoopState == LoopState.Off) { ButtonPlayPause.PerformClick(); } } }
private void TimerTick_Tick(object sender, EventArgs e) { if (controlsMouseUpAndDown.IsMouseDown) { soundEngine.Volume = (float)DVolumeSliderpanel.Value / 100; float volume_ = (float)DVolumeSliderpanel.Value; PanelDButtonVolume.SetIconVolume(volume_); settring.Volume = volume_; Save(); //------------ } if (soundEngine.IS_PLAY) { DTimeSliderPanel.CurValue = soundEngine.CurTimeMs; Time.Content = soundEngine.TimeToString(); if (DTimeSliderPanel.CurValue == soundEngine.GetTotalTimeMs) { soundEngine.Stop(); DTimeSliderPanel.CurValue = 0; ButtonPlayPause.SetIconPause(); } } }
private void FocusOnPlayPauseButton() { ButtonPlayPause.Focus(); }