public void NotifyDefaultChanged(MMDevice audioDevice)
        {
            var toastData = new BannerData
            {
                Image = AudioDeviceIconExtractor.ExtractIconFromAudioDevice(audioDevice, true).ToBitmap(),
                Text  = audioDevice.FriendlyName
            };

            if (Configuration.CustomSound != null && File.Exists(Configuration.CustomSound.FilePath))
            {
                toastData.SoundFile = Configuration.CustomSound;
            }

            switch (audioDevice.DataFlow)
            {
            case DataFlow.Render:
                toastData.Title = SettingsStrings.tooltipOnHoverOptionPlaybackDevice;
                break;

            case DataFlow.Capture:
                toastData.Title = SettingsStrings.tooltipOnHoverOptionRecordingDevice;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(audioDevice.DataFlow), audioDevice.DataFlow, null);
            }
            new BannerManager().ShowNotification(toastData);
        }
Exemple #2
0
 /// <summary>
 ///     Using the DeviceClassIconPath, get the Icon
 /// </summary>
 /// <param name="device"></param>
 /// <param name="listView"></param>
 private void AddDeviceIconSmallImage(IAudioDevice device, ListView listView)
 {
     if (!listView.SmallImageList.Images.ContainsKey(device.DeviceClassIconPath))
     {
         listView.SmallImageList.Images.Add(device.DeviceClassIconPath,
                                            AudioDeviceIconExtractor.ExtractIconFromAudioDevice(device, true));
     }
 }