1.1 --- a/Server/MainForm.cs Sun Feb 08 17:27:02 2015 +0100
1.2 +++ b/Server/MainForm.cs Sun Feb 08 18:34:00 2015 +0100
1.3 @@ -222,6 +222,18 @@
1.4 iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar = trackBarMasterVolume.Value / 100.0f;
1.5 }
1.6
1.7 +
1.8 + /// <summary>
1.9 + /// Mute check box changed.
1.10 + /// </summary>
1.11 + /// <param name="sender"></param>
1.12 + /// <param name="e"></param>
1.13 + private void checkBoxMute_CheckedChanged(object sender, EventArgs e)
1.14 + {
1.15 + iMultiMediaDevice.AudioEndpointVolume.Mute = checkBoxMute.Checked;
1.16 + }
1.17 +
1.18 +
1.19 /// <summary>
1.20 /// Device State Changed
1.21 /// </summary>
1.22 @@ -271,8 +283,11 @@
1.23 return;
1.24 }
1.25
1.26 + //Update volume slider
1.27 float volumeLevelScalar = iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar;
1.28 trackBarMasterVolume.Value = Convert.ToInt32(volumeLevelScalar * 100);
1.29 + //Update mute checkbox
1.30 + checkBoxMute.Checked = iMultiMediaDevice.AudioEndpointVolume.Mute;
1.31
1.32 //TODO: Check our display device too
1.33 if (iDisplay.IsOpen())
1.34 @@ -293,6 +308,23 @@
1.35 }
1.36 }
1.37 }
1.38 +
1.39 + int muteIconCount = iDisplay.IconCount(Display.TMiniDisplayIconType.EMiniDisplayIconMute);
1.40 + if (muteIconCount > 0)
1.41 + {
1.42 + for (int i = 0; i < muteIconCount; i++)
1.43 + {
1.44 + if (iMultiMediaDevice.AudioEndpointVolume.Mute)
1.45 + {
1.46 + iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconMute, i, 10);
1.47 + }
1.48 + else
1.49 + {
1.50 + iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconMute, i, 0);
1.51 + }
1.52 + }
1.53 + }
1.54 +
1.55 }
1.56
1.57 }