示例#1
0
        public void UnMute()
        {
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("DesiredMute", false);
            RenderingControl.InvokeAsync("SetMute", arguments);
        }
        public void SetVolume(ushort vol)
        {
            vol = Math.Min(Math.Max(vol, (ushort)0), (ushort)100);
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("DesiredVolume", vol);
            RenderingControl.InvokeAsync("SetVolume", arguments);
        }
示例#3
0
        public void SetVolume(ushort volume)
        {
            if (volume < 0 || volume > 100)
            {
                throw new Exception("Invalid volume setting.");
            }
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("DesiredVolume", volume);
            RenderingControl.InvokeAsync("SetVolume", arguments);
        }