# HG changeset patch # User StephaneLenclud # Date 1423418203 -3600 # Node ID debe115b3b22414fcccbb367dc62677d8043d98a # Parent 0846e5112dd7f08b1a901736e01bee14c22ad588 Audio: Taking icon statuc count into account. Volume indicator on MDM166AA now using half brightness bar when rounding up. diff -r 0846e5112dd7 -r debe115b3b22 Server/MainForm.cs --- a/Server/MainForm.cs Sun Feb 08 18:34:00 2015 +0100 +++ b/Server/MainForm.cs Sun Feb 08 18:56:43 2015 +0100 @@ -294,13 +294,25 @@ { int volumeIconCount = iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume); if (volumeIconCount > 0) - { + { int currentVolume = Convert.ToInt32(volumeLevelScalar * volumeIconCount); + + bool roundedUp = currentVolume > (volumeLevelScalar * volumeIconCount); + for (int i = 0; i < volumeIconCount; i++) { if (i < currentVolume) { - iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, 10); + if (i == currentVolume - 1 && roundedUp) + { + //Half brightness + iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, (iDisplay.IconStatusCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume) - 1)/2); + } + else + { + //Full brightness + iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconVolume, i, iDisplay.IconStatusCount(Display.TMiniDisplayIconType.EMiniDisplayIconVolume) - 1); + } } else { @@ -316,7 +328,7 @@ { if (iMultiMediaDevice.AudioEndpointVolume.Mute) { - iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconMute, i, 10); + iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconMute, i, iDisplay.IconStatusCount(Display.TMiniDisplayIconType.EMiniDisplayIconMute)-1); } else {