Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 // 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();
     }
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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();
                }
            }
        }
Exemplo n.º 5
0
        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();
                }
            }
        }
Exemplo n.º 6
0
 private void FocusOnPlayPauseButton()
 {
     ButtonPlayPause.Focus();
 }