Exemplo n.º 1
0
        private async Task UpdateAction()
        {
            while (true)
            {
                try
                {
                    using (PlayingInfo currentInfo = await GetCurrent())
                        if (!Object.Equals(currentInfo, _prevInfo))
                        {
                            _prevInfo = currentInfo;
                            PlayingInfoChanged?.Invoke(this, new PlayingEventArgs(currentInfo));
                        }

                    await Task.Delay(UpdateTimeoutMs);

                    await _updateSync.WaitAsync();
                }
                catch
                {
                    // doesn't matter if we got an exception here.
                }
            }
        }
Exemplo n.º 2
0
 private void ProviderOnPlayingInfoChanged(object sender, PlayingEventArgs e)
 {
     PlayingInfoChanged?.Invoke(this, e);
 }