void ViStreamInput::start() { if(mAudioInput == NULL) { mAudioInput = new QAudioInput(mDevice, mFormat.toQAudioFormat(), this); } if(mAudioInput->state() == QAudio::SuspendedState) { LOG("Recording resumed."); mAudioInput->resume(); } else if(state() != QAudio::ActiveState) { LOG("Recording started."); if(mBufferDevice != NULL) { delete mBufferDevice; } mBufferDevice = new ViStreamBuffer(mBuffer); if(mAudioInput != NULL) { mAudioInput->stop(); delete mAudioInput; } mAudioInput = new QAudioInput(mDevice, mFormat.toQAudioFormat(), this); mAudioInput->start(mBufferDevice); } startChecking(); setState(QAudio::ActiveState); }
void EWAUpdatesChecker::setUsed( bool bUsed ) { m_bUsed = bUsed; if( m_bUsed ) { startChecking(); } else { stopChecking(); initDefaultPrevMetchedValue(); m_pSite->setPrevMatched( m_strPrevMatchedValue ); } }
void NicerConnection::setRemoteCredentialsSync(const std::string& username, const std::string& password) { ELOG_DEBUG("%s message: Setting remote credentials", toLog()); std::vector<char *> attributes; std::string ufrag = std::string("ice-ufrag: ") + username; std::string pwd = std::string("ice-pwd: ") + password; attributes.push_back(const_cast<char *>(ufrag.c_str())); attributes.push_back(const_cast<char *>(pwd.c_str())); UINT4 r = nicer_->IcePeerContextParseStreamAttributes(peer_, stream_, attributes.size() ? &attributes[0] : nullptr, attributes.size()); if (r) { ELOG_WARN("%s message: Error parsing stream attributes", toLog()); return; } startChecking(); }