コード例 #1
0
ファイル: Player.cs プロジェクト: davomelkumyan40/MusicPlayer
        private void Play(object sender)
        {
            if (!playing)
            {
                if (selectedMusicIndex == -1)
                {
                    music_Track_Bar.Enabled = false;
                    volume_bar.Enabled      = false;
                    volume_btn.Enabled      = false;
                    return;
                }

                ((Button)sender).Image = Properties.Resources.pause_white;
                if (Client == null)
                {
                    Client = new VKManager();
                }
                if (newPlaying)
                {
                    BassCore.Play(Client.FileList[selectedMusicIndex], BassCore.Volume);
                }
                else
                {
                    BassCore.Continue(BassCore.Stream);
                }
                PlayerSet();
            }
            else
            {
                ((Button)sender).Image = Properties.Resources.play_white;
                if (selectedMusicIndex == prevSelectedMusicIndex)
                {
                    BassCore.Pause();
                    PlayerDefaultSet(false);
                }
                else if (selectedMusicIndex != prevSelectedMusicIndex)
                {
                    BassCore.Stop();
                    PlayerDefaultSet(true);
                }
            }
            ((Button)sender).Refresh();
            prevSelectedMusicIndex = selectedMusicIndex;
        }
コード例 #2
0
 private void btnPause_Click(object sender, RoutedEventArgs e)
 {
     BassInstance.Pause();
 }