예제 #1
0
        public override void ChangeIcon(UI.Component.TrayIcon trayIcon)
        {
            using var enumerator   = new MMDeviceEnumerator();
            using var defaultAudio = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);

            trayIcon.ReplaceIcon(new DeviceFullInfo(defaultAudio).SmallIcon);
        }
 public void ChangeIcon(UI.Component.TrayIcon trayIcon, DeviceFullInfo deviceInfo)
 {
     if (!NeedsToChangeIcon(deviceInfo))
     {
         return;
     }
     trayIcon.ReplaceIcon(deviceInfo.SmallIcon);
 }
예제 #3
0
        public override void ChangeIcon(UI.Component.TrayIcon trayIcon)
        {
            var defaultAudio = AudioSwitcher.Instance.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eConsole);

            if (defaultAudio != null)
            {
                trayIcon.ReplaceIcon(defaultAudio.SmallIcon);
            }
        }
예제 #4
0
 public override void ChangeIcon(UI.Component.TrayIcon trayIcon)
 {
     using var enumerator = new MMDeviceEnumerator();
     try
     {
         using var defaultAudio = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);
         trayIcon.ReplaceIcon(new DeviceFullInfo(defaultAudio).SmallIcon);
     }
     catch (System.Runtime.InteropServices.COMException e)
     {
         // Only handle "Element Not Found"
         if (e.ErrorCode == E_NOT_SET)
         {
             // Set to app icon
             trayIcon.ReplaceIcon(Resources.Switch_SoundWave);
         }
         else
         {
             // Throw other ErrorCodes
             throw e;
         }
     }
 }
 public abstract void ChangeIcon(UI.Component.TrayIcon trayIcon);
예제 #6
0
 public void ChangeIcon(UI.Component.TrayIcon trayIcon, DeviceFullInfo deviceInfo)
 {
 }
예제 #7
0
 public void ChangeIcon(UI.Component.TrayIcon trayIcon)
 {
     trayIcon.ReplaceIcon(Resources.Switch_SoundWave);
 }