// Sets the currently playing audio text.
        public void SetAudioText(string s)
        {
            if (InvokeRequired)
            {
                Invoke(new Action <string>(SetAudioText), new object[] { s });
                return;
            }

            AudioText.Text = s.PadRight(s.Length + 20);

            // Turn off scroll if we're playing nothing.
            if (s.Equals(Strings.NotPlaying))
            {
                m_AudioTextTimer.Enabled = false;
                return;
            }
            else if (m_AudioTextTimer.Enabled == false)
            {
                m_AudioTextTimer.Enabled = true;
            }

            // If desktop notifications and we didn't return, show balloon text.
            if (m_DiscordBot != null && m_DiscordBot.GetDesktopNotifications() && SystemTray.Visible)
            {
                SystemTray.BalloonTipText = s;
                SystemTray.ShowBalloonTip(1000);
            }
        }
Beispiel #2
0
 private void ShowMessage(string title, string message)
 {
     if (showSystemTrayInfo)
     {
         SystemTray.ShowBalloonTip(1000, title, message, new ToolTipIcon());
     }
     else
     {
         MessageBox.Show(message);
     }
 }
Beispiel #3
0
        private void MainPlayerUpdateDuration()
        {
            String currentPositionString = mainPlayerWMP.controls.currentPositionString;

            DurationLabel.Text = currentPositionString == "" ? "00:00" : currentPositionString + " / " + mainPlayerWMP.currentMedia.durationString;

            int    index         = mainPlayerWMP.URL.LastIndexOf("\\") + 1;
            string marqueeString = mainPlayerWMP.URL.Substring(index, mainPlayerWMP.URL.Length - index);

            if (MarqueeLabel.Text != marqueeString)
            {
                MarqueeLabel.Text = marqueeString;
                ResetMarqueePosition();

                try
                {
                    TagLib.File file = TagLib.File.Create(mainPlayerWMP.URL);
                    if (file.Tag.Pictures.Length >= 1)
                    {
                        AlbumBox.Image = Image.FromStream(new MemoryStream(file.Tag.Pictures[0].Data.Data))
                                         .GetThumbnailImage(130, 130, null, IntPtr.Zero);
                    }
                    else
                    {
                        AlbumBox.Image = Properties.Resources.album_art;
                    }
                }
                catch
                {
                    AlbumBox.Image = Properties.Resources.album_art;
                }


                if (showSystemTrayInfo)
                {
                    SystemTray.ShowBalloonTip(1000, "Now Playing:", marqueeString, new ToolTipIcon());
                }
            }

            MainPlayerTrackBar.Maximum = (int)mainPlayerWMP.currentMedia.duration;
            MainPlayerTrackBar.Value   = MainPlayerTrackBar.Maximum == 0 ? 0 : (int)mainPlayerWMP.controls.currentPosition;
        }
Beispiel #4
0
 private void Minimize_Click(object sender, EventArgs e)
 {
     this.Hide();
     SystemTray.ShowBalloonTip(1000, "MouseInfo", "The App was minimized to System Tray", ToolTipIcon.Info);
 }