| 183 | } |
| 184 | |
| 185 | bool |
| 186 | ExportSamplesTask::openMat5(void) |
| 187 | { |
| 188 | su_mat_matrix_t *mtx = nullptr; |
| 189 | bool ok = false; |
| 190 | |
| 191 | SU_TRYCATCH(this->mf = su_mat_file_new(), goto done); |
| 192 | |
| 193 | SU_TRYCATCH( |
| 194 | mtx = su_mat_file_make_matrix(this->mf, "sampleRate", 1, 1), |
| 195 | goto done); |
| 196 | SU_TRYCATCH(su_mat_matrix_write_col(mtx, fs), goto done); |
| 197 | |
| 198 | SU_TRYCATCH( |
| 199 | mtx = su_mat_file_make_matrix(this->mf, "deltaT", 1, 1), |
| 200 | goto done); |
| 201 | SU_TRYCATCH(su_mat_matrix_write_col(mtx, 1 / fs), goto done); |
| 202 | |
| 203 | SU_TRYCATCH( |
| 204 | mtx = su_mat_file_make_streaming_matrix(this->mf, "X", 2, 0), |
| 205 | goto done); |
| 206 | SU_TRYCATCH(su_mat_file_dump(mf, path.toStdString().c_str()), goto done); |
| 207 | |
| 208 | ok = true; |
| 209 | |
| 210 | done: |
| 211 | if (!ok) |
| 212 | this->lastError = |
| 213 | "Cannot create Mat5 file " |
| 214 | + this->path |
| 215 | + ". See error log for details."; |
| 216 | |
| 217 | return ok; |
| 218 | } |
| 219 | |
| 220 | QString |
| 221 | ExportSamplesTask::getLastError(void) const |