public ushort GetVolume()
        {
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("CurrentVolume", 0u);
            RenderingControl.InvokeSync("GetVolume", arguments);
            return((ushort)arguments[2].DataValue);
        }
Example #2
0
        private bool GetMute()
        {
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("CurrentMute", 1);
            RenderingControl.InvokeSync("GetMute", arguments);
            return((bool)arguments[2].DataValue);
        }
Example #3
0
        /// <summary>
        /// Sets the volume of the current renderer
        /// </summary>
        public void SetVolume(double volume)
        {
            if (RenderingControl == null)
            {
                return;
            }
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("DesiredVolume", (UInt16)volume);
            RenderingControl.InvokeSync("SetVolume", arguments);
        }
Example #4
0
        /// <summary>
        /// Gets the volume of the current renderer
        /// </summary>
        public double GetVolume()
        {
            if (RenderingControl == null)
            {
                return(0);
            }
            var arguments = new UPnPArgument[3];

            arguments[0] = new UPnPArgument("InstanceID", 0u);
            arguments[1] = new UPnPArgument("Channel", "Master");
            arguments[2] = new UPnPArgument("CurrentVolume", 0u);
            RenderingControl.InvokeSync("GetVolume", arguments);
            return(Convert.ToDouble(arguments[2].DataValue));
        }