Пример #1
0
        /// <summary>
        ///     Executes the RestoreVolumePriorToRamp action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        public async Task RestoreVolumePriorToRamp(UInt32 instanceId, AargtypeChannelEnum channel)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "Channel" },
                Name               = CsActionRestoreVolumePriorToRamp,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Пример #2
0
        /// <summary>
        ///     Executes the SetLoudness action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        /// <param name="desiredLoudness">In value for the DesiredLoudness action parameter.</param>
        public async Task SetLoudness(UInt32 instanceId, AargtypeChannelEnum channel, Boolean desiredLoudness)
        {
            var loIn = new object[3];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            loIn[2] = desiredLoudness;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "Channel", "DesiredLoudness" },
                Name               = CsActionSetLoudness,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Пример #3
0
        /// <summary>
        ///     Gets the string value for the AARGTYPEChannel state var from its enumeration value.
        /// </summary>
        /// <param name="value">The enumeration value to get the string value for.</param>
        /// <returns>The string value for the enumeration, or string.empty if AARGTYPEChannelEnum.Invalid or out of range.</returns>
        public static string ToStringAargtypeChannel(AargtypeChannelEnum value)
        {
            switch (value)
            {
            case AargtypeChannelEnum.Master:
                return(CsAllowedValAargtypeChannelMaster);

            case AargtypeChannelEnum.Lf:
                return(CsAllowedValAargtypeChannelLf);

            case AargtypeChannelEnum.Rf:
                return(CsAllowedValAargtypeChannelRf);

            default:
                return(String.Empty);
            }
        }
Пример #4
0
        /// <summary>
        ///     Executes the GetLoudness action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        /// <returns>Out value for the CurrentLoudness action parameter.</returns>
        public async Task <ActionResult> GetLoudness(UInt32 instanceId, AargtypeChannelEnum channel)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "Channel" },
                Name               = CsActionGetLoudness,
                ExpectedReplyCount = 1
            };
            SoapActionResult result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }
Пример #5
0
        /// <summary>
        ///     Executes the SetRelativeVolume action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        /// <param name="adjustment">In value for the Adjustment action parameter.</param>
        /// <returns>Out value for the NewVolume action parameter. With range of 0 to 100. Increment of 1.</returns>
        public async Task <ActionResult> SetRelativeVolume(UInt32 instanceId, AargtypeChannelEnum channel,
                                                           Int32 adjustment)
        {
            var loIn = new object[3];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            loIn[2] = adjustment;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "Channel", "Adjustment" },
                Name               = CsActionSetRelativeVolume,
                ExpectedReplyCount = 1
            };

            SoapActionResult result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }
Пример #6
0
        /// <summary>
        ///     Executes the RampToVolume action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        /// <param name="rampType">In value for the RampType action parameter.</param>
        /// <param name="desiredVolume">In value for the DesiredVolume action parameter. With range of 0 to 100. Increment of 1.</param>
        /// <param name="resetVolumeAfter">In value for the ResetVolumeAfter action parameter.</param>
        /// <param name="programUri">In value for the ProgramURI action parameter.</param>
        /// <returns>Out value for the RampTime action parameter.</returns>
        public async Task <ActionResult> RampToVolume(UInt32 instanceId, AargtypeChannelEnum channel,
                                                      AargtypeRampTypeEnum rampType, UInt16 desiredVolume, Boolean resetVolumeAfter, String programUri)
        {
            var loIn = new object[6];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            loIn[2] = RenderingControlExtensions.ToStringAargtypeRampType(rampType);
            loIn[3] = desiredVolume;
            loIn[4] = resetVolumeAfter;
            loIn[5] = programUri;
            var action = new SoapAction
            {
                ArgNames =
                    new[] { "InstanceID", "Channel", "RampType", "DesiredVolume", "ResetVolumeAfter", "ProgramURI" },
                Name = CsActionRampToVolume,
                ExpectedReplyCount = 1
            };
            SoapActionResult result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }