Exemplo n.º 1
0
        private void QueryHeadsetOK(object sender, List <Headset> headsets)
        {
            if (headsets.Count > 0)
            {
                _isFoundHeadset = true;
                //Turn off timer
                _aTimer.Stop();
                _aTimer.Dispose();

                Headset headset = headsets.First <Headset>();
                if (headset.Status == "connected")
                {
                    _headsetId = headset.HeadsetID;
                    OnHeadsetConnected(this, _headsetId);
                }
                else
                {
                    if (!String.IsNullOrEmpty(headset.HeadsetID))
                    {
                        _ctxClient.ControlDevice("connect", headset.HeadsetID, new JObject());
                    }
                }
            }
            else
            {
                _isFoundHeadset = false;
                Console.WriteLine(" No headset available. Please connect headset to the machine");
            }
        }
Exemplo n.º 2
0
        private void QueryHeadsetOK(object sender, List <Headset> headsets)
        {
            if (headsets.Count > 0)
            {
                _isFoundHeadset = true;
                //Turn off timer
                _aTimer.Stop();
                _aTimer.Dispose();

                Headset headset = headsets.First <Headset>();
                if (headset.Status == "discovered")
                {
                    JObject flexMappings = new JObject();
                    if (headset.HeadsetID.IndexOf("FLEX", StringComparison.OrdinalIgnoreCase) > 0)
                    {
                        // For an Epoc Flex headset, we need a mapping
                        flexMappings = JObject.Parse(Config.FlexMapping);
                    }
                    _ctxClient.ControlDevice("connect", headset.HeadsetID, flexMappings);
                }
                else if (headset.Status == "connected")
                {
                    _headsetId = headset.HeadsetID;
                    OnHeadsetConnected(this, _headsetId);
                }
                else if (headset.Status == "connecting")
                {
                    Console.WriteLine(" Waiting for headset connection " + headset.HeadsetID);
                }
            }
            else
            {
                _isFoundHeadset = false;
                Console.WriteLine(" No headset available. Please connect headset to the machine");
            }
        }
Exemplo n.º 3
0
        public Session(JObject jSession)
        {
            //need check null
            if (jSession["headset"] != null)
            {
                Headset = new Headset((JObject)jSession["headset"]);
            }
            SessionID   = (string)jSession["id"];
            Status      = (string)jSession["status"];
            LicenseID   = (string)jSession["license"];
            StartedTime = (string)jSession["started"];
            JToken stopVal = jSession.GetValue("stopped");

            if (stopVal.Type != JTokenType.Null)
            {
                StoppedTime = (string)jSession["stopped"];
            }
            JToken recordingVal = jSession.GetValue("recording");

            if (recordingVal.Type != JTokenType.Null)
            {
                IsRecording = (bool)jSession["recording"];
            }
        }