Exemple #1
0
        private void SongTitleTimerCallback(ThreadPoolTimer timer)
        {
            if (!_cancelRequested)
            {
                if (LocalSettings.Values["sendWinamp"] == null || !(bool)LocalSettings.Values["sendWinamp"])
                {
                    return;
                }
                var winamp = Winamp.GetSongTitle();

                if (winamp != null)
                {
                    if (_songTitle == winamp)
                    {
                        return;
                    }
                    _songTitle = winamp;
                    if (_songTitle != "Paused" && _songTitle != "Stopped")
                    {
                        var elements = Regex.Split(_songTitle, @"\s-\s");
                        //SendMessages.Enqueue("1;30003;Winamp" + ";" + elements[1] + ";" + elements[0]);
                    }
                    else
                    {
                        //SendMessages.Enqueue("1;30003;Winamp;Winamp;Not Playing");
                    }
                }
                else
                {
                    if (_songTitle == null)
                    {
                        return;
                    }
                    //SendMessages.Enqueue("0;30003");
                    _songTitle = null;
                }
            }
            else
            {
                _songTitleTimer.Cancel();
            }
        }
 public WinampControllerImpl(Winamp winamp)
 {
     this.winamp           = winamp;
     winamp.SongChanged   += (sender, args) => songChanged?.Invoke(sender, new SongChangedEventArgs(args));
     winamp.StatusChanged += (sender, args) => statusChanged?.Invoke(sender, args);
 }
Exemple #3
0
 public frmTest(Winamp winamp)
 {
     InitializeComponent();
     Winamp = winamp;
 }