Ejemplo n.º 1
0
 public WindowsList(float fps)
 {
     FPS = fps;
     //For testing only one window
     if (Program.DEBUG_FIXWINDOWHANDLES.Length > 0)
     {
         Console.WriteLine("For testing please check the FAR Handle.");
         foreach (var f in Program.DEBUG_FIXWINDOWHANDLES)
         {
             HandlesList.Add(f, HandlesList.windows);
         }
         return;
     }
     if (!Program.TEST_WINDOWSLIST)
     {
         bms = BabylonMS.BabylonMS.LaunchMiniShip(out proc_windowslist, "WindowsList.exe", UUIDWindowsList, UUIDWindowsList, Program.instanceUUID); //UUID
     }
     else
     {
     }
     Console.WriteLine("WindowsList Ship launched.");
     bms.NewInputFrame          += NewInputFrame;
     bms.ServerReadyForTransfer += ReadyForTransfer;
     bms.PrepareGate();
 }
Ejemplo n.º 2
0
 void Disconnect(BabylonMS.BMSEventSessionParameter session) //And reconnect
 {
     Console.WriteLine("ScreenContent disconnect window content not reachable. " + Hwnd.ToString("X"));
     //screen capture class need to remove from handles list and
     session.inputPack.ClearFields();
     session.inputPack.AddField("CMD", BabylonMS.BabylonMS.CONST_FT_INT8).Value(VRCEShared.CONST_ANDROIDCOMMAND_LOST_WINDOW);
     session.inputPack.AddField("HWND", BabylonMS.BabylonMS.CONST_FT_INT64).Value(Hwnd);
     session.inputPack.AddField("GROUP", BabylonMS.BabylonMS.CONST_FT_UUID).ValueAsUUID(Program.instanceUUID); //TODO ezt 't kell gondolni hogy  tényleg ezt kell e küldeni.. de valszeg igen
     Program.androids.sendNoticeToAndroidsNewContent(session);                                                 // inputpack,reader,writer);//So the partner will send a request for imagebuffer on TCP
     //IBIface.Disconnect(session);
     HandlesList.Remove(Hwnd, HandlesList.windows);
     if (focused == this)
     {
         focused = null;
     }
 }
Ejemplo n.º 3
0
 void NewInputFrame(BabylonMS.BMSEventSessionParameter session)
 {
     try
     {
         //Console.Write("L ");
         foreach (BabylonMS.BMSField f in session.inputPack.GetFields())
         {
             Int64 hwnd = f.getValue(0);
             HandlesList.Add(hwnd, HandlesList.windows);
         }
         //Int64 buffer = session.inputPack.GetField(0).getValue(0);
         //Console.Write("arrived. ");
     }
     catch (Exception) {
         Console.WriteLine("Error.");
     }
 }
Ejemplo n.º 4
0
        //F R O M   A N D R O I D
        //void InputFrame_fromAnAndroid(String partnerUUID, BabylonMS.BMSPack pack, TcpClient client, StreamReader reader, StreamWriter writer)
        void InputFrame_fromAnAndroid(BabylonMS.BMSEventSessionParameter session)
        {
            AndroidDescriptor thisAndroid = getAndroidDescriptor(session.client);

            //Nothing
            //- direct retrieve images
            //- setup mouse behaviour
            // etc... select requested images
            byte cmd = (byte)session.inputPack.GetField(0).getValue(0);

            switch (cmd)
            {
            case VRCEShared.CONST_ANDROIDCOMMAND_SUBSCRIBE_HWND:      //subscribe hwnd
                break;

            case VRCEShared.CONST_ANDROIDCOMMAND_SUBSCRIBE_TYPE:      //subscribe type (images,mouse,keyboard....
                break;

            case VRCEShared.CONST_ANDROIDCOMMAND_RETRIEVE_HWND:      //Direct retrieve a buffer element if need independently from refresh
            {
                //TODO szerintem nincs kész nem tesztelt...!

                //request from IMAGEBUFFER
                byte index = (byte)session.inputPack.GetField(1).getValue(0);
                //Request imagebuffer on tcp
                session.outputPack.Clear();
                session.outputPack.SetAttribs(BabylonMS.BabylonMS.CONST_AutosendOutputpack);                                        //A felkapcsolódás után az alábbi packot fogja elküldeni vissza
                                                                                                                                    //Így megspórolhatunk egy event-et és nem várunk semmire
                session.outputPack.AddField("CMD", BabylonMS.BabylonMS.CONST_FT_INT8).Value(VRCEShared.CONST_COMMAND_RETRIEVE_IDX); //TODO
                session.outputPack.AddField("IDX", BabylonMS.BabylonMS.CONST_FT_INT8).Value(index);
                session.TransferPacket(true);
            }
            break;

            case VRCEShared.CONST_ANDROIDCOMMAND_RETRIEVE_ALL:     //Elküldi a legfrissebb tartalmat minden feliratkozott képről.(feliratkozások minden Androidhoz előzőleg letárolva)
            {
                //Message_To_ImageBuffer_CONST_COMMAND_RETRIEVE(thisAndroid,session.);
                Message_To_ImageBuffer_CONST_COMMAND_RETRIEVE(thisAndroid, (BabylonMS.BMSEventSessionParameter)thisAndroid.bms_imagebuffer.Tag);
                Console.WriteLine("First retrieve for imagebuffer");
            }
            break;

            case VRCEShared.CONST_ANDROIDCOMMAND_FOCUS_WINDOW:      //Rááll egy ablakra
                //TODO kapcsolt hálózat? egyelőre ez a gép
            {
                String groupUUID = session.inputPack.GetFieldByName("GROUP").GetUUIDValue(0);
                if (BabylonMS.BabylonMS.compareUUID(Program.instanceUUID, groupUUID))
                {
                    //this instance
                    Int64       hwnd = session.inputPack.GetFieldByName("HWND").getValue(0);
                    HandlesList win  = HandlesList.getw(hwnd, HandlesList.windows);
                    if (win != null)
                    {
                        win.sc.BringToFront();
                    }
                }

                break;
            }
            }
        }