internal override string Request(NativeClientHandle clientHandle) { NativeClient.SendMode360Command(clientHandle, ReceiverId, IsEnabled, out string requestId). ThrowIfError("Failed to send 360 mode command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { NativeClient.SendSearchCommand(clientHandle, ReceiverId, _searchHandle, out string requestId). ThrowIfError("Failed to send search command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { NativeClient.SendDisplayRotationCommand(clientHandle, ReceiverId, Rotation.ToNative(), out string requestId). ThrowIfError("Failed to send display rotation command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { NativeClient.SendPlaybackPositionCommand(clientHandle, ReceiverId, Position, out string requestId) .ThrowIfError("Failed to send playback position command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { ValidationUtil.ValidateEnum(typeof(MediaControlRepeatMode), Mode, nameof(Mode)); NativeClient.SendRepeatModeCommand(clientHandle, ReceiverId, Mode.ToNative(), out string requestId). ThrowIfError("Failed to send playback repeat command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { var mode = Enabled ? MediaControllerNativeShuffleMode.On : MediaControllerNativeShuffleMode.Off; NativeClient.SendShuffleModeCommand(clientHandle, ReceiverId, mode, out string requestId). ThrowIfError("Failed to send playback shuffle command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackCommand), Action, nameof(Action)); NativeClient.SendPlaylistCommand(clientHandle, ReceiverId, Name, Index, Action.ToNative(), Position, out string requestId).ThrowIfError("Failed to send playlist command."); return(requestId); }
internal override string Request(NativeClientHandle clientHandle) { string requestId = null; if (Bundle != null) { NativeClient.SendCustomCommandBundle(clientHandle, ReceiverId, Action, Bundle.SafeBundleHandle, out requestId). ThrowIfError("Failed to send custom command."); } else { NativeClient.SendCustomCommand(clientHandle, ReceiverId, Action, IntPtr.Zero, out requestId). ThrowIfError("Failed to send custom command."); } return(requestId); }
/// <summary> /// Responses command to the server. /// </summary> /// <param name="clientHandle">The client handle.</param> /// <param name="result">The result of each command.</param> /// <param name="bundle">The extra data.</param> internal void Response(NativeClientHandle clientHandle, int result, Bundle bundle) { try { if (bundle != null) { NativeClient.SendCustomEventReplyBundle(clientHandle, ReceiverId, _requestId, result, bundle.SafeBundleHandle) .ThrowIfError("Failed to response event."); } else { NativeClient.SendCustomEventReply(clientHandle, ReceiverId, _requestId, result, IntPtr.Zero) .ThrowIfError("Failed to response event."); } } catch (ArgumentException) { throw new InvalidOperationException("Server is not running"); } finally { OnResponseCompleted(); } }
/// <summary> /// Requests command to server. /// </summary> /// <returns>The request id for each command.</returns> internal abstract string Request(NativeClientHandle clientHandle);