| 134 | } |
| 135 | |
| 136 | void mitk::EventRecorder::StartRecording() |
| 137 | { |
| 138 | if (m_FileName == "") |
| 139 | { |
| 140 | MITK_ERROR << "EventRecorder::StartRecording - Filename needs to be set first."; |
| 141 | return; |
| 142 | } |
| 143 | if (m_FileStream.is_open()) |
| 144 | { |
| 145 | MITK_ERROR << "EventRecorder::StartRecording - Still recording. Stop recording before starting it again."; |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | m_FileStream.open(m_FileName.c_str(), std::ofstream::out); |
| 150 | if (!m_FileStream.good()) |
| 151 | { |
| 152 | MITK_ERROR << "File " << m_FileName << " could not be opened!"; |
| 153 | m_FileStream.close(); |
| 154 | return; |
| 155 | } |
| 156 | |
| 157 | m_Active = true; |
| 158 | |
| 159 | // write head and config |
| 160 | // <?xml version="1.0"?> |
| 161 | // <interactions> |
| 162 | // <config> |
| 163 | // <renderer RendererName="stdmulti.widget1" ViewDirection="1"/> |
| 164 | // <renderer RendererName="stdmulti.widget0" ViewDirection="0"/> |
| 165 | // ... |
| 166 | // </config> |
| 167 | // <events> |
| 168 | WriteEventXMLHeader(m_FileStream); |
| 169 | WriteEventXMLInteractionsOpen(m_FileStream); |
| 170 | WriteEventXMLConfig(m_FileStream); |
| 171 | WriteEventXMLEventsOpen(m_FileStream); |
| 172 | } |
| 173 | |
| 174 | void mitk::EventRecorder::StopRecording() |
| 175 | { |
nothing calls this directly
no test coverage detected