| 185 | } |
| 186 | |
| 187 | int CScreenCapture::slotStart() |
| 188 | { |
| 189 | qDebug(log) << "CScreenCapture::slotStart()"; |
| 190 | int nRet = 0; |
| 191 | CDlgCapture dlg(&m_Parameter); |
| 192 | nRet = RC_SHOW_WINDOW(&dlg); |
| 193 | if(QDialog::Accepted != nRet) |
| 194 | return 0; |
| 195 | |
| 196 | int nIndex = m_Parameter.GetScreen(); |
| 197 | if(m_Parameter.GetTarget() == CParameterScreenCapture::TARGET::Screen |
| 198 | && -1 < nIndex && nIndex < QApplication::screens().size()) { |
| 199 | m_ScreenCapture.setScreen(QApplication::screens().at(nIndex)); |
| 200 | m_CaptureSessioin.setScreenCapture(&m_ScreenCapture); |
| 201 | m_ScreenCapture.start(); |
| 202 | }else |
| 203 | m_CaptureSessioin.setScreenCapture(nullptr); |
| 204 | |
| 205 | if(m_Parameter.GetTarget() == CParameterScreenCapture::TARGET::Window) { |
| 206 | m_CaptureSessioin.setWindowCapture(&m_WindowCapture); |
| 207 | m_WindowCapture.setWindow(m_Parameter.GetWindow()); |
| 208 | m_WindowCapture.start(); |
| 209 | } else |
| 210 | m_CaptureSessioin.setWindowCapture(nullptr); |
| 211 | |
| 212 | if(m_Parameter.GetOperate() == CParameterScreenCapture::OPERATE::Record) { |
| 213 | m_CaptureSessioin.setRecorder(&m_Recorder); |
| 214 | m_Parameter.m_Record >> m_Recorder; |
| 215 | m_Recorder.record(); |
| 216 | qDebug(log) << "Record to file:" << m_Recorder.actualLocation(); |
| 217 | } |
| 218 | else |
| 219 | m_CaptureSessioin.setRecorder(nullptr); |
| 220 | |
| 221 | if(m_Parameter.GetOperate() == CParameterScreenCapture::OPERATE::Shot) { |
| 222 | m_CaptureSessioin.setImageCapture(&m_ImageCapture); |
| 223 | m_ImageCapture.capture(); |
| 224 | } else |
| 225 | m_CaptureSessioin.setImageCapture(nullptr); |
| 226 | |
| 227 | if(m_pWidget) |
| 228 | m_CaptureSessioin.setVideoOutput(m_pWidget); |
| 229 | |
| 230 | return 0; |
| 231 | } |
| 232 | |
| 233 | int CScreenCapture::slotStop() |
| 234 | { |
nothing calls this directly
no test coverage detected