int TSPtt::SetPushToTalk(uint64 serverConnectionHandlerID, PTT_CHANGE_STATUS action) { // connect(timer, SIGNAL(timeout()), this, SLOT(onPttDelayFinished()),Qt::UniqueConnection); if (action == PTT_ACTIVATE) { // TSLogging::Print("PTT_ACTIVATE",serverConnectionHandlerID,LogLevel_DEBUG); // TSLogging::Print(QString("Timer is running: %1").arg(timer->isActive()?"true":"false"),serverConnectionHandlerID,LogLevel_DEBUG); if (timer->isActive()) timer->stop(); return SetPushToTalk(serverConnectionHandlerID, true); } else if (action == PTT_DEACTIVATE) { // TSLogging::Print("PTT_DEACTIVATE",serverConnectionHandlerID,LogLevel_DEBUG); UpdatePttDelayInfo(); if (pttDelayEnabled) timer->start(pttDelayMsec); else return SetPushToTalk(serverConnectionHandlerID, false); } else if (action == PTT_TOGGLE) // Toggling is always instant { if (pttActive && timer->isActive()) timer->stop(); return SetPushToTalk(serverConnectionHandlerID, !pttActive); } else //use NULL for Toggle? { TSLogging::Error("Ptt Status Error",serverConnectionHandlerID,NULL); } return 1; }
void __cdecl GkeySDKCallback(GkeyCode gkeyCode, wchar_t* gkeyOrButtonString, void* /*pContext*/) { if (gkeyCode.mouse) return; uint64 connhandler = GetActiveServerConnectionHandlerID(); if (gkeyCode.keyIdx == 5 ) { if (gkeyCode.keyDown) { SetPushToTalk(connhandler, true); } else { SetPushToTalk(connhandler, false); } } }