void Acquisition::stopRecord() { if (this->getState()!=AcquisitionService::sRUNNING) { return; } mLatestSession->stopLastInterval(); if (!mPluginData->getRecordSession(mLatestSession->getUid())) mPluginData->addRecordSession(mLatestSession); reporter()->playStopSound(); this->setState(AcquisitionService::sNOT_RUNNING); emit acquisitionStopped(); }
USAcquisition::USAcquisition(AcquisitionPtr base, QObject* parent) : QObject(parent), mBase(base), mReady(true), mInfoText("") { mCore.reset(new USSavingRecorder()); connect(mCore.get(), SIGNAL(saveDataCompleted(QString)), this, SLOT(checkIfReadySlot())); connect(mCore.get(), SIGNAL(saveDataCompleted(QString)), this, SIGNAL(saveDataCompleted(QString))); connect(this->getServices()->tracking().get(), &TrackingService::stateChanged, this, &USAcquisition::checkIfReadySlot); connect(this->getServices()->tracking().get(), SIGNAL(activeToolChanged(const QString&)), this, SLOT(checkIfReadySlot())); connect(this->getServices()->video().get(), SIGNAL(activeVideoSourceChanged()), this, SLOT(checkIfReadySlot())); connect(this->getServices()->video().get(), &VideoService::connected, this, &USAcquisition::checkIfReadySlot); connect(mBase.get(), SIGNAL(started()), this, SLOT(recordStarted())); connect(mBase.get(), SIGNAL(acquisitionStopped()), this, SLOT(recordStopped()), Qt::QueuedConnection); connect(mBase.get(), SIGNAL(cancelled()), this, SLOT(recordCancelled())); this->checkIfReadySlot(); }