Esempio n. 1
0
 static void SDKCallback(int eventType, int eventValue, System.String eventArg, System.IntPtr context)
 {
     if (eventType == LogitechArx.LOGI_ARX_EVENT_FOCUS_ACTIVE)
     {
         Console.WriteLine("arx: App active");
     }
     if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_ARRIVAL)
     {
         //Device connected
         Console.WriteLine("arx: device connected");
         LogitechArx.LogiArxAddFileAs("Resources\\index.html", "index.html");
         LogitechArx.LogiArxSetIndex("index.html");
     }
     else if (eventType == LogitechArx.LOGI_ARX_EVENT_MOBILEDEVICE_REMOVAL)
     {
         //Device disconnected
         Console.WriteLine("arx: device disconnected");
     }
     else if (eventType == LogitechArx.LOGI_ARX_EVENT_TAP_ON_TAG)
     {
         if (eventArg == "refreshButton")
         {
             Console.WriteLine("arx: " + eventArg + " tapped");
             LogitechArx.LogiArxAddFileAs("Resources\\index.html", "index.html");
             LogitechArx.LogiArxSetIndex("index.html");
         }
     }
 }
Esempio n. 2
0
        private static void UpdateArx(DiscordRpcClient client, string serverName, string channelName, List <ulong> speakers, Dictionary <ulong, string> connectedUsers)
        {
            string _serverName  = serverName ?? "No Server";
            string _channelName = channelName ?? "No Channel";

            // put all the speakers in a string. create a copy of the list first
            string _speakers = "";

            foreach (ulong s in speakers.ToList())
            {
                string user;
                if (connectedUsers.TryGetValue(s, out user))
                {
                    _speakers += user + " ";
                }
            }
            if (_speakers.Length != 0)
            {
                _speakers = "🎤 " + _speakers;
            }

            LogitechArx.LogiArxSetTagContentById("currentServer", _serverName);
            LogitechArx.LogiArxSetTagContentById("currentChannel", _channelName);
            LogitechArx.LogiArxSetTagContentById("currentSpeakers", _speakers);
        }
Esempio n. 3
0
        private static void InitARX()
        {
            contextCallback.arxCallBack = new LogitechArx.logiArxCB(SDKCallback);
            contextCallback.arxContext  = System.IntPtr.Zero;
            bool retVal = LogitechArx.LogiArxInit("sdk.sample.test", "C#test", ref contextCallback);

            if (!retVal)
            {
                int retCode = LogitechArx.LogiArxGetLastError();
                Console.WriteLine("arx: loading arx sdk failed:" + retCode);
            }
            Console.WriteLine("arx: init success: " + retVal);
        }