Beispiel #1
0
        private void RefreshInfo(object sender, EventArgs e)
        {
            if (CurrentSong is not null)
            {
                var format1 = "";
                var format2 = "";

                switch (CurrentPlayback.State)
                {
                case PlaybackState.Nothing:
                    format1 = Row1.FormatNothing;
                    format2 = Row2.FormatNothing;
                    break;

                case PlaybackState.Paused:
                    format1 = Row1.FormatPaused;
                    format2 = Row2.FormatPaused;
                    break;

                case PlaybackState.Playing:
                    format1 = Row1.FormatPlaying;
                    format2 = Row2.FormatPlaying;
                    break;
                }

                Row1.Text = Format(format1, CurrentSong, CurrentPlayback, CurrentPlayer);
                Row2.Text = Format(format2, CurrentSong, CurrentPlayback, CurrentPlayer);

                ResetAnimRow1?.Invoke(this, e);
                ResetAnimRow2?.Invoke(this, e);
            }


            //if (PlayerPlayback.State == PlaybackState.Playing)
            //{
            //    if (PlayerPlayback.Elapsed < CurrentSong.Length)
            //    {
            //        PlayerPlayback.Elapsed += 1;
            //    }
            //    else
            //    {
            //        Log.Warning("Elapsed time exceeded song length");
            //    }
            //}
        }
Beispiel #2
0
 void OnResetAnimRow2(object sender, RefreshEventArgs e)
 {
     ResetAnimRow2?.Invoke(this, e);
 }