コード例 #1
0
ファイル: FullScreen.xaml.cs プロジェクト: novatorem/Melodify
        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);
            }
        }
コード例 #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;
     }
 }
コード例 #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 = "♥";
            }
        }
コード例 #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);
                }
            });
        }
コード例 #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;
 }
コード例 #6
0
ファイル: FullScreen.xaml.cs プロジェクト: novatorem/Melodify
 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;
 }
コード例 #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;
 }
コード例 #8
0
 private void Self_Click(object sender, RoutedEventArgs e)
 {
     Spotify.UserTrackSuggestion();
 }
コード例 #9
0
ファイル: FullScreen.xaml.cs プロジェクト: novatorem/Melodify
 private void Previous_Click(object sender, RoutedEventArgs e)
 {
     Spotify.PreviousSong();
 }
コード例 #10
0
ファイル: FullScreen.xaml.cs プロジェクト: novatorem/Melodify
 private void Next_Click(object sender, RoutedEventArgs e)
 {
     Spotify.NextSong();
 }
コード例 #11
0
ファイル: FullScreen.xaml.cs プロジェクト: novatorem/Melodify
 private void Cover_Click(object sender, MouseButtonEventArgs e)
 {
     Spotify.PausePlaySong();
 }
コード例 #12
0
 private void PausePlay_Click(object sender, RoutedEventArgs e)
 {
     Spotify.PausePlaySong();
 }