コード例 #1
0
        public async Task <int> GetVolume(int instanceId, RenderingControlChannel channel)
        {
            IDictionary <string, string> result = await SendAction("SetVolume", new Dictionary <string, string>
            {
                { "InstanceID", instanceId.ToString() },
                { "Channel", channel.Value }
            });

            return(int.Parse(result["CurrentVolume"]));
        }
コード例 #2
0
        public async Task SetVolume(int instanceId, RenderingControlChannel channel, int volume)
        {
            if (volume < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(volume), "Must be greater or equal to zero");
            }

            await SendAction("SetVolume", new Dictionary <string, string>
            {
                { "InstanceID", instanceId.ToString() },
                { "Channel", channel.Value },
                { "DesiredVolume", volume.ToString() }
            });
        }