Ejemplo n.º 1
0
        private new void Mouse_Wheel(object sender, MouseWheelEventArgs e)
        {
            if (e.Delta > 0)
            {
                Spotify.GetSetVolume(Spotify.GetSetVolume() + 10);
            }

            else if (e.Delta < 0)
            {
                Spotify.GetSetVolume(Spotify.GetSetVolume() - 10);
            }
        }
Ejemplo n.º 2
0
 private void WebView_AcceleratorKeyPressed(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlAcceleratorKeyPressedEventArgs e)
 {
     if ((e.VirtualKey == Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.VirtualKey.F4 && Keyboard.Modifiers.HasFlag(ModifierKeys.Alt))
         ^ e.VirtualKey == Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.VirtualKey.Escape)
     {
         timer.Stop();
         webView.Navigate((Uri)null);
         this.Close();
         Spotify.GetSetVolume(_volume);
         _window.FullNow(false);
         _window.Visibility = Visibility.Visible;
     }
 }
Ejemplo n.º 3
0
        private void Love_Click(object sender, RoutedEventArgs e)
        {
            ListResponse <bool> tracksSaved = _spotify.CheckSavedTracks(new System.Collections.Generic.List <String> {
                _songID
            });

            if (tracksSaved.List[0])
            {
                Spotify.UnLoveSong(_songID);
                loveClick.Content = "♡";
            }
            else
            {
                Spotify.LoveSong(_songID);
                loveClick.Content = "♥";
            }
        }
Ejemplo n.º 4
0
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            PlaybackContext context = _spotify.GetPlayingTrack();

            webView.Dispatcher.Invoke(() =>
            {
                if (context.Error == null)
                {
                    if (context.Item.Error == null)
                    {
                        String songName   = context.Item.Name;
                        String artistName = context.Item.Artists[0].Name;
                        if (_currentSong != songName)
                        {
                            _currentSong = songName;
                            SearchResource.ListRequest listRequest = youtube.Search.List("snippet");
                            listRequest.MaxResults      = 1;
                            listRequest.Type            = "video";
                            listRequest.Q               = songName + " - " + artistName;
                            listRequest.VideoEmbeddable = SearchResource.ListRequest.VideoEmbeddableEnum.True__;
                            //listRequest.VideoSyndicated = SearchResource.ListRequest.VideoSyndicatedEnum.True__;
                            SearchListResponse resp = listRequest.Execute();

                            string videoID   = resp.Items[0].Id.VideoId;
                            string startTime = (context.ProgressMs / 1000).ToString();
                            if (Spotify.GetSetVolume() != 0)
                            {
                                _volume = Spotify.GetSetVolume();
                            }
                            Spotify.GetSetVolume(0);

                            YoutubePlayer(videoID, startTime);
                        }
                    }
                    else
                    {
                        System.Diagnostics.Debug.WriteLine("Inside- " + context.Error.Message);
                    }
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Outside- " + context.Error.Message);
                }
            });
        }
Ejemplo n.º 5
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left)
     {
         Spotify.PreviousSong();
     }
     else if (e.Key == Key.Right)
     {
         Spotify.NextSong();
     }
     else if (e.Key == Key.Escape)
     {
         timer.Stop();
         this.webView.Navigate((Uri)null);
         this.Close();
         Spotify.GetSetVolume(_volume);
         _window.FullNow(false);
         _window.Visibility = Visibility.Visible;
     }
     e.Handled = true;
 }
Ejemplo n.º 6
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left)
     {
         Spotify.PreviousSong();
     }
     else if (e.Key == Key.Right)
     {
         Spotify.NextSong();
     }
     else if (e.Key == Key.Space ^ e.Key == Key.Enter)
     {
         Spotify.PausePlaySong();
     }
     else if (e.Key == Key.Escape)
     {
         timer.Stop();
         this.Close();
         _window.FullNow(false);
         _window.Visibility = Visibility.Visible;
     }
     e.Handled = true;
 }
Ejemplo n.º 7
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left)
     {
         Spotify.PreviousSong();
     }
     else if (e.Key == Key.Right)
     {
         Spotify.NextSong();
     }
     else if (e.Key == Key.Space ^ e.Key == Key.Enter)
     {
         Spotify.PausePlaySong();
     }
     else if (e.Key == Key.F)
     {
         FullNow(true);
         FullScreen fullScreen = new FullScreen(this);
         fullScreen.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         fullScreen.Show();
         fullScreen.WindowState = WindowState.Maximized;
     }
     e.Handled = true;
 }
Ejemplo n.º 8
0
 private void Self_Click(object sender, RoutedEventArgs e)
 {
     Spotify.UserTrackSuggestion();
 }
Ejemplo n.º 9
0
 private void Previous_Click(object sender, RoutedEventArgs e)
 {
     Spotify.PreviousSong();
 }
Ejemplo n.º 10
0
 private void Next_Click(object sender, RoutedEventArgs e)
 {
     Spotify.NextSong();
 }
Ejemplo n.º 11
0
 private void Cover_Click(object sender, MouseButtonEventArgs e)
 {
     Spotify.PausePlaySong();
 }
Ejemplo n.º 12
0
 private void PausePlay_Click(object sender, RoutedEventArgs e)
 {
     Spotify.PausePlaySong();
 }