Exemplo n.º 1
0
        /// <summary>
        /// RESET WINDOW
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            AnimationProvider.EnableAnimation();

            // Set Window Opacity to 100%
            SpotifyProvider.ResetAndInitOpacity();
            SpotifyProvider.ResetWindow();
        }
Exemplo n.º 2
0
        public async Task <string> PausePlay(IPAddress ipAdress, string hostname)
        {
            var    member = ServerVM.ConnectedMembers.Where(c => c.IPAddress.Equals(ipAdress)).SingleOrDefault();
            string res    = await SpotifyProvider.PerformPlayAsync();

            if (member != null)
            {
                ServerVM.WriteToLog($"{member.Hostname} hat Pause/Play gedrückt");
            }

            return(res);
        }
Exemplo n.º 3
0
 public WcfHost()
 {
     // Zur Verwendung von Spotify
     SpotifyProvider = new SpotifyProvider();
     SpotifyProvider.Connect();
 }
Exemplo n.º 4
0
        private static async Task UpdateStatus(LCUProvider lcu)
        {
            if (Stopping)
            {
                Log.Verborse("App", "Updating LoL status with initial message");
                await lcu.StatusMessage(InitStatus);

                Abort();
                return;
            }

            Log.Verborse("App", "Updating LoL status");

            string song = ExternalProvider.ReadStatusFile();

            if (song != "")
            {
                Log.Verborse("App", "Updating LoL status with External Provider");
            }
            else
            {
                song = SpotifyProvider.Song();
                if (song != "")
                {
                    Log.Verborse("App", "Updating LoL status with Spotify Provider");
                    if (song.Length > (LIMIT_STATUS - 2))
                    {
                        song = SpotifyProvider.Track();
                    }
                }
                else
                {
                    Log.Verborse("App", "Spotify is close or stopped?");
                }
            }


            if (song.Length > (LIMIT_STATUS - 2))
            {
                song = song.Substring(0, LIMIT_STATUS - 3) + "…";
            }
            else if (song.Length > (LIMIT_STATUS - 2))
            {
                song = song.Substring(0, LIMIT_STATUS - 2);
            }

            if (song.Equals("") || string.IsNullOrEmpty(song))
            {
                Log.Verborse("App", "Empty current song, updating LoL status with initial message");
                await lcu.StatusMessage(InitStatus);
            }
            else if (LastSong == null || !LastSong.Equals(song))
            {
                Log.Verborse("App", "Updating LoL status with " + song);
                await lcu.StatusMessage(string.Format("🎶 {0}", song));

                LastSong = song;
            }
            else
            {
                Log.Verborse("App", "LoL status not update");
            }
        }
Exemplo n.º 5
0
        async void hook_KeyDown(object sender, KeyEventArgs e)
        {
            if (ControlButtonPressed)
            {
                ControlButtonPressed = false;
                e.Handled            = true;
                switch (e.KeyCode)
                {
                case Keys.Space:
                    ControlButtonPressed = false;

                    Console.WriteLine("PauseStopp Performed");
                    this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPlayAsync();

                    e.Handled = true;
                    return;

                case Keys.End:
                    e.Handled = true;
                    return;

                case Keys.Up:
                    SpotifyProvider.PerformIncreaseVolume();
                    e.Handled = true;
                    return;

                case Keys.Down:
                    SpotifyProvider.PerformDecreaseVolume();
                    e.Handled = true;
                    return;

                case Keys.Right:
                    this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformNextSongAsync();

                    e.Handled = true;
                    return;

                case Keys.Left:
                    this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPreviousSongAsync();

                    e.Handled = true;
                    return;

                case Keys.LControlKey:
                    e.Handled = true;
                    return;

                case Keys.LShiftKey:
                    e.Handled = true;
                    return;

                default:
                    e.Handled = true;
                    return;
                }
            }

            if (Keys.LShiftKey == e.KeyCode)
            {
                ControlButtonPressed = true;
                e.Handled            = true;
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// DECREASE VOLUMNE
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonIncreaseVolume_Click(object sender, EventArgs e)
 {
     SpotifyProvider.PerformIncreaseVolume();
 }
Exemplo n.º 7
0
 /// <summary>
 /// PLAY PAUSE
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void button4_Click(object sender, EventArgs e)
 {
     this.textBoxCurrentSongName.Text = await SpotifyProvider.PerformPlayAsync();
 }
 public SpotifyController()
 {
     // Zur Verwendung von Spotify
     SpotifyProvider = new SpotifyProvider();
     SpotifyProvider.Connect();
 }