예제 #1
0
        protected override void ProcessPayload(int len)
        {
            //Get the opcode
            ushort opcode = BitConverter.ToUInt16(buffer, 0);

            //Switch on this
            switch (opcode)
            {
            case OP_BUTTON_PRESS:
                SDR.OnInput(new Input.UserInputEventArgs
                {
                    down = true,
                    key  = (Input.UserInputKey)BitConverter.ToUInt16(buffer, HEADER_LENGTH + 0)
                });
                break;

            case OP_AUDIO_SUBCRIBE:
                audioStreamer.SubscribeEvent();
                break;

            case OP_AUDIO_UNSUBCRIBE:
                audioStreamer.UnsubscribeEvent();
                break;

            case OP_SCREENCAP_SUBSCRIBE:
                screenStreamer.SubscribeEvent();
                break;

            case OP_SCREENCAP_UNSUBSCRIBE:
                screenStreamer.UnsubscribeEvent();
                break;
            }
        }